@awacloud/fw 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/LICENSE +176 -0
- package/NOTICE +12 -0
- package/README.md +355 -0
- package/dist/build/fw.core.pure.meta.json +29 -0
- package/dist/build/fw.core.pure.min.js +26 -0
- package/dist/build/fw.full.pure.meta.json +224 -0
- package/dist/build/fw.full.pure.min.js +60 -0
- package/dist/build/fw.minimal.pure.meta.json +21 -0
- package/dist/build/fw.minimal.pure.min.js +26 -0
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +29 -0
- package/dist/build/fw.pack.compress-heavy.pure.min.js +8 -0
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +38 -0
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-basic.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-identity.pure.min.js +9 -0
- package/dist/build/fw.pack.realtime.pure.meta.json +21 -0
- package/dist/build/fw.pack.realtime.pure.min.js +6 -0
- package/dist/build/fw.pack.sensors.pure.meta.json +21 -0
- package/dist/build/fw.pack.sensors.pure.min.js +6 -0
- package/dist/build/fw.pack.structures-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.structures-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.text-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.text-advanced.pure.min.js +6 -0
- package/dist/build/fw.pwa.pure.meta.json +127 -0
- package/dist/build/fw.pwa.pure.min.js +55 -0
- package/dist/build/fw.site-interactive.pure.meta.json +81 -0
- package/dist/build/fw.site-interactive.pure.min.js +52 -0
- package/dist/build/fw.site.pure.meta.json +51 -0
- package/dist/build/fw.site.pure.min.js +35 -0
- package/dist/build/fw.spa.pure.meta.json +108 -0
- package/dist/build/fw.spa.pure.min.js +55 -0
- package/dist/build/io/compress/brotli_dict.bin +432 -0
- package/dist/build/sanity-base-classic.min.js +6 -0
- package/dist/build/sanity-community-classic.min.js +6 -0
- package/dist/build/sanity.min.js +6 -0
- package/dist/types/core/logger.d.ts +71 -0
- package/dist/types/core/logger.d.ts.map +1 -0
- package/dist/types/core/modules.d.ts +3962 -0
- package/dist/types/core/modules.d.ts.map +1 -0
- package/dist/types/core/readyState.d.ts +14 -0
- package/dist/types/core/readyState.d.ts.map +1 -0
- package/dist/types/core/runtime.d.ts +625 -0
- package/dist/types/core/runtime.d.ts.map +1 -0
- package/dist/types/core/worker-helper.d.ts +153 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -0
- package/dist/types/crypto/cipher/aes.d.ts +55 -0
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -0
- package/dist/types/crypto/cipher/chacha20.d.ts +33 -0
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -0
- package/dist/types/crypto/hash/adf.d.ts +65 -0
- package/dist/types/crypto/hash/adf.d.ts.map +1 -0
- package/dist/types/crypto/hash/argon2.d.ts +79 -0
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -0
- package/dist/types/crypto/hash/blake2b.d.ts +40 -0
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/hash/hkdf.d.ts +88 -0
- package/dist/types/crypto/hash/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/hash/hmac.d.ts +85 -0
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts +80 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/hash/poly1305.d.ts +31 -0
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha224.d.ts +80 -0
- package/dist/types/crypto/hash/sha224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha256.d.ts +82 -0
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha3.d.ts +111 -0
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha384.d.ts +84 -0
- package/dist/types/crypto/hash/sha384.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512.d.ts +87 -0
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_224.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_256.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_256.d.ts.map +1 -0
- package/dist/types/crypto/mode/cbc.d.ts +38 -0
- package/dist/types/crypto/mode/cbc.d.ts.map +1 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts +71 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/mode/cmac.d.ts +56 -0
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -0
- package/dist/types/crypto/mode/ctr.d.ts +52 -0
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -0
- package/dist/types/crypto/mode/gcm.d.ts +88 -0
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -0
- package/dist/types/crypto/mode/kw.d.ts +60 -0
- package/dist/types/crypto/mode/kw.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ecc.d.ts +284 -0
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ed25519.d.ts +107 -0
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts +154 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts +383 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts +174 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts +194 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/rsa.d.ts +175 -0
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts +232 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/x25519.d.ts +37 -0
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts +84 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_modes.d.ts +128 -0
- package/dist/types/crypto/utils/aes_modes.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts +45 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1.d.ts +115 -0
- package/dist/types/crypto/utils/asn1.d.ts.map +1 -0
- package/dist/types/crypto/utils/bitArray.d.ts +75 -0
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -0
- package/dist/types/crypto/utils/bn.d.ts +214 -0
- package/dist/types/crypto/utils/bn.d.ts.map +1 -0
- package/dist/types/crypto/utils/jws.d.ts +159 -0
- package/dist/types/crypto/utils/jws.d.ts.map +1 -0
- package/dist/types/crypto/utils/keyformat.d.ts +100 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -0
- package/dist/types/crypto/utils/pad.d.ts +44 -0
- package/dist/types/crypto/utils/pad.d.ts.map +1 -0
- package/dist/types/crypto/utils/pem.d.ts +41 -0
- package/dist/types/crypto/utils/pem.d.ts.map +1 -0
- package/dist/types/crypto/utils/random.d.ts +203 -0
- package/dist/types/crypto/utils/random.d.ts.map +1 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts +162 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -0
- package/dist/types/crypto/utils/totp.d.ts +183 -0
- package/dist/types/crypto/utils/totp.d.ts.map +1 -0
- package/dist/types/crypto/utils/uuid.d.ts +29 -0
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -0
- package/dist/types/crypto/wasm/aes.d.ts +59 -0
- package/dist/types/crypto/wasm/aes.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +70 -0
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/blake2b.d.ts +59 -0
- package/dist/types/crypto/wasm/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts +43 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/wasm/cmac.d.ts +42 -0
- package/dist/types/crypto/wasm/cmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ecc.d.ts +56 -0
- package/dist/types/crypto/wasm/ecc.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ed25519.d.ts +52 -0
- package/dist/types/crypto/wasm/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hkdf.d.ts +40 -0
- package/dist/types/crypto/wasm/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hmac.d.ts +42 -0
- package/dist/types/crypto/wasm/hmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts +48 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts +58 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts +38 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/rsa.d.ts +56 -0
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/runtime.d.ts +99 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha2.d.ts +45 -0
- package/dist/types/crypto/wasm/sha2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha3.d.ts +57 -0
- package/dist/types/crypto/wasm/sha3.d.ts.map +1 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts +62 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/x25519.d.ts +53 -0
- package/dist/types/crypto/wasm/x25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aes.d.ts +59 -0
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts +40 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/digest.d.ts +43 -0
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts +51 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts +18 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts +43 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts +18 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts +51 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts.map +1 -0
- package/dist/types/dom/display/animate.d.ts +35 -0
- package/dist/types/dom/display/animate.d.ts.map +1 -0
- package/dist/types/dom/display/fullscreen.d.ts +59 -0
- package/dist/types/dom/display/fullscreen.d.ts.map +1 -0
- package/dist/types/dom/fs/download.d.ts +36 -0
- package/dist/types/dom/fs/download.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts +107 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -0
- package/dist/types/dom/fs/indexedDB.d.ts +62 -0
- package/dist/types/dom/fs/indexedDB.d.ts.map +1 -0
- package/dist/types/dom/fs/remoteStore.d.ts +64 -0
- package/dist/types/dom/fs/remoteStore.d.ts.map +1 -0
- package/dist/types/dom/fs/storage.d.ts +56 -0
- package/dist/types/dom/fs/storage.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/idle.d.ts +91 -0
- package/dist/types/dom/lifecycle/idle.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/visibility.d.ts +49 -0
- package/dist/types/dom/lifecycle/visibility.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts +69 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts.map +1 -0
- package/dist/types/dom/net/ajax.d.ts +27 -0
- package/dist/types/dom/net/ajax.d.ts.map +1 -0
- package/dist/types/dom/net/broadcastChannel.d.ts +51 -0
- package/dist/types/dom/net/broadcastChannel.d.ts.map +1 -0
- package/dist/types/dom/net/network.d.ts +80 -0
- package/dist/types/dom/net/network.d.ts.map +1 -0
- package/dist/types/dom/net/sse.d.ts +72 -0
- package/dist/types/dom/net/sse.d.ts.map +1 -0
- package/dist/types/dom/net/webrtc.d.ts +149 -0
- package/dist/types/dom/net/webrtc.d.ts.map +1 -0
- package/dist/types/dom/net/ws.d.ts +70 -0
- package/dist/types/dom/net/ws.d.ts.map +1 -0
- package/dist/types/dom/query/dnd.d.ts +86 -0
- package/dist/types/dom/query/dnd.d.ts.map +1 -0
- package/dist/types/dom/query/dom.d.ts +194 -0
- package/dist/types/dom/query/dom.d.ts.map +1 -0
- package/dist/types/dom/query/events.d.ts +135 -0
- package/dist/types/dom/query/events.d.ts.map +1 -0
- package/dist/types/dom/query/gesture.d.ts +59 -0
- package/dist/types/dom/query/gesture.d.ts.map +1 -0
- package/dist/types/dom/query/media.d.ts +156 -0
- package/dist/types/dom/query/media.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts +143 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -0
- package/dist/types/dom/rendering/component.d.ts +92 -0
- package/dist/types/dom/rendering/component.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts +83 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools.d.ts +68 -0
- package/dist/types/dom/rendering/devtools.d.ts.map +1 -0
- package/dist/types/dom/rendering/parser.d.ts +216 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts +101 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts.map +1 -0
- package/dist/types/dom/rendering/render.d.ts +121 -0
- package/dist/types/dom/rendering/render.d.ts.map +1 -0
- package/dist/types/dom/rendering/sanitize.d.ts +48 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -0
- package/dist/types/dom/rendering/secPolicy.d.ts +89 -0
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +251 -0
- package/dist/types/dom/rendering/template.d.ts.map +1 -0
- package/dist/types/dom/rendering/themeTokens.d.ts +61 -0
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts +192 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts +63 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts +205 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession.d.ts +285 -0
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts +80 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts.map +1 -0
- package/dist/types/dom/sensors/battery.d.ts +71 -0
- package/dist/types/dom/sensors/battery.d.ts.map +1 -0
- package/dist/types/dom/sensors/geolocation.d.ts +83 -0
- package/dist/types/dom/sensors/geolocation.d.ts.map +1 -0
- package/dist/types/dom/sensors/networkInfo.d.ts +82 -0
- package/dist/types/dom/sensors/networkInfo.d.ts.map +1 -0
- package/dist/types/dom/sensors/sensors.d.ts +191 -0
- package/dist/types/dom/sensors/sensors.d.ts.map +1 -0
- package/dist/types/dom/sw/backgroundSync.d.ts +48 -0
- package/dist/types/dom/sw/backgroundSync.d.ts.map +1 -0
- package/dist/types/dom/sw/cache.d.ts +71 -0
- package/dist/types/dom/sw/cache.d.ts.map +1 -0
- package/dist/types/dom/sw/push.d.ts +77 -0
- package/dist/types/dom/sw/push.d.ts.map +1 -0
- package/dist/types/dom/sw/serviceWorker.d.ts +57 -0
- package/dist/types/dom/sw/serviceWorker.d.ts.map +1 -0
- package/dist/types/dom/sw/sharedWorker.d.ts +81 -0
- package/dist/types/dom/sw/sharedWorker.d.ts.map +1 -0
- package/dist/types/dom/utils/a11y.d.ts +53 -0
- package/dist/types/dom/utils/a11y.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +44 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -0
- package/dist/types/dom/utils/entropyCollector.d.ts +58 -0
- package/dist/types/dom/utils/entropyCollector.d.ts.map +1 -0
- package/dist/types/dom/utils/focus.d.ts +123 -0
- package/dist/types/dom/utils/focus.d.ts.map +1 -0
- package/dist/types/dom/utils/form.d.ts +227 -0
- package/dist/types/dom/utils/form.d.ts.map +1 -0
- package/dist/types/dom/utils/formKit.d.ts +206 -0
- package/dist/types/dom/utils/formKit.d.ts.map +1 -0
- package/dist/types/dom/utils/keybindings.d.ts +53 -0
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -0
- package/dist/types/dom/utils/leaderElection.d.ts +70 -0
- package/dist/types/dom/utils/leaderElection.d.ts.map +1 -0
- package/dist/types/dom/utils/notifications.d.ts +164 -0
- package/dist/types/dom/utils/notifications.d.ts.map +1 -0
- package/dist/types/dom/utils/permissions.d.ts +35 -0
- package/dist/types/dom/utils/permissions.d.ts.map +1 -0
- package/dist/types/dom/utils/route.d.ts +117 -0
- package/dist/types/dom/utils/route.d.ts.map +1 -0
- package/dist/types/dom/utils/ua.d.ts +35 -0
- package/dist/types/dom/utils/ua.d.ts.map +1 -0
- package/dist/types/dom/utils/webauthn.d.ts +98 -0
- package/dist/types/dom/utils/webauthn.d.ts.map +1 -0
- package/dist/types/io/binary/reader.d.ts +59 -0
- package/dist/types/io/binary/reader.d.ts.map +1 -0
- package/dist/types/io/binary/writer.d.ts +56 -0
- package/dist/types/io/binary/writer.d.ts.map +1 -0
- package/dist/types/io/calc/adler32.d.ts +31 -0
- package/dist/types/io/calc/adler32.d.ts.map +1 -0
- package/dist/types/io/calc/bigint.d.ts +74 -0
- package/dist/types/io/calc/bigint.d.ts.map +1 -0
- package/dist/types/io/calc/crc32.d.ts +36 -0
- package/dist/types/io/calc/crc32.d.ts.map +1 -0
- package/dist/types/io/calc/easing.d.ts +60 -0
- package/dist/types/io/calc/easing.d.ts.map +1 -0
- package/dist/types/io/codec/b64.d.ts +28 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -0
- package/dist/types/io/codec/base32.d.ts +28 -0
- package/dist/types/io/codec/base32.d.ts.map +1 -0
- package/dist/types/io/codec/base58.d.ts +28 -0
- package/dist/types/io/codec/base58.d.ts.map +1 -0
- package/dist/types/io/codec/buffer.d.ts +66 -0
- package/dist/types/io/codec/buffer.d.ts.map +1 -0
- package/dist/types/io/codec/cbor.d.ts +43 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -0
- package/dist/types/io/codec/csv.d.ts +35 -0
- package/dist/types/io/codec/csv.d.ts.map +1 -0
- package/dist/types/io/codec/hex.d.ts +28 -0
- package/dist/types/io/codec/hex.d.ts.map +1 -0
- package/dist/types/io/codec/mime.d.ts +100 -0
- package/dist/types/io/codec/mime.d.ts.map +1 -0
- package/dist/types/io/codec/msgpack.d.ts +36 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -0
- package/dist/types/io/codec/url.d.ts +52 -0
- package/dist/types/io/codec/url.d.ts.map +1 -0
- package/dist/types/io/codec/utf8.d.ts +22 -0
- package/dist/types/io/codec/utf8.d.ts.map +1 -0
- package/dist/types/io/codec/xml.d.ts +91 -0
- package/dist/types/io/codec/xml.d.ts.map +1 -0
- package/dist/types/io/compress/bitstream.d.ts +51 -0
- package/dist/types/io/compress/bitstream.d.ts.map +1 -0
- package/dist/types/io/compress/brotli.d.ts +86 -0
- package/dist/types/io/compress/brotli.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict.d.ts +76 -0
- package/dist/types/io/compress/brotli_dict.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts +43 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_frame.d.ts +166 -0
- package/dist/types/io/compress/brotli_frame.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_shared.d.ts +165 -0
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -0
- package/dist/types/io/compress/deflate.d.ts +89 -0
- package/dist/types/io/compress/deflate.d.ts.map +1 -0
- package/dist/types/io/compress/gzip.d.ts +100 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -0
- package/dist/types/io/compress/huffman.d.ts +37 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -0
- package/dist/types/io/compress/lz4.d.ts +45 -0
- package/dist/types/io/compress/lz4.d.ts.map +1 -0
- package/dist/types/io/compress/lz77.d.ts +66 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -0
- package/dist/types/io/compress/lzw.d.ts +37 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -0
- package/dist/types/io/compress/zip.d.ts +112 -0
- package/dist/types/io/compress/zip.d.ts.map +1 -0
- package/dist/types/io/compress/zlib.d.ts +97 -0
- package/dist/types/io/compress/zlib.d.ts.map +1 -0
- package/dist/types/io/i18n/i18n.d.ts +64 -0
- package/dist/types/io/i18n/i18n.d.ts.map +1 -0
- package/dist/types/io/math/fixed-point.d.ts +30 -0
- package/dist/types/io/math/fixed-point.d.ts.map +1 -0
- package/dist/types/io/math/geom.d.ts +125 -0
- package/dist/types/io/math/geom.d.ts.map +1 -0
- package/dist/types/io/math/interp.d.ts +48 -0
- package/dist/types/io/math/interp.d.ts.map +1 -0
- package/dist/types/io/math/linalg.d.ts +117 -0
- package/dist/types/io/math/linalg.d.ts.map +1 -0
- package/dist/types/io/math/stats.d.ts +45 -0
- package/dist/types/io/math/stats.d.ts.map +1 -0
- package/dist/types/io/structures/btree.d.ts +84 -0
- package/dist/types/io/structures/btree.d.ts.map +1 -0
- package/dist/types/io/structures/heap.d.ts +75 -0
- package/dist/types/io/structures/heap.d.ts.map +1 -0
- package/dist/types/io/structures/lruCache.d.ts +88 -0
- package/dist/types/io/structures/lruCache.d.ts.map +1 -0
- package/dist/types/io/structures/ringBuffer.d.ts +82 -0
- package/dist/types/io/structures/ringBuffer.d.ts.map +1 -0
- package/dist/types/io/structures/tree-walker.d.ts +95 -0
- package/dist/types/io/structures/tree-walker.d.ts.map +1 -0
- package/dist/types/io/structures/trie.d.ts +71 -0
- package/dist/types/io/structures/trie.d.ts.map +1 -0
- package/dist/types/io/sync/abort.d.ts +59 -0
- package/dist/types/io/sync/abort.d.ts.map +1 -0
- package/dist/types/io/sync/atomics.d.ts +107 -0
- package/dist/types/io/sync/atomics.d.ts.map +1 -0
- package/dist/types/io/sync/cancellable.d.ts +69 -0
- package/dist/types/io/sync/cancellable.d.ts.map +1 -0
- package/dist/types/io/sync/channel.d.ts +70 -0
- package/dist/types/io/sync/channel.d.ts.map +1 -0
- package/dist/types/io/sync/mutex.d.ts +39 -0
- package/dist/types/io/sync/mutex.d.ts.map +1 -0
- package/dist/types/io/sync/semaphore.d.ts +40 -0
- package/dist/types/io/sync/semaphore.d.ts.map +1 -0
- package/dist/types/io/sync/tokenBucket.d.ts +53 -0
- package/dist/types/io/sync/tokenBucket.d.ts.map +1 -0
- package/dist/types/io/text/ansi.d.ts +125 -0
- package/dist/types/io/text/ansi.d.ts.map +1 -0
- package/dist/types/io/text/html-entities.d.ts +35 -0
- package/dist/types/io/text/html-entities.d.ts.map +1 -0
- package/dist/types/io/text/semver.d.ts +75 -0
- package/dist/types/io/text/semver.d.ts.map +1 -0
- package/dist/types/io/text/str.d.ts +88 -0
- package/dist/types/io/text/str.d.ts.map +1 -0
- package/dist/types/io/text/unicode.d.ts +70 -0
- package/dist/types/io/text/unicode.d.ts.map +1 -0
- package/dist/types/io/time/date.d.ts +73 -0
- package/dist/types/io/time/date.d.ts.map +1 -0
- package/dist/types/io/timing/clock.d.ts +39 -0
- package/dist/types/io/timing/clock.d.ts.map +1 -0
- package/dist/types/io/timing/rateLimit.d.ts +40 -0
- package/dist/types/io/timing/rateLimit.d.ts.map +1 -0
- package/dist/types/io/timing/scheduler.d.ts +122 -0
- package/dist/types/io/timing/scheduler.d.ts.map +1 -0
- package/dist/types/io/utils/bitmap.d.ts +34 -0
- package/dist/types/io/utils/bitmap.d.ts.map +1 -0
- package/dist/types/io/utils/errors.d.ts +94 -0
- package/dist/types/io/utils/errors.d.ts.map +1 -0
- package/dist/types/io/utils/eventBus.d.ts +68 -0
- package/dist/types/io/utils/eventBus.d.ts.map +1 -0
- package/dist/types/io/utils/queue.d.ts +69 -0
- package/dist/types/io/utils/queue.d.ts.map +1 -0
- package/dist/types/io/utils/signal.d.ts +362 -0
- package/dist/types/io/utils/signal.d.ts.map +1 -0
- package/dist/types/io/utils/ui8.d.ts +34 -0
- package/dist/types/io/utils/ui8.d.ts.map +1 -0
- package/dist/types/io/utils/valid.d.ts +130 -0
- package/dist/types/io/utils/valid.d.ts.map +1 -0
- package/dist/types/main.d.ts +25 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/process/message.d.ts +64 -0
- package/dist/types/process/message.d.ts.map +1 -0
- package/dist/types/process/rpc.d.ts +35 -0
- package/dist/types/process/rpc.d.ts.map +1 -0
- package/dist/types/process/workerPool.d.ts +62 -0
- package/dist/types/process/workerPool.d.ts.map +1 -0
- package/dist/types/sanity/base.d.ts +28 -0
- package/dist/types/sanity/base.d.ts.map +1 -0
- package/dist/types/sanity/community.d.ts +20 -0
- package/dist/types/sanity/community.d.ts.map +1 -0
- package/dist/types/sanity/lockdown-apply.d.ts +7 -0
- package/dist/types/sanity/lockdown-apply.d.ts.map +1 -0
- package/dist/types/sanity/lockdown.d.ts +43 -0
- package/dist/types/sanity/lockdown.d.ts.map +1 -0
- package/dist/types/sanity/wasm-gate.d.ts +128 -0
- package/dist/types/sanity/wasm-gate.d.ts.map +1 -0
- package/docs/README.md +301 -0
- package/docs/api/README.md +33 -0
- package/docs/api/core/README.md +14 -0
- package/docs/api/core/logger.md +151 -0
- package/docs/api/core/main.md +105 -0
- package/docs/api/core/modules.md +123 -0
- package/docs/api/core/readyState.md +94 -0
- package/docs/api/core/runtime.md +499 -0
- package/docs/api/core/worker-helper.md +180 -0
- package/docs/api/crypto/README.md +39 -0
- package/docs/api/crypto/cipher/README.md +24 -0
- package/docs/api/crypto/cipher/aes.md +101 -0
- package/docs/api/crypto/cipher/chacha20.md +85 -0
- package/docs/api/crypto/hash/README.md +49 -0
- package/docs/api/crypto/hash/adf.md +61 -0
- package/docs/api/crypto/hash/argon2.md +92 -0
- package/docs/api/crypto/hash/blake2b.md +88 -0
- package/docs/api/crypto/hash/hkdf.md +82 -0
- package/docs/api/crypto/hash/hmac.md +90 -0
- package/docs/api/crypto/hash/pbkdf2.md +93 -0
- package/docs/api/crypto/hash/poly1305.md +71 -0
- package/docs/api/crypto/hash/sha224.md +61 -0
- package/docs/api/crypto/hash/sha256.md +84 -0
- package/docs/api/crypto/hash/sha3.md +89 -0
- package/docs/api/crypto/hash/sha384.md +58 -0
- package/docs/api/crypto/hash/sha512.md +73 -0
- package/docs/api/crypto/hash/sha512_224.md +59 -0
- package/docs/api/crypto/hash/sha512_256.md +58 -0
- package/docs/api/crypto/mode/README.md +33 -0
- package/docs/api/crypto/mode/cbc.md +69 -0
- package/docs/api/crypto/mode/chacha20poly1305.md +77 -0
- package/docs/api/crypto/mode/cmac.md +79 -0
- package/docs/api/crypto/mode/ctr.md +66 -0
- package/docs/api/crypto/mode/gcm.md +93 -0
- package/docs/api/crypto/mode/kw.md +84 -0
- package/docs/api/crypto/pkc/README.md +48 -0
- package/docs/api/crypto/pkc/ecc.md +91 -0
- package/docs/api/crypto/pkc/ed25519.md +99 -0
- package/docs/api/crypto/pkc/hybridKem.md +178 -0
- package/docs/api/crypto/pkc/hybridSign.md +192 -0
- package/docs/api/crypto/pkc/ml_dsa.md +99 -0
- package/docs/api/crypto/pkc/ml_kem.md +90 -0
- package/docs/api/crypto/pkc/rsa.md +87 -0
- package/docs/api/crypto/pkc/slh_dsa.md +86 -0
- package/docs/api/crypto/pkc/x25519.md +84 -0
- package/docs/api/crypto/utils/README.md +39 -0
- package/docs/api/crypto/utils/aes_ctr.md +71 -0
- package/docs/api/crypto/utils/aes_modes.md +81 -0
- package/docs/api/crypto/utils/asn1-oid.md +130 -0
- package/docs/api/crypto/utils/asn1.md +69 -0
- package/docs/api/crypto/utils/bitArray.md +77 -0
- package/docs/api/crypto/utils/bn.md +67 -0
- package/docs/api/crypto/utils/jws.md +94 -0
- package/docs/api/crypto/utils/keyformat.md +78 -0
- package/docs/api/crypto/utils/pad.md +66 -0
- package/docs/api/crypto/utils/pem.md +63 -0
- package/docs/api/crypto/utils/random.md +103 -0
- package/docs/api/crypto/utils/rsaKeygen.md +118 -0
- package/docs/api/crypto/utils/totp.md +159 -0
- package/docs/api/crypto/utils/uuid.md +98 -0
- package/docs/api/crypto/wasm/README.md +76 -0
- package/docs/api/crypto/wasm/aes.md +128 -0
- package/docs/api/crypto/wasm/argon2.md +110 -0
- package/docs/api/crypto/wasm/blake2b.md +103 -0
- package/docs/api/crypto/wasm/chacha20poly1305.md +120 -0
- package/docs/api/crypto/wasm/cmac.md +119 -0
- package/docs/api/crypto/wasm/ecc.md +114 -0
- package/docs/api/crypto/wasm/ed25519.md +117 -0
- package/docs/api/crypto/wasm/hkdf.md +163 -0
- package/docs/api/crypto/wasm/hmac.md +129 -0
- package/docs/api/crypto/wasm/ml_dsa.md +99 -0
- package/docs/api/crypto/wasm/ml_kem.md +91 -0
- package/docs/api/crypto/wasm/pbkdf2.md +111 -0
- package/docs/api/crypto/wasm/rsa.md +113 -0
- package/docs/api/crypto/wasm/runtime.md +172 -0
- package/docs/api/crypto/wasm/sha2.md +95 -0
- package/docs/api/crypto/wasm/sha3.md +127 -0
- package/docs/api/crypto/wasm/slh_dsa.md +89 -0
- package/docs/api/crypto/wasm/x25519.md +116 -0
- package/docs/api/crypto/webcrypto/README.md +56 -0
- package/docs/api/crypto/webcrypto/aes.md +140 -0
- package/docs/api/crypto/webcrypto/aeskw.md +120 -0
- package/docs/api/crypto/webcrypto/digest.md +103 -0
- package/docs/api/crypto/webcrypto/ecc.md +122 -0
- package/docs/api/crypto/webcrypto/ed25519.md +121 -0
- package/docs/api/crypto/webcrypto/hkdf.md +141 -0
- package/docs/api/crypto/webcrypto/hmac.md +112 -0
- package/docs/api/crypto/webcrypto/pbkdf2.md +140 -0
- package/docs/api/crypto/webcrypto/rsa.md +149 -0
- package/docs/api/crypto/webcrypto/x25519.md +96 -0
- package/docs/api/dom/README.md +117 -0
- package/docs/api/dom/display/README.md +27 -0
- package/docs/api/dom/display/animate.md +113 -0
- package/docs/api/dom/display/fullscreen.md +121 -0
- package/docs/api/dom/fs/README.md +36 -0
- package/docs/api/dom/fs/download.md +108 -0
- package/docs/api/dom/fs/fsAccess.md +200 -0
- package/docs/api/dom/fs/indexedDB.md +219 -0
- package/docs/api/dom/fs/remoteStore.md +158 -0
- package/docs/api/dom/fs/storage.md +197 -0
- package/docs/api/dom/lifecycle/README.md +11 -0
- package/docs/api/dom/lifecycle/idle.md +89 -0
- package/docs/api/dom/lifecycle/visibility.md +73 -0
- package/docs/api/dom/lifecycle/wakeLock.md +94 -0
- package/docs/api/dom/net/README.md +31 -0
- package/docs/api/dom/net/ajax.md +176 -0
- package/docs/api/dom/net/broadcastChannel.md +110 -0
- package/docs/api/dom/net/network.md +137 -0
- package/docs/api/dom/net/sse.md +141 -0
- package/docs/api/dom/net/webrtc.md +158 -0
- package/docs/api/dom/net/ws.md +168 -0
- package/docs/api/dom/query/README.md +30 -0
- package/docs/api/dom/query/dnd.md +137 -0
- package/docs/api/dom/query/dom.md +275 -0
- package/docs/api/dom/query/events.md +211 -0
- package/docs/api/dom/query/gesture.md +137 -0
- package/docs/api/dom/query/media.md +188 -0
- package/docs/api/dom/rendering/README.md +41 -0
- package/docs/api/dom/rendering/chart.md +149 -0
- package/docs/api/dom/rendering/component.md +287 -0
- package/docs/api/dom/rendering/devtools-ui.md +129 -0
- package/docs/api/dom/rendering/devtools.md +157 -0
- package/docs/api/dom/rendering/parser.md +200 -0
- package/docs/api/dom/rendering/reactiveBind.md +234 -0
- package/docs/api/dom/rendering/render.md +219 -0
- package/docs/api/dom/rendering/sanitize.md +97 -0
- package/docs/api/dom/rendering/secPolicy.md +155 -0
- package/docs/api/dom/rendering/template.md +301 -0
- package/docs/api/dom/rendering/themeTokens.md +175 -0
- package/docs/api/dom/rendering/uiSession.md +546 -0
- package/docs/api/dom/rendering/virtualScroll.md +126 -0
- package/docs/api/dom/sensors/README.md +12 -0
- package/docs/api/dom/sensors/battery.md +70 -0
- package/docs/api/dom/sensors/geolocation.md +115 -0
- package/docs/api/dom/sensors/networkInfo.md +73 -0
- package/docs/api/dom/sensors/sensors.md +123 -0
- package/docs/api/dom/sw/README.md +31 -0
- package/docs/api/dom/sw/backgroundSync.md +145 -0
- package/docs/api/dom/sw/cache.md +116 -0
- package/docs/api/dom/sw/push.md +114 -0
- package/docs/api/dom/sw/serviceWorker.md +90 -0
- package/docs/api/dom/sw/sharedWorker.md +131 -0
- package/docs/api/dom/utils/README.md +25 -0
- package/docs/api/dom/utils/a11y.md +143 -0
- package/docs/api/dom/utils/clipboard.md +146 -0
- package/docs/api/dom/utils/entropyCollector.md +175 -0
- package/docs/api/dom/utils/focus.md +140 -0
- package/docs/api/dom/utils/form.md +196 -0
- package/docs/api/dom/utils/formKit.md +181 -0
- package/docs/api/dom/utils/keybindings.md +138 -0
- package/docs/api/dom/utils/leaderElection.md +130 -0
- package/docs/api/dom/utils/notifications.md +106 -0
- package/docs/api/dom/utils/permissions.md +82 -0
- package/docs/api/dom/utils/route.md +112 -0
- package/docs/api/dom/utils/ua.md +119 -0
- package/docs/api/dom/utils/webauthn.md +190 -0
- package/docs/api/io/README.md +20 -0
- package/docs/api/io/binary/README.md +29 -0
- package/docs/api/io/binary/reader.md +126 -0
- package/docs/api/io/binary/writer.md +127 -0
- package/docs/api/io/calc/README.md +22 -0
- package/docs/api/io/calc/adler32.md +75 -0
- package/docs/api/io/calc/bigint.md +105 -0
- package/docs/api/io/calc/crc32.md +74 -0
- package/docs/api/io/calc/easing.md +118 -0
- package/docs/api/io/codec/README.md +35 -0
- package/docs/api/io/codec/b64.md +92 -0
- package/docs/api/io/codec/base32.md +98 -0
- package/docs/api/io/codec/base58.md +104 -0
- package/docs/api/io/codec/buffer.md +144 -0
- package/docs/api/io/codec/cbor.md +179 -0
- package/docs/api/io/codec/csv.md +178 -0
- package/docs/api/io/codec/hex.md +75 -0
- package/docs/api/io/codec/mime.md +156 -0
- package/docs/api/io/codec/msgpack.md +142 -0
- package/docs/api/io/codec/url.md +265 -0
- package/docs/api/io/codec/utf8.md +84 -0
- package/docs/api/io/codec/xml.md +87 -0
- package/docs/api/io/compress/README.md +62 -0
- package/docs/api/io/compress/bitstream.md +131 -0
- package/docs/api/io/compress/brotli.md +232 -0
- package/docs/api/io/compress/brotli_dict.md +119 -0
- package/docs/api/io/compress/brotli_dict_words.md +142 -0
- package/docs/api/io/compress/brotli_frame.md +214 -0
- package/docs/api/io/compress/brotli_shared.md +144 -0
- package/docs/api/io/compress/deflate.md +474 -0
- package/docs/api/io/compress/gzip.md +130 -0
- package/docs/api/io/compress/huffman.md +210 -0
- package/docs/api/io/compress/lz4.md +278 -0
- package/docs/api/io/compress/lz77.md +180 -0
- package/docs/api/io/compress/lzw.md +121 -0
- package/docs/api/io/compress/zip.md +209 -0
- package/docs/api/io/compress/zlib.md +125 -0
- package/docs/api/io/i18n/README.md +23 -0
- package/docs/api/io/i18n/i18n.md +128 -0
- package/docs/api/io/math/README.md +24 -0
- package/docs/api/io/math/fixed-point.md +115 -0
- package/docs/api/io/math/geom.md +144 -0
- package/docs/api/io/math/interp.md +115 -0
- package/docs/api/io/math/linalg.md +138 -0
- package/docs/api/io/math/stats.md +109 -0
- package/docs/api/io/structures/README.md +31 -0
- package/docs/api/io/structures/btree.md +155 -0
- package/docs/api/io/structures/heap.md +166 -0
- package/docs/api/io/structures/lruCache.md +156 -0
- package/docs/api/io/structures/ringBuffer.md +188 -0
- package/docs/api/io/structures/tree-walker.md +132 -0
- package/docs/api/io/structures/trie.md +138 -0
- package/docs/api/io/sync/README.md +29 -0
- package/docs/api/io/sync/abort.md +129 -0
- package/docs/api/io/sync/atomics.md +159 -0
- package/docs/api/io/sync/cancellable.md +176 -0
- package/docs/api/io/sync/channel.md +125 -0
- package/docs/api/io/sync/mutex.md +93 -0
- package/docs/api/io/sync/semaphore.md +106 -0
- package/docs/api/io/sync/tokenBucket.md +139 -0
- package/docs/api/io/text/README.md +23 -0
- package/docs/api/io/text/ansi.md +182 -0
- package/docs/api/io/text/html-entities.md +79 -0
- package/docs/api/io/text/semver.md +158 -0
- package/docs/api/io/text/str.md +129 -0
- package/docs/api/io/text/unicode.md +89 -0
- package/docs/api/io/time/README.md +22 -0
- package/docs/api/io/time/date.md +128 -0
- package/docs/api/io/timing/README.md +32 -0
- package/docs/api/io/timing/clock.md +102 -0
- package/docs/api/io/timing/rateLimit.md +137 -0
- package/docs/api/io/timing/scheduler.md +163 -0
- package/docs/api/io/utils/README.md +30 -0
- package/docs/api/io/utils/bitmap.md +96 -0
- package/docs/api/io/utils/errors.md +165 -0
- package/docs/api/io/utils/eventBus.md +162 -0
- package/docs/api/io/utils/queue.md +141 -0
- package/docs/api/io/utils/signal.md +388 -0
- package/docs/api/io/utils/ui8.md +111 -0
- package/docs/api/io/utils/valid.md +272 -0
- package/docs/api/process/README.md +18 -0
- package/docs/api/process/message.md +166 -0
- package/docs/api/process/rpc.md +161 -0
- package/docs/api/process/workerPool.md +130 -0
- package/docs/api/sanity/base.md +132 -0
- package/docs/api/sanity/community.md +96 -0
- package/docs/api/sanity/lockdown.md +128 -0
- package/docs/api/typed.md +85 -0
- package/docs/dev/README.md +25 -0
- package/docs/dev/provenance.md +80 -0
- package/docs/dev/publishing.md +31 -0
- package/docs/dev/runtime.md +64 -0
- package/docs/dev/testing.md +61 -0
- package/docs/dev/types.md +35 -0
- package/docs/evidence/pqc-hybrid-evidence.md +438 -0
- package/docs/guide/README.md +38 -0
- package/docs/guide/_QUICK_REF.md +341 -0
- package/docs/guide/by-use-case.md +160 -0
- package/docs/guide/doc-format.md +306 -0
- package/docs/guide/gesture-dnd-side-channel.md +119 -0
- package/docs/guide/getting-started.md +134 -0
- package/docs/guide/hmr.md +187 -0
- package/docs/guide/integration-bundlers.md +193 -0
- package/docs/guide/integrations-hmr.md +103 -0
- package/docs/guide/module-creation-workflow.md +342 -0
- package/docs/guide/module-pattern.md +244 -0
- package/docs/guide/rendering-pipeline.md +422 -0
- package/docs/guide/security.md +346 -0
- package/docs/guide/test-format.md +190 -0
- package/docs/guide/tutorial-todo.md +298 -0
- package/docs/guide/typescript.md +215 -0
- package/docs/guide/worker-confinement.md +301 -0
- package/docs/guide/workers.md +168 -0
- package/docs/notes/lz77-deflate-factorization.md +96 -0
- package/docs/notes/worker-confinement-spike.md +302 -0
- package/docs/tools/README.md +56 -0
- package/docs/tools/aot.md +108 -0
- package/docs/tools/audit.md +61 -0
- package/docs/tools/bundler.md +215 -0
- package/docs/tools/codegen.md +64 -0
- package/docs/tools/jsx.md +236 -0
- package/docs/tools/precompilation.md +88 -0
- package/docs/tools/standalone.md +107 -0
- package/fw.config.json +129 -0
- package/integrations/README.md +52 -0
- package/integrations/_shared/catalog.generated.json +207 -0
- package/integrations/_shared/config-resolve.js +201 -0
- package/integrations/_shared/core.js +362 -0
- package/integrations/astro/README.md +96 -0
- package/integrations/astro/index.d.ts +42 -0
- package/integrations/astro/index.js +94 -0
- package/integrations/bun/README.md +62 -0
- package/integrations/bun/index.d.ts +30 -0
- package/integrations/bun/index.js +134 -0
- package/integrations/deno/README.md +55 -0
- package/integrations/deno/deno.json +10 -0
- package/integrations/esbuild/README.md +75 -0
- package/integrations/esbuild/backend.js +147 -0
- package/integrations/esbuild/index.d.ts +32 -0
- package/integrations/esbuild/index.js +147 -0
- package/integrations/eslint/README.md +27 -0
- package/integrations/eslint/no-factory-capture.js +99 -0
- package/integrations/jest/README.md +45 -0
- package/integrations/jest/bun-test-shim.js +43 -0
- package/integrations/nestjs/README.md +68 -0
- package/integrations/nestjs/index.d.ts +38 -0
- package/integrations/nestjs/index.js +99 -0
- package/integrations/nextjs/README.md +149 -0
- package/integrations/nextjs/index.d.ts +30 -0
- package/integrations/nextjs/index.js +98 -0
- package/integrations/nodejs/README.md +46 -0
- package/integrations/nodejs/package.node.example.json +31 -0
- package/integrations/rollup/README.md +65 -0
- package/integrations/rollup/backend.js +132 -0
- package/integrations/rollup/index.d.ts +32 -0
- package/integrations/rollup/index.js +84 -0
- package/integrations/turbopack/README.md +56 -0
- package/integrations/turbopack/index.d.ts +47 -0
- package/integrations/turbopack/index.js +164 -0
- package/integrations/typedoc/README.md +57 -0
- package/integrations/typedoc/categorize.js +121 -0
- package/integrations/typedoc/tsconfig.typedoc.json +14 -0
- package/integrations/typedoc/typedoc.json +19 -0
- package/integrations/vite/README.md +115 -0
- package/integrations/vite/index.d.ts +29 -0
- package/integrations/vite/index.js +182 -0
- package/integrations/vite/package.json +8 -0
- package/integrations/vite/vite-env.d.ts +36 -0
- package/integrations/vitest/README.md +77 -0
- package/integrations/vitest/bun-test-shim.js +92 -0
- package/integrations/vitest/vitest.config.js +41 -0
- package/integrations/webpack/README.md +53 -0
- package/integrations/webpack/index.d.ts +29 -0
- package/integrations/webpack/index.js +182 -0
- package/package.json +303 -0
- package/src/core/logger.js +373 -0
- package/src/core/modules.js +289 -0
- package/src/core/readyState.js +119 -0
- package/src/core/runtime.js +929 -0
- package/src/core/worker-helper.js +261 -0
- package/src/crypto/NIST_CONFORMANCE.md +249 -0
- package/src/crypto/cipher/aes.acvp.md +74 -0
- package/src/crypto/cipher/aes.js +512 -0
- package/src/crypto/cipher/chacha20.acvp.md +117 -0
- package/src/crypto/cipher/chacha20.js +147 -0
- package/src/crypto/hash/adf.acvp.md +144 -0
- package/src/crypto/hash/adf.js +127 -0
- package/src/crypto/hash/argon2.acvp.md +144 -0
- package/src/crypto/hash/argon2.js +517 -0
- package/src/crypto/hash/blake2b.acvp.md +122 -0
- package/src/crypto/hash/blake2b.js +367 -0
- package/src/crypto/hash/hkdf.acvp.md +128 -0
- package/src/crypto/hash/hkdf.js +145 -0
- package/src/crypto/hash/hmac.acvp.md +110 -0
- package/src/crypto/hash/hmac.js +177 -0
- package/src/crypto/hash/pbkdf2.acvp.md +122 -0
- package/src/crypto/hash/pbkdf2.js +120 -0
- package/src/crypto/hash/poly1305.acvp.md +111 -0
- package/src/crypto/hash/poly1305.js +126 -0
- package/src/crypto/hash/sha224.acvp.md +81 -0
- package/src/crypto/hash/sha224.js +60 -0
- package/src/crypto/hash/sha256.acvp.md +75 -0
- package/src/crypto/hash/sha256.js +217 -0
- package/src/crypto/hash/sha3.acvp.md +133 -0
- package/src/crypto/hash/sha3.js +391 -0
- package/src/crypto/hash/sha384.acvp.md +82 -0
- package/src/crypto/hash/sha384.js +61 -0
- package/src/crypto/hash/sha512.acvp.md +84 -0
- package/src/crypto/hash/sha512.js +314 -0
- package/src/crypto/hash/sha512_224.acvp.md +90 -0
- package/src/crypto/hash/sha512_224.js +66 -0
- package/src/crypto/hash/sha512_256.acvp.md +96 -0
- package/src/crypto/hash/sha512_256.js +75 -0
- package/src/crypto/mode/cbc.acvp.md +105 -0
- package/src/crypto/mode/cbc.js +136 -0
- package/src/crypto/mode/chacha20poly1305.acvp.md +116 -0
- package/src/crypto/mode/chacha20poly1305.js +190 -0
- package/src/crypto/mode/cmac.acvp.md +106 -0
- package/src/crypto/mode/cmac.js +172 -0
- package/src/crypto/mode/ctr.acvp.md +110 -0
- package/src/crypto/mode/ctr.js +174 -0
- package/src/crypto/mode/gcm.acvp.md +129 -0
- package/src/crypto/mode/gcm.js +333 -0
- package/src/crypto/mode/kw.acvp.md +145 -0
- package/src/crypto/mode/kw.js +323 -0
- package/src/crypto/pkc/ecc.acvp.md +181 -0
- package/src/crypto/pkc/ecc.js +941 -0
- package/src/crypto/pkc/ed25519.acvp.md +172 -0
- package/src/crypto/pkc/ed25519.js +582 -0
- package/src/crypto/pkc/hybrid-kat.provenance.md +89 -0
- package/src/crypto/pkc/hybridKem.js +255 -0
- package/src/crypto/pkc/hybridSign.js +437 -0
- package/src/crypto/pkc/ml_dsa.acvp.md +146 -0
- package/src/crypto/pkc/ml_dsa.js +984 -0
- package/src/crypto/pkc/ml_kem.acvp.md +117 -0
- package/src/crypto/pkc/ml_kem.js +596 -0
- package/src/crypto/pkc/rsa.acvp.md +187 -0
- package/src/crypto/pkc/rsa.js +470 -0
- package/src/crypto/pkc/slh_dsa.acvp.md +155 -0
- package/src/crypto/pkc/slh_dsa.js +820 -0
- package/src/crypto/pkc/x25519.acvp.md +113 -0
- package/src/crypto/pkc/x25519.js +290 -0
- package/src/crypto/utils/aes_ctr.acvp.md +67 -0
- package/src/crypto/utils/aes_ctr.js +134 -0
- package/src/crypto/utils/aes_modes.acvp.md +66 -0
- package/src/crypto/utils/aes_modes.js +241 -0
- package/src/crypto/utils/asn1-oid.js +369 -0
- package/src/crypto/utils/asn1.js +343 -0
- package/src/crypto/utils/bitArray.js +312 -0
- package/src/crypto/utils/bn.js +825 -0
- package/src/crypto/utils/jws.js +222 -0
- package/src/crypto/utils/keyformat.js +303 -0
- package/src/crypto/utils/pad.js +198 -0
- package/src/crypto/utils/pem.js +90 -0
- package/src/crypto/utils/random.acvp.md +167 -0
- package/src/crypto/utils/random.js +846 -0
- package/src/crypto/utils/rsaKeygen.acvp.md +158 -0
- package/src/crypto/utils/rsaKeygen.js +448 -0
- package/src/crypto/utils/totp.js +409 -0
- package/src/crypto/utils/uuid.acvp.md +137 -0
- package/src/crypto/utils/uuid.js +176 -0
- package/src/crypto/wasm/aes.js +494 -0
- package/src/crypto/wasm/argon2.js +236 -0
- package/src/crypto/wasm/blake2b.js +213 -0
- package/src/crypto/wasm/chacha20poly1305.js +238 -0
- package/src/crypto/wasm/cmac.js +207 -0
- package/src/crypto/wasm/ecc.js +437 -0
- package/src/crypto/wasm/ed25519.js +307 -0
- package/src/crypto/wasm/hkdf.js +183 -0
- package/src/crypto/wasm/hmac.js +215 -0
- package/src/crypto/wasm/ml_dsa.js +375 -0
- package/src/crypto/wasm/ml_kem.js +313 -0
- package/src/crypto/wasm/pbkdf2.js +205 -0
- package/src/crypto/wasm/rsa.js +674 -0
- package/src/crypto/wasm/runtime.js +400 -0
- package/src/crypto/wasm/sha2.js +183 -0
- package/src/crypto/wasm/sha3.js +221 -0
- package/src/crypto/wasm/slh_dsa.js +397 -0
- package/src/crypto/wasm/x25519.js +241 -0
- package/src/crypto/webcrypto/aes.js +370 -0
- package/src/crypto/webcrypto/aeskw.js +185 -0
- package/src/crypto/webcrypto/digest.js +136 -0
- package/src/crypto/webcrypto/ecc.js +371 -0
- package/src/crypto/webcrypto/ed25519.js +248 -0
- package/src/crypto/webcrypto/hkdf.js +132 -0
- package/src/crypto/webcrypto/hmac.js +213 -0
- package/src/crypto/webcrypto/pbkdf2.js +146 -0
- package/src/crypto/webcrypto/rsa.js +415 -0
- package/src/crypto/webcrypto/x25519.js +250 -0
- package/src/dom/display/animate.js +154 -0
- package/src/dom/display/fullscreen.js +305 -0
- package/src/dom/fs/download.js +118 -0
- package/src/dom/fs/fsAccess.js +307 -0
- package/src/dom/fs/indexedDB.js +465 -0
- package/src/dom/fs/remoteStore.js +484 -0
- package/src/dom/fs/storage.js +440 -0
- package/src/dom/lifecycle/idle.js +133 -0
- package/src/dom/lifecycle/visibility.js +140 -0
- package/src/dom/lifecycle/wakeLock.js +187 -0
- package/src/dom/net/ajax.js +303 -0
- package/src/dom/net/broadcastChannel.js +89 -0
- package/src/dom/net/network.js +260 -0
- package/src/dom/net/sse.js +295 -0
- package/src/dom/net/webrtc.js +381 -0
- package/src/dom/net/ws.js +290 -0
- package/src/dom/query/dnd.js +409 -0
- package/src/dom/query/dom.js +831 -0
- package/src/dom/query/events.js +425 -0
- package/src/dom/query/gesture.js +396 -0
- package/src/dom/query/media.js +616 -0
- package/src/dom/rendering/chart.js +663 -0
- package/src/dom/rendering/component.js +469 -0
- package/src/dom/rendering/devtools-ui.js +399 -0
- package/src/dom/rendering/devtools.js +352 -0
- package/src/dom/rendering/parser.js +1055 -0
- package/src/dom/rendering/reactiveBind.js +341 -0
- package/src/dom/rendering/render.js +601 -0
- package/src/dom/rendering/sanitize.js +364 -0
- package/src/dom/rendering/secPolicy.js +281 -0
- package/src/dom/rendering/template.js +1031 -0
- package/src/dom/rendering/themeTokens.js +522 -0
- package/src/dom/rendering/uiSession-core.js +597 -0
- package/src/dom/rendering/uiSession-direct.js +251 -0
- package/src/dom/rendering/uiSession-list.js +751 -0
- package/src/dom/rendering/uiSession.js +145 -0
- package/src/dom/rendering/virtualScroll.js +341 -0
- package/src/dom/sensors/battery.js +153 -0
- package/src/dom/sensors/geolocation.js +156 -0
- package/src/dom/sensors/networkInfo.js +136 -0
- package/src/dom/sensors/sensors.js +340 -0
- package/src/dom/sw/backgroundSync.js +113 -0
- package/src/dom/sw/cache.js +139 -0
- package/src/dom/sw/push.js +181 -0
- package/src/dom/sw/serviceWorker.js +193 -0
- package/src/dom/sw/sharedWorker.js +192 -0
- package/src/dom/utils/a11y.js +244 -0
- package/src/dom/utils/clipboard.js +113 -0
- package/src/dom/utils/entropyCollector.js +344 -0
- package/src/dom/utils/focus.js +421 -0
- package/src/dom/utils/form.js +535 -0
- package/src/dom/utils/formKit.js +427 -0
- package/src/dom/utils/keybindings.js +574 -0
- package/src/dom/utils/leaderElection.js +280 -0
- package/src/dom/utils/notifications.js +218 -0
- package/src/dom/utils/permissions.js +107 -0
- package/src/dom/utils/route.js +482 -0
- package/src/dom/utils/ua.js +109 -0
- package/src/dom/utils/webauthn.js +369 -0
- package/src/external/README.md +15 -0
- package/src/io/binary/reader.js +374 -0
- package/src/io/binary/writer.js +351 -0
- package/src/io/calc/adler32.js +94 -0
- package/src/io/calc/bigint.js +276 -0
- package/src/io/calc/crc32.js +111 -0
- package/src/io/calc/easing.js +514 -0
- package/src/io/codec/b64.js +235 -0
- package/src/io/codec/base32.js +147 -0
- package/src/io/codec/base58.js +167 -0
- package/src/io/codec/buffer.js +630 -0
- package/src/io/codec/cbor.js +550 -0
- package/src/io/codec/csv.js +299 -0
- package/src/io/codec/hex.js +129 -0
- package/src/io/codec/mime.js +398 -0
- package/src/io/codec/msgpack.js +491 -0
- package/src/io/codec/url.js +530 -0
- package/src/io/codec/utf8.js +181 -0
- package/src/io/codec/xml.js +428 -0
- package/src/io/compress/bitstream.js +199 -0
- package/src/io/compress/brotli.js +3073 -0
- package/src/io/compress/brotli_dict.bin +432 -0
- package/src/io/compress/brotli_dict.js +356 -0
- package/src/io/compress/brotli_dict_words.js +157 -0
- package/src/io/compress/brotli_frame.js +420 -0
- package/src/io/compress/brotli_shared.js +715 -0
- package/src/io/compress/deflate.js +1432 -0
- package/src/io/compress/gzip.js +406 -0
- package/src/io/compress/huffman.js +322 -0
- package/src/io/compress/lz4.js +451 -0
- package/src/io/compress/lz77.js +408 -0
- package/src/io/compress/lzw.js +332 -0
- package/src/io/compress/zip.js +815 -0
- package/src/io/compress/zlib.js +340 -0
- package/src/io/i18n/i18n.js +236 -0
- package/src/io/math/fixed-point.js +269 -0
- package/src/io/math/geom.js +350 -0
- package/src/io/math/interp.js +263 -0
- package/src/io/math/linalg.js +472 -0
- package/src/io/math/stats.js +339 -0
- package/src/io/structures/btree.js +357 -0
- package/src/io/structures/heap.js +249 -0
- package/src/io/structures/lruCache.js +219 -0
- package/src/io/structures/ringBuffer.js +208 -0
- package/src/io/structures/tree-walker.js +413 -0
- package/src/io/structures/trie.js +219 -0
- package/src/io/sync/abort.js +196 -0
- package/src/io/sync/atomics.js +342 -0
- package/src/io/sync/cancellable.js +279 -0
- package/src/io/sync/channel.js +301 -0
- package/src/io/sync/mutex.js +148 -0
- package/src/io/sync/semaphore.js +156 -0
- package/src/io/sync/tokenBucket.js +208 -0
- package/src/io/text/ansi.js +536 -0
- package/src/io/text/html-entities.js +143 -0
- package/src/io/text/semver.js +375 -0
- package/src/io/text/str.js +243 -0
- package/src/io/text/unicode.js +188 -0
- package/src/io/time/date.js +355 -0
- package/src/io/timing/clock.js +79 -0
- package/src/io/timing/rateLimit.js +264 -0
- package/src/io/timing/scheduler.js +351 -0
- package/src/io/utils/bitmap.js +94 -0
- package/src/io/utils/errors.js +269 -0
- package/src/io/utils/eventBus.js +315 -0
- package/src/io/utils/queue.js +223 -0
- package/src/io/utils/signal.js +858 -0
- package/src/io/utils/ui8.js +99 -0
- package/src/io/utils/valid.js +556 -0
- package/src/main.js +41 -0
- package/src/polyfill/README.md +9 -0
- package/src/process/message.js +257 -0
- package/src/process/rpc.js +286 -0
- package/src/process/workerPool.js +392 -0
- package/src/sanity/base.js +374 -0
- package/src/sanity/community.js +254 -0
- package/src/sanity/lockdown-apply.js +58 -0
- package/src/sanity/lockdown.js +408 -0
- package/src/sanity/wasm-gate.js +316 -0
- package/src/typed.js +53 -0
- package/third-party/NOTICE-penner-easing +88 -0
- package/third-party/NOTICE-sjcl +50 -0
- package/tools/_lib/cli-help.js +55 -0
- package/tools/rendering/aot/index.js +148 -0
- package/tools/rendering/aot/lib/dom-codegen.js +295 -0
- package/tools/rendering/jsx/index.js +654 -0
- package/tools/rendering/precompilation/index.js +368 -0
- package/types/registry.generated.d.ts +217 -0
- package/types/typed.d.ts +106 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# `sha512.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **FIPS 180-4** — *Secure Hash Standard (SHS)*, §6.4 (SHA-512).
|
|
6
|
+
- **Secondary**: ACVP — draft-celi-acvp-sha.
|
|
7
|
+
- **ACVP draft**: `references/NIST/ACVP/src/draft-celi-acvp-sha.adoc`
|
|
8
|
+
- **Vectors**: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/SHA2-512-1.0/`
|
|
9
|
+
|
|
10
|
+
## Implemented algorithm
|
|
11
|
+
|
|
12
|
+
SHA-512 hash (FIPS 180-4 §6.4). 1024-bit block, 80 rounds, 64-bit
|
|
13
|
+
operations emulated as 32-bit (high/low) word pairs. Streaming API:
|
|
14
|
+
`factory(bitArray, utf8)` → `{ fn, hash }`. Output `bitArray` 16 × 32-bit
|
|
15
|
+
words (512 bits). IV (8 × 64-bit) and K (80 × 64-bit) constants frozen at
|
|
16
|
+
factory time; `factory().toString()` remains Worker-serializable.
|
|
17
|
+
|
|
18
|
+
**Iteration A2 (FIPS 140-3 upgrade)**: extraction of a builder
|
|
19
|
+
`_makeSha(init, outWords)` exposed via `_internal.makeSha`. Allows
|
|
20
|
+
`sha512_224.js` and `sha512_256.js` (FIPS 180-4 §5.3.6, upcoming in
|
|
21
|
+
iteration A3) to share the SHA-512 compression function with a distinct
|
|
22
|
+
IV and a digest truncated to 7 or 8 words. **No public API change** —
|
|
23
|
+
`fn` and `hash` exposed identically.
|
|
24
|
+
|
|
25
|
+
## Test coverage
|
|
26
|
+
|
|
27
|
+
### Built-in official vectors
|
|
28
|
+
|
|
29
|
+
| Source | Reference | Test (`describe` / `test`) | Property verified |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| FIPS 180-4 | digest empty | `FIPS-180 vectors` / `empty string` | byte-exact KAT |
|
|
32
|
+
| FIPS 180-4 App. C | "abc" | `FIPS-180 vectors` / `"abc"` | byte-exact KAT |
|
|
33
|
+
| FIPS 180-4 App. C | 896-bit message (multi-block) | `FIPS-180 vectors` / `896-bit message` | byte-exact KAT + multi-block padding |
|
|
34
|
+
| ACVP-SHA2-512-1.0 | `expectedResults.json` tcId 1-1024 (sub-sample 67) | `ACVP SHA2-512-1.0 / AFT vectors` | byte-exact KAT (lengths 1720..12144 bits, byte-aligned) |
|
|
35
|
+
| ACVP-SHA2-512-1.0 | `expectedResults.json` tcId 1025 (alternate MCT) | `ACVP SHA2-512-1.0 / MCT (alternate)` | 100 outer × 1000 inner — 100 byte-exact `resultsArray` results |
|
|
36
|
+
|
|
37
|
+
#### AFT sub-sampling strategy
|
|
38
|
+
|
|
39
|
+
The SHA2-512 AFT enumerates 1024 messages at lengths `[1720..12144]` bits (all byte-aligned). Strategy:
|
|
40
|
+
|
|
41
|
+
- **Regular stride**: one in 16 (tcId 1, 17, 33, …, 1009, 1024).
|
|
42
|
+
- **Anchors**: `min(len)`, `max(len)`.
|
|
43
|
+
- **Total integrated**: **67 / 1024 AFT + 1 MCT** out of 1025 tests from testGroups 1+2.
|
|
44
|
+
- **LDT (testGroup 3)**: **Iteration H1** — tcId=1027 (1 GiB of repeated `be1ae93d42721349`) integrated behind `CRYPTO_FULL=1`.
|
|
45
|
+
|
|
46
|
+
### Security properties tested
|
|
47
|
+
|
|
48
|
+
- [x] **80 rounds / 64-bit message schedule** — covered by 67 uniformly spread AFT.
|
|
49
|
+
- [x] **FIPS 180-4 §5.1.2 padding** — implicitly validated (varied lengths modulo 1024 including the `≥ 896 mod 1024` cases that force an extra block).
|
|
50
|
+
- [x] **Long-chain stability (alternate MCT)** — 100,000 consecutive hashes; `INITIAL_SEED_LENGTH = 3032 bits` (379 bytes) then chaining with byte-aligned padding/truncation.
|
|
51
|
+
- [x] **Streaming = one-shot** — `chunked update matches one-shot`.
|
|
52
|
+
- [x] **512-bit digest size** — `digest is 512 bits (16 x 32-bit words)`.
|
|
53
|
+
- [x] **2^53−1-bit limit** — `update` returns `false` + `console.warn` beyond it.
|
|
54
|
+
- [ ] **Side-channel resistance** — N/A (no secret input by default; HMAC usage handled by `hmac.js`).
|
|
55
|
+
- [x] **Parameterizable IV/outWords builder** (iteration A2) — `_internal.makeSha(init, outWords)`
|
|
56
|
+
tests: SHA-512 reproduction with standard IV; consistent `outWords=8/7`
|
|
57
|
+
truncation (prefix of the full 512-bit digest); IV binding (custom IV → digest ≠);
|
|
58
|
+
preserved HMAC contract on the constructed module; clone constructor + streaming = one-shot
|
|
59
|
+
on the truncated module. **8 dedicated tests** (sha512 suite: 74 → 82 tests).
|
|
60
|
+
|
|
61
|
+
## FIPS 140-3 conformance
|
|
62
|
+
|
|
63
|
+
| Requirement | Status | Evidence |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| Approved algorithm | ✅ | FIPS 180-4 §6.4 + ACVP-SHA2-512-1.0 |
|
|
66
|
+
| Validated parameter sizes | ✅ | single 512-bit digest; input 1720..12144 bits by AFT + 896 bits by FIPS-180 |
|
|
67
|
+
| Power-on KAT / self-test | ✅ | FIPS-180 vectors + 67 AFT executed on every `bun test` |
|
|
68
|
+
| CT comparisons (if secret) | N/A | Hash module with no secret |
|
|
69
|
+
| No `throw` / timing leak | ✅ | Review: `console.warn` + `return false` |
|
|
70
|
+
|
|
71
|
+
## Known limitations
|
|
72
|
+
|
|
73
|
+
- ~~**LDT not integrated**~~ — resolved in **H1**: tcId=1027 (1 GiB) runs under `CRYPTO_FULL=1` byte-exact.
|
|
74
|
+
- **AFT sub-sampling**: 67/1024 (≈ 6.5%). The 957 unplayed vectors share the same `_block` code path.
|
|
75
|
+
- **"standard" MCT version** not tested (ACVP provides `"alternate"`).
|
|
76
|
+
- **No non-byte-aligned case**: unlike SHA-224/SHA-384, the ACVP SHA-512 suite only provides byte-aligned messages. The bit-level code path (partial clamp) nonetheless remains indirectly exercised by the other SHA-2 modules.
|
|
77
|
+
|
|
78
|
+
## Cross references
|
|
79
|
+
|
|
80
|
+
- Module: [`hash/sha512.js`](./sha512.js) — iteration A2 refactor exposes `_internal.makeSha(init, outWords)` for the truncated variants (used by sha512_224.js / sha512_256.js, upcoming in A3)
|
|
81
|
+
- Tests: [`hash/sha512.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/hash/sha512.test.js) — **83 tests** (82 pass + 1 skip LDT — `CRYPTO_FULL=1` to enable; was 6 before the upgrade)
|
|
82
|
+
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-sha.adoc`
|
|
83
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/SHA2-512-1.0/`
|
|
84
|
+
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview SHA-512 hash function (FIPS 180-4).
|
|
7
|
+
*
|
|
8
|
+
* Origin: adapted from the Stanford JavaScript Crypto Library (SJCL),
|
|
9
|
+
* BSD-2-Clause (SJCL is dual-licensed BSD-2-Clause OR GPL-2.0-or-later; the
|
|
10
|
+
* BSD-2-Clause terms are retained, see third-party/NOTICE-sjcl); the ESM
|
|
11
|
+
* factory, JSDoc, tests and every later change are this project's own work.
|
|
12
|
+
* See docs/dev/provenance.md.
|
|
13
|
+
*
|
|
14
|
+
* SHA-512 operates on 64-bit words; in JavaScript each 64-bit word is
|
|
15
|
+
* represented as two 32-bit halves (high/low) stored in adjacent slots of
|
|
16
|
+
* the state array. The IV/key constants are split into 32-bit pieces with
|
|
17
|
+
* a 24-bit `_initr` / `_keyr` lookup providing the truncated low bits that
|
|
18
|
+
* a JS double cannot hold precisely.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { bitArray } from '../utils/bitArray.js';
|
|
23
|
+
import { utf8 } from '../../io/codec/utf8.js';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Streaming SHA-512 hasher instance (SJCL-style; bitArray = `number[]` of 32-bit words,
|
|
27
|
+
* each 64-bit lane stored as two adjacent halves).
|
|
28
|
+
* @typedef {object} Sha512Hasher
|
|
29
|
+
* @property {number} blockSize Block size in bits (1024).
|
|
30
|
+
* @property {number[]} _init IV (16 × 32-bit halves = 8 × 64-bit lanes).
|
|
31
|
+
* @property {number} _outWords Number of 32-bit words retained in the digest.
|
|
32
|
+
* @property {number[]} _key Round constants.
|
|
33
|
+
* @property {() => Sha512Hasher} reset Reset internal state; returns `this`.
|
|
34
|
+
* @property {(data: number[]|string) => (Sha512Hasher|false)} update Absorb a bitArray or UTF-8 string; returns `this`, or `false` on > 2^53-1 bit overflow.
|
|
35
|
+
* @property {() => number[]} finalize Pad and emit the digest as a bitArray (truncated to `outWords`).
|
|
36
|
+
* @property {(words: ArrayLike<number>) => void} _block Compress one 32-word (1024-bit) block.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Object returned by `sha512.factory()`.
|
|
41
|
+
* @typedef {object} Sha512API
|
|
42
|
+
* @property {new (hash?: Sha512Hasher) => Sha512Hasher} fn Streaming hasher constructor (optional arg clones an existing instance).
|
|
43
|
+
* @property {(data: number[]|string) => number[]} hash One-shot hash; returns the digest as a bitArray.
|
|
44
|
+
* @property {{ makeSha: (init: number[], outWords: number) => { fn: Function, hash: Function } }} _internal Escape hatch used by sha384/sha512_224/sha512_256 to build truncated variants.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export const sha512 = {
|
|
48
|
+
name: 'sha512',
|
|
49
|
+
version: '1.0.0',
|
|
50
|
+
type: 'fw.crypto.hash',
|
|
51
|
+
dependencies: ['bitArray', 'utf8'],
|
|
52
|
+
deps: [bitArray, utf8],
|
|
53
|
+
|
|
54
|
+
/** @returns {Sha512API} */
|
|
55
|
+
factory(bitArray, utf8) {
|
|
56
|
+
|
|
57
|
+
// SHA-512 IV (FIPS 180-4 §5.3.5).
|
|
58
|
+
const _INIT = [
|
|
59
|
+
0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,
|
|
60
|
+
0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const _KEY = [
|
|
64
|
+
0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
|
|
65
|
+
0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
|
|
66
|
+
0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
|
|
67
|
+
0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
|
|
68
|
+
0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
|
|
69
|
+
0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
|
|
70
|
+
0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
|
|
71
|
+
0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
|
|
72
|
+
0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
|
|
73
|
+
0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
|
|
74
|
+
0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
|
|
75
|
+
0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
|
|
76
|
+
0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
|
|
77
|
+
0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
|
|
78
|
+
0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
|
|
79
|
+
0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
|
|
80
|
+
0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
|
|
81
|
+
0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
|
|
82
|
+
0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
|
|
83
|
+
0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
// ── Builder for SHA-512-shaped hash modules with custom IV + truncation ──
|
|
87
|
+
//
|
|
88
|
+
// Default = SHA-512 (init = _INIT, outWords = 16 → 512-bit digest).
|
|
89
|
+
// Used by `sha512_224.js` and `sha512_256.js` (FIPS 180-4 §5.3.6.{1,2})
|
|
90
|
+
// to share the SHA-512 compression function with different IVs and a
|
|
91
|
+
// truncated final digest. FIPS 140-3 upgrade plan, iteration A2.
|
|
92
|
+
/**
|
|
93
|
+
* Parametric SHA-512 compression factory.
|
|
94
|
+
* @param {number[]} init 16 × 32-bit IV halves (representing 8 × 64-bit lanes).
|
|
95
|
+
* @param {number} outWords Number of 32-bit words in the digest
|
|
96
|
+
* (16 = SHA-512, 12 = SHA-384, 8 = SHA-512/256, 7 = SHA-512/224).
|
|
97
|
+
* @returns {{fn: Function, hash: Function}}
|
|
98
|
+
*/
|
|
99
|
+
function _makeSha(init, outWords) {
|
|
100
|
+
|
|
101
|
+
const sha = {};
|
|
102
|
+
|
|
103
|
+
sha.fn = function (hash) {
|
|
104
|
+
if (hash) {
|
|
105
|
+
this._h = hash._h.slice(0);
|
|
106
|
+
this._buffer = hash._buffer.slice(0);
|
|
107
|
+
this._length = hash._length;
|
|
108
|
+
} else {
|
|
109
|
+
this.reset();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
sha.hash = function (data) {
|
|
114
|
+
// @ts-ignore - update() returns false only on overflow; for a fresh instance it always returns this
|
|
115
|
+
return (new sha.fn()).update(data).finalize();
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
sha.fn.prototype = {
|
|
119
|
+
blockSize: 1024,
|
|
120
|
+
_init: init,
|
|
121
|
+
_outWords: outWords,
|
|
122
|
+
_key: _KEY,
|
|
123
|
+
|
|
124
|
+
reset() {
|
|
125
|
+
this._h = this._init.slice(0);
|
|
126
|
+
this._buffer = [];
|
|
127
|
+
this._length = 0;
|
|
128
|
+
return this;
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
update(data) {
|
|
132
|
+
if (typeof data === 'string') {
|
|
133
|
+
data = bitArray.ui8_to_ba(utf8.toBytes(data));
|
|
134
|
+
}
|
|
135
|
+
const b = this._buffer = bitArray.concat(this._buffer, data);
|
|
136
|
+
const ol = this._length;
|
|
137
|
+
const nl = this._length = ol + bitArray.bitLength(data);
|
|
138
|
+
if (nl > 9007199254740991) {
|
|
139
|
+
console.warn('[crypto] INVALID: sha512: cannot hash more than 2^53 - 1 bits');
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
const c = new Uint32Array(b);
|
|
143
|
+
let j = 0;
|
|
144
|
+
for (let i = 1024 + ol - ((1024 + ol) & 1023); i <= nl; i += 1024) {
|
|
145
|
+
this._block(c.subarray(32 * j, 32 * (j + 1)));
|
|
146
|
+
j += 1;
|
|
147
|
+
}
|
|
148
|
+
b.splice(0, 32 * j);
|
|
149
|
+
return this;
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
finalize() {
|
|
153
|
+
let b = this._buffer;
|
|
154
|
+
const h = this._h;
|
|
155
|
+
|
|
156
|
+
b = bitArray.concat(b, [bitArray.partial(1, 1)]);
|
|
157
|
+
for (let i = b.length + 4; i & 31; i++) {
|
|
158
|
+
b.push(0);
|
|
159
|
+
}
|
|
160
|
+
b.push(0);
|
|
161
|
+
b.push(0);
|
|
162
|
+
b.push(Math.floor(this._length / 0x100000000));
|
|
163
|
+
b.push(this._length | 0);
|
|
164
|
+
|
|
165
|
+
while (b.length) {
|
|
166
|
+
this._block(b.splice(0, 32));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
this.reset();
|
|
170
|
+
// Truncate digest per `_outWords`: SHA-512 → 16, SHA-512/256 → 8,
|
|
171
|
+
// SHA-512/224 → 7 words. FIPS 180-4 §5.3.6 retains the leading bits.
|
|
172
|
+
return outWords < 16 ? h.slice(0, outWords) : h;
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
_block(words) {
|
|
176
|
+
const h = this._h;
|
|
177
|
+
const k = this._key;
|
|
178
|
+
const h0h = h[0], h0l = h[1], h1h = h[2], h1l = h[3];
|
|
179
|
+
const h2h = h[4], h2l = h[5], h3h = h[6], h3l = h[7];
|
|
180
|
+
const h4h = h[8], h4l = h[9], h5h = h[10], h5l = h[11];
|
|
181
|
+
const h6h = h[12], h6l = h[13], h7h = h[14], h7l = h[15];
|
|
182
|
+
|
|
183
|
+
const w = new Array(160);
|
|
184
|
+
for (let j = 0; j < 32; j++) {
|
|
185
|
+
w[j] = words[j];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let ah = h0h, al = h0l, bh = h1h, bl = h1l;
|
|
189
|
+
let ch = h2h, cl = h2l, dh = h3h, dl = h3l;
|
|
190
|
+
let eh = h4h, el = h4l, fh = h5h, fl = h5l;
|
|
191
|
+
let gh = h6h, gl = h6l, hh = h7h, hl = h7l;
|
|
192
|
+
|
|
193
|
+
let wrh;
|
|
194
|
+
let wrl;
|
|
195
|
+
|
|
196
|
+
for (let i = 0; i < 80; i++) {
|
|
197
|
+
if (i < 16) {
|
|
198
|
+
wrh = w[i * 2];
|
|
199
|
+
wrl = w[i * 2 + 1];
|
|
200
|
+
} else {
|
|
201
|
+
const gamma0xh = w[(i - 15) * 2];
|
|
202
|
+
const gamma0xl = w[(i - 15) * 2 + 1];
|
|
203
|
+
const gamma0h =
|
|
204
|
+
((gamma0xl << 31) | (gamma0xh >>> 1)) ^
|
|
205
|
+
((gamma0xl << 24) | (gamma0xh >>> 8)) ^
|
|
206
|
+
(gamma0xh >>> 7);
|
|
207
|
+
const gamma0l =
|
|
208
|
+
((gamma0xh << 31) | (gamma0xl >>> 1)) ^
|
|
209
|
+
((gamma0xh << 24) | (gamma0xl >>> 8)) ^
|
|
210
|
+
((gamma0xh << 25) | (gamma0xl >>> 7));
|
|
211
|
+
|
|
212
|
+
const gamma1xh = w[(i - 2) * 2];
|
|
213
|
+
const gamma1xl = w[(i - 2) * 2 + 1];
|
|
214
|
+
const gamma1h =
|
|
215
|
+
((gamma1xl << 13) | (gamma1xh >>> 19)) ^
|
|
216
|
+
((gamma1xh << 3) | (gamma1xl >>> 29)) ^
|
|
217
|
+
(gamma1xh >>> 6);
|
|
218
|
+
const gamma1l =
|
|
219
|
+
((gamma1xh << 13) | (gamma1xl >>> 19)) ^
|
|
220
|
+
((gamma1xl << 3) | (gamma1xh >>> 29)) ^
|
|
221
|
+
((gamma1xh << 26) | (gamma1xl >>> 6));
|
|
222
|
+
|
|
223
|
+
const wr7h = w[(i - 7) * 2];
|
|
224
|
+
const wr7l = w[(i - 7) * 2 + 1];
|
|
225
|
+
const wr16h = w[(i - 16) * 2];
|
|
226
|
+
const wr16l = w[(i - 16) * 2 + 1];
|
|
227
|
+
|
|
228
|
+
wrl = gamma0l + wr7l;
|
|
229
|
+
wrh = gamma0h + wr7h + ((wrl >>> 0) < (gamma0l >>> 0) ? 1 : 0);
|
|
230
|
+
wrl += gamma1l;
|
|
231
|
+
wrh += gamma1h + ((wrl >>> 0) < (gamma1l >>> 0) ? 1 : 0);
|
|
232
|
+
wrl += wr16l;
|
|
233
|
+
wrh += wr16h + ((wrl >>> 0) < (wr16l >>> 0) ? 1 : 0);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
w[i * 2] = wrh |= 0;
|
|
237
|
+
w[i * 2 + 1] = wrl |= 0;
|
|
238
|
+
|
|
239
|
+
const chh = (eh & fh) ^ (~eh & gh);
|
|
240
|
+
const chl = (el & fl) ^ (~el & gl);
|
|
241
|
+
|
|
242
|
+
const majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
|
|
243
|
+
const majl = (al & bl) ^ (al & cl) ^ (bl & cl);
|
|
244
|
+
|
|
245
|
+
const sigma0h = ((al << 4) | (ah >>> 28)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
|
|
246
|
+
const sigma0l = ((ah << 4) | (al >>> 28)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
|
|
247
|
+
|
|
248
|
+
const sigma1h = ((el << 18) | (eh >>> 14)) ^ ((el << 14) | (eh >>> 18)) ^ ((eh << 23) | (el >>> 9));
|
|
249
|
+
const sigma1l = ((eh << 18) | (el >>> 14)) ^ ((eh << 14) | (el >>> 18)) ^ ((el << 23) | (eh >>> 9));
|
|
250
|
+
|
|
251
|
+
const krh = k[i * 2];
|
|
252
|
+
const krl = k[i * 2 + 1];
|
|
253
|
+
|
|
254
|
+
let t1l = hl + sigma1l;
|
|
255
|
+
let t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
|
|
256
|
+
t1l += chl;
|
|
257
|
+
t1h += chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
|
|
258
|
+
t1l += krl;
|
|
259
|
+
t1h += krh + ((t1l >>> 0) < (krl >>> 0) ? 1 : 0);
|
|
260
|
+
t1l = t1l + wrl | 0;
|
|
261
|
+
t1h += wrh + ((t1l >>> 0) < (wrl >>> 0) ? 1 : 0);
|
|
262
|
+
|
|
263
|
+
const t2l = sigma0l + majl;
|
|
264
|
+
const t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
|
|
265
|
+
|
|
266
|
+
hh = gh; hl = gl;
|
|
267
|
+
gh = fh; gl = fl;
|
|
268
|
+
fh = eh; fl = el;
|
|
269
|
+
el = (dl + t1l) | 0;
|
|
270
|
+
eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
|
|
271
|
+
dh = ch; dl = cl;
|
|
272
|
+
ch = bh; cl = bl;
|
|
273
|
+
bh = ah; bl = al;
|
|
274
|
+
al = (t1l + t2l) | 0;
|
|
275
|
+
ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const nh0l = h[1] = (h0l + al) | 0;
|
|
279
|
+
h[0] = (h0h + ah + ((nh0l >>> 0) < (al >>> 0) ? 1 : 0)) | 0;
|
|
280
|
+
const nh1l = h[3] = (h1l + bl) | 0;
|
|
281
|
+
h[2] = (h1h + bh + ((nh1l >>> 0) < (bl >>> 0) ? 1 : 0)) | 0;
|
|
282
|
+
const nh2l = h[5] = (h2l + cl) | 0;
|
|
283
|
+
h[4] = (h2h + ch + ((nh2l >>> 0) < (cl >>> 0) ? 1 : 0)) | 0;
|
|
284
|
+
const nh3l = h[7] = (h3l + dl) | 0;
|
|
285
|
+
h[6] = (h3h + dh + ((nh3l >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
|
|
286
|
+
const nh4l = h[9] = (h4l + el) | 0;
|
|
287
|
+
h[8] = (h4h + eh + ((nh4l >>> 0) < (el >>> 0) ? 1 : 0)) | 0;
|
|
288
|
+
const nh5l = h[11] = (h5l + fl) | 0;
|
|
289
|
+
h[10] = (h5h + fh + ((nh5l >>> 0) < (fl >>> 0) ? 1 : 0)) | 0;
|
|
290
|
+
const nh6l = h[13] = (h6l + gl) | 0;
|
|
291
|
+
h[12] = (h6h + gh + ((nh6l >>> 0) < (gl >>> 0) ? 1 : 0)) | 0;
|
|
292
|
+
const nh7l = h[15] = (h7l + hl) | 0;
|
|
293
|
+
h[14] = (h7h + hh + ((nh7l >>> 0) < (hl >>> 0) ? 1 : 0)) | 0;
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
return sha;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Default = SHA-512 (FIPS 180-4 §5.3.5, full 512-bit digest = 16 words).
|
|
301
|
+
const _sha512 = _makeSha(_INIT, 16);
|
|
302
|
+
|
|
303
|
+
return /** @type {Sha512API} */ (/** @type {any} */ ({
|
|
304
|
+
// Public API (unchanged)
|
|
305
|
+
fn: _sha512.fn,
|
|
306
|
+
hash: _sha512.hash,
|
|
307
|
+
|
|
308
|
+
// Internal escape hatch - used by sha512_224.js and sha512_256.js
|
|
309
|
+
// (FIPS 180-4 §5.3.6) to share the SHA-512 compression function with
|
|
310
|
+
// a custom IV and truncated output.
|
|
311
|
+
_internal: { makeSha: _makeSha }
|
|
312
|
+
}));
|
|
313
|
+
}
|
|
314
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# `sha512_224.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **NIST FIPS 180-4** — *Secure Hash Standard*, **§5.3.6.1**
|
|
6
|
+
*Initial Hash Value for SHA-512/224*. Truncated SHA-512 variant (same
|
|
7
|
+
compression function, distinct IV, 224-bit output = 28 bytes =
|
|
8
|
+
first 7 words of the SHA-512 state).
|
|
9
|
+
- **Secondary**: **NIST SP 800-107 Rev. 1** — *Recommendation for
|
|
10
|
+
Applications Using Approved Hash Algorithms*. SHA-512/224 is approved
|
|
11
|
+
for general use.
|
|
12
|
+
- **ACVP**: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/SHA2-512-224-1.0/`
|
|
13
|
+
|
|
14
|
+
## Implemented algorithm
|
|
15
|
+
|
|
16
|
+
`sha512_224.factory(sha512)` — minimal wrapper around
|
|
17
|
+
`sha512._internal.makeSha(IV_512_224, 7)`. Fully reuses the SHA-512
|
|
18
|
+
compression function (see `sha512.acvp.md` — iteration A2 exposed the
|
|
19
|
+
parameterizable builder). Block size = **1024 bits** (identical to
|
|
20
|
+
SHA-512, required for HMAC-SHA-512/224).
|
|
21
|
+
|
|
22
|
+
Public API (HMAC-compatible contract):
|
|
23
|
+
|
|
24
|
+
- `hash(data)` → bitArray of 7 words (224 bits).
|
|
25
|
+
- `fn` streaming constructor: `prototype.{blockSize: 1024, update, finalize}` + clone constructor `new fn(other)`.
|
|
26
|
+
|
|
27
|
+
The IV (`_INIT_512_224`) is computed per FIPS 180-4 §5.3.6:
|
|
28
|
+
`H = SHA-512_with_IV_xor_0xa5a5..(ASCII("SHA-512/224"))`. Value derived
|
|
29
|
+
**by independent computation and verified** during iteration A3 (see tests).
|
|
30
|
+
|
|
31
|
+
## Test coverage
|
|
32
|
+
|
|
33
|
+
### Built-in official vectors
|
|
34
|
+
|
|
35
|
+
| Source | ACVP reference | Test (`describe`) | Property verified |
|
|
36
|
+
|---|---|---|---|
|
|
37
|
+
| **NIST CAVP / ACVP** | `SHA2-512-224-1.0` AFT (74/146 byte-aligned sub-samples out of 1024 total vectors) | `ACVP SHA2-512-224 AFT` | byte-exact `hash(msg) == md`, lengths 0..65535 bits with ~20 stride |
|
|
38
|
+
| **NIST CAVP / ACVP** | `SHA2-512-224-1.0` standard MCT (100 outer × 1000 inner) | `MCT standard byte-exact (100 checkpoints)` | Long-chain stability — byte-exact MD₁₀₀₀ against `resultsArray[j].md` for j∈[0,99] |
|
|
39
|
+
| Smoke | `hash("abc")` | `module shape` + suite | KAT `4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa` |
|
|
40
|
+
| Stream | 3-chunk update | `streaming = one-shot` | streaming = one-shot |
|
|
41
|
+
| Stream | clone constructor | `streaming clone constructor preserves IV + outWords` | divergence vs one-shot consistency after fork |
|
|
42
|
+
|
|
43
|
+
### Security properties tested
|
|
44
|
+
|
|
45
|
+
- [x] **IV distinct from SHA-512** — `digest differs from SHA-512 truncated`:
|
|
46
|
+
verifies that `SHA-512/224(msg) ≠ first 7 words of SHA-512(msg)`.
|
|
47
|
+
Security against cross-variant confusion.
|
|
48
|
+
- [x] **1024-bit block size** — required for HMAC-SHA-512/224 (HMAC
|
|
49
|
+
operates by blocks of the underlying compression function, not by
|
|
50
|
+
output size).
|
|
51
|
+
- [x] **Streaming = one-shot** — multi-chunk + clone constructor.
|
|
52
|
+
- [x] **224-bit output length** (7 words × 32 bits).
|
|
53
|
+
- [x] **100 × 1000 standard MCT** — chain A=B=C=SEED then iteration
|
|
54
|
+
`MD = SHA(A‖B‖C)` 1000 times; verifies each checkpoint byte-exact.
|
|
55
|
+
Detects any drift in the compression function.
|
|
56
|
+
- [ ] **Bit-level AFT (non-byte-aligned)** — 880/1024 vectors filtered
|
|
57
|
+
out because our implementation only absorbs full bytes (limitation
|
|
58
|
+
inherited from sha512.js, see sha512.acvp.md). **P3** — rarely used.
|
|
59
|
+
- [x] **LDT (Large Data Test)** — **post-upgrade audit (gap H1)**: tcId=1028
|
|
60
|
+
(1 GiB of repeated `0800e8a621b041c2`) integrated behind `CRYPTO_FULL=1`
|
|
61
|
+
(mirrors the H1 pattern from sha224/256/384/512, previously overlooked
|
|
62
|
+
for the truncated variant). Validates the 64-bit `_length` counter
|
|
63
|
+
per FIPS 180-4 §5.1.1 over ≥ 2³³ bits.
|
|
64
|
+
|
|
65
|
+
## FIPS 140-3 conformance
|
|
66
|
+
|
|
67
|
+
| Requirement | Status | Evidence |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Approved algorithm | ✅ | FIPS 180-4 §5.3.6.1 + ACVP `SHA2-512-224-1.0` |
|
|
70
|
+
| Byte-exact IV | ✅ | Cross-check: `hash("abc") == 4634270f...8924aa` |
|
|
71
|
+
| Parameter sizes | ✅ | 224-bit digest, 1024-bit block |
|
|
72
|
+
| Power-on KAT / self-test | ✅ | 74 AFT + 100 MCT checkpoints executed on every `bun test` |
|
|
73
|
+
| CT comparisons (if secret) | N/A | Hash module with no secret by default |
|
|
74
|
+
| No `throw` / timing leak | ✅ | Inherited from sha512.js (clean review) |
|
|
75
|
+
|
|
76
|
+
## Known limitations
|
|
77
|
+
|
|
78
|
+
- **No bit-level AFT**: 880/1024 ACVP vectors (non-byte-aligned)
|
|
79
|
+
filtered out. Limitation inherited from the SHA-512 core.
|
|
80
|
+
- ~~**LDT not integrated**~~ — resolved in the post-upgrade audit: tcId=1028 (1 GiB)
|
|
81
|
+
runs under `CRYPTO_FULL=1` byte-exact in ~40 s.
|
|
82
|
+
|
|
83
|
+
## Cross references
|
|
84
|
+
|
|
85
|
+
- Module: [`hash/sha512_224.js`](./sha512_224.js)
|
|
86
|
+
- Tests: [`hash/sha512_224.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/hash/sha512_224.test.js) — **82 tests** (81 pass + 1 skip LDT — `CRYPTO_FULL=1` to enable; 73 AFT + 1 MCT + 5 module + 2 additional + 1 LDT)
|
|
87
|
+
- Underlying SHA-512 module: [`./sha512.js`](./sha512.js) — see [sha512.acvp.md](./sha512.acvp.md) (iteration A2 exposes `_internal.makeSha`)
|
|
88
|
+
- Sibling SHA-512/256 module: [`./sha512_256.js`](./sha512_256.js) — see [sha512_256.acvp.md](./sha512_256.acvp.md)
|
|
89
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/SHA2-512-224-1.0/`
|
|
90
|
+
- Overall conformance: [`../NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview SHA-512/224 (FIPS 180-4 §5.3.6.1).
|
|
7
|
+
*
|
|
8
|
+
* Truncated SHA-512 variant: same compression function as SHA-512 (cf. sha512.js)
|
|
9
|
+
* but with a distinct initial hash value (IV) and a 224-bit final digest taken
|
|
10
|
+
* from the first 28 bytes of the 64-byte SHA-512 internal state.
|
|
11
|
+
*
|
|
12
|
+
* Per FIPS 180-4 §5.3.6, the IV is computed as SHA-512 with the IV
|
|
13
|
+
* `H_0 = 6a09e667f3bcc908 ⊕ a5a5a5a5a5a5a5a5 || ...` applied to the input
|
|
14
|
+
* `"SHA-512/224"` (ASCII), then taking the resulting 8 × 64-bit state. The
|
|
15
|
+
* resulting fixed IV is hard-coded below per the standard.
|
|
16
|
+
*
|
|
17
|
+
* Block size: 1024 bits (same as SHA-512 - required for HMAC-SHA-512/224).
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { sha512 } from './sha512.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Streaming SHA-512/224 hasher instance (truncated SHA-512; bitArray = `number[]` of 32-bit words).
|
|
25
|
+
* @typedef {object} Sha512_224Hasher
|
|
26
|
+
* @property {number} blockSize Block size in bits (1024).
|
|
27
|
+
* @property {number[]} _init IV (16 × 32-bit halves = 8 × 64-bit lanes).
|
|
28
|
+
* @property {number} _outWords Number of 32-bit words retained in the digest (7).
|
|
29
|
+
* @property {number[]} _key Round constants.
|
|
30
|
+
* @property {() => Sha512_224Hasher} reset Reset internal state; returns `this`.
|
|
31
|
+
* @property {(data: number[]|string) => (Sha512_224Hasher|false)} update Absorb a bitArray or UTF-8 string; returns `this`, or `false` on > 2^53-1 bit overflow.
|
|
32
|
+
* @property {() => number[]} finalize Pad and emit the 224-bit digest as a bitArray (7 words).
|
|
33
|
+
* @property {(words: ArrayLike<number>) => void} _block Compress one 32-word (1024-bit) block.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Object returned by `sha512_224.factory()`.
|
|
38
|
+
* @typedef {object} Sha512_224API
|
|
39
|
+
* @property {new (hash?: Sha512_224Hasher) => Sha512_224Hasher} fn Streaming hasher constructor (optional arg clones an existing instance).
|
|
40
|
+
* @property {(data: number[]|string) => number[]} hash One-shot hash; returns the 224-bit digest as a bitArray.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
export const sha512_224 = {
|
|
44
|
+
name: 'sha512_224',
|
|
45
|
+
version: '1.0.0',
|
|
46
|
+
type: 'fw.crypto.hash',
|
|
47
|
+
dependencies: ['sha512'],
|
|
48
|
+
deps: [sha512],
|
|
49
|
+
|
|
50
|
+
/** @returns {Sha512_224API} */
|
|
51
|
+
factory(sha512) {
|
|
52
|
+
// FIPS 180-4 §5.3.6.1 - IV for SHA-512/224 (8 × 64-bit, 16 × 32-bit halves).
|
|
53
|
+
const _INIT_512_224 = [
|
|
54
|
+
0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,
|
|
55
|
+
0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
// outWords = 7 → 7 × 32-bit = 224 bits.
|
|
59
|
+
const inner = sha512._internal.makeSha(_INIT_512_224, 7);
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
fn: inner.fn,
|
|
63
|
+
hash: inner.hash
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# `sha512_256.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **NIST FIPS 180-4** — *Secure Hash Standard*, **§5.3.6.2**
|
|
6
|
+
*Initial Hash Value for SHA-512/256*. Truncated SHA-512 variant
|
|
7
|
+
(same compression function, distinct IV, 256-bit output = 32 bytes
|
|
8
|
+
= first 8 words of the SHA-512 state).
|
|
9
|
+
- **Secondary**: **NIST SP 800-185 §4** mentions SHA-512/256 as a
|
|
10
|
+
high-performance alternative to SHA-256 on 64-bit platforms.
|
|
11
|
+
- **ACVP**: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/SHA2-512-256-1.0/`
|
|
12
|
+
|
|
13
|
+
## Implemented algorithm
|
|
14
|
+
|
|
15
|
+
`sha512_256.factory(sha512)` — minimal wrapper around
|
|
16
|
+
`sha512._internal.makeSha(IV_512_256, 8)`. Fully reuses the SHA-512
|
|
17
|
+
compression function (see iteration A2). Block size = **1024
|
|
18
|
+
bits** (identical to SHA-512, required for HMAC-SHA-512/256).
|
|
19
|
+
|
|
20
|
+
Public API (HMAC-compatible contract):
|
|
21
|
+
|
|
22
|
+
- `hash(data)` → bitArray of 8 words (256 bits).
|
|
23
|
+
- `fn` streaming constructor: `prototype.{blockSize: 1024, update, finalize}` + clone constructor `new fn(other)`.
|
|
24
|
+
|
|
25
|
+
The IV (`_INIT_512_256`) is computed per FIPS 180-4 §5.3.6:
|
|
26
|
+
`H = SHA-512_with_IV_xor_0xa5a5..(ASCII("SHA-512/256"))`. **Historical
|
|
27
|
+
note**: several sources publish an erroneous value for `H_1` (low half
|
|
28
|
+
`c84d6b74` vs the correct value `c84c64c2`). Our IV was **derived by
|
|
29
|
+
independent computation** during iteration A3, then cross-verified
|
|
30
|
+
against the OpenSSL `crypto/sha/sha512.c sha512_256_init` constants.
|
|
31
|
+
|
|
32
|
+
## Test coverage
|
|
33
|
+
|
|
34
|
+
### Built-in official vectors
|
|
35
|
+
|
|
36
|
+
| Source | ACVP reference | Test (`describe`) | Property verified |
|
|
37
|
+
|---|---|---|---|
|
|
38
|
+
| **NIST CAVP / ACVP** | `SHA2-512-256-1.0` AFT (53/1024 byte-aligned sub-samples) | `ACVP SHA2-512-256 AFT` | byte-exact `hash(msg) == md`, lengths 0..65535 bits with ~20 stride |
|
|
39
|
+
| **NIST CAVP / ACVP** | `SHA2-512-256-1.0` alternate MCT (100 outer × 1000 inner) | `MCT alternate byte-exact (100 checkpoints)` | Long-chain stability — byte-exact MD₁₀₀₀ against `resultsArray[j].md` for j∈[0,99] |
|
|
40
|
+
| Smoke | `hash("abc")` + `hash("")` | `module shape` + suite | KAT `53048e2681941ef9...07e7af23` and `c672b8d1ef56ed28...cef0967a` |
|
|
41
|
+
| Stream | 3-chunk update | `streaming = one-shot` | streaming = one-shot |
|
|
42
|
+
| Stream | clone constructor | `streaming clone constructor preserves IV + outWords` | divergence vs one-shot consistency after fork |
|
|
43
|
+
|
|
44
|
+
### Security properties tested
|
|
45
|
+
|
|
46
|
+
- [x] **IV distinct from SHA-512** — `digest differs from SHA-512 truncated`
|
|
47
|
+
verifies that `SHA-512/256(msg) ≠ first 8 words of SHA-512(msg)`.
|
|
48
|
+
Security against cross-variant confusion.
|
|
49
|
+
- [x] **Independently verified byte-exact IV** — the FIPS §5.3.6
|
|
50
|
+
derivation (SHA-512 with IV XOR a5...) reproduces the OpenSSL
|
|
51
|
+
constants; the classic `c84d6b74` error (present in several
|
|
52
|
+
docs and even some online references) does not pass the
|
|
53
|
+
`hash("abc")` test.
|
|
54
|
+
- [x] **1024-bit block size** — required for HMAC-SHA-512/256.
|
|
55
|
+
- [x] **Streaming = one-shot** — multi-chunk + clone constructor.
|
|
56
|
+
- [x] **256-bit output length** (8 words × 32 bits).
|
|
57
|
+
- [x] **100 × 1000 alternate MCT** — variant with trim to the seed length
|
|
58
|
+
(3984 bits = 498 bytes); verifies each checkpoint byte-exact.
|
|
59
|
+
- [ ] **Exhaustive AFT** — 971/1024 vectors not covered (sub-sampling
|
|
60
|
+
stride ~20). **P3** — already excellent representative coverage.
|
|
61
|
+
- [x] **LDT (Large Data Test)** — **post-upgrade audit (gap H1)**: tcId=1026
|
|
62
|
+
(1 GiB of repeated `dda456ef797c268f`) integrated behind `CRYPTO_FULL=1`
|
|
63
|
+
(mirrors the H1 pattern from sha224/256/384/512, previously overlooked
|
|
64
|
+
for the truncated variant). Validates the 64-bit `_length` counter
|
|
65
|
+
per FIPS 180-4 §5.1.1 over ≥ 2³³ bits.
|
|
66
|
+
|
|
67
|
+
## FIPS 140-3 conformance
|
|
68
|
+
|
|
69
|
+
| Requirement | Status | Evidence |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| Approved algorithm | ✅ | FIPS 180-4 §5.3.6.2 + ACVP `SHA2-512-256-1.0` |
|
|
72
|
+
| Byte-exact IV | ✅ | Cross-check: `hash("abc") == 53048e26...07e7af23` + independent derivation |
|
|
73
|
+
| Parameter sizes | ✅ | 256-bit digest, 1024-bit block |
|
|
74
|
+
| Power-on KAT / self-test | ✅ | 53 AFT + 100 MCT checkpoints executed on every `bun test` |
|
|
75
|
+
| CT comparisons (if secret) | N/A | Hash module with no secret by default |
|
|
76
|
+
| No `throw` / timing leak | ✅ | Inherited from sha512.js (clean review) |
|
|
77
|
+
|
|
78
|
+
## Known limitations
|
|
79
|
+
|
|
80
|
+
- **Aggressive AFT sub-sampling**: 53/1024 (≈ 5%). Regular stride ~20 +
|
|
81
|
+
min/max anchors. `_block` code path exercised across all length buckets.
|
|
82
|
+
- ~~**LDT not integrated**~~ — resolved in the post-upgrade audit: tcId=1026 (1 GiB)
|
|
83
|
+
runs under `CRYPTO_FULL=1` byte-exact in ~40 s.
|
|
84
|
+
- **Performance**: on Bun/Node, SHA-512/256 is not faster than
|
|
85
|
+
SHA-256 (both emulate 64-bit operations in JavaScript). The SHA-512/256
|
|
86
|
+
performance advantage over SHA-256 (cited in NIST SP 800-185) only
|
|
87
|
+
materializes in C/asm with native 64-bit instructions or SHA-NI offload.
|
|
88
|
+
|
|
89
|
+
## Cross references
|
|
90
|
+
|
|
91
|
+
- Module: [`hash/sha512_256.js`](./sha512_256.js)
|
|
92
|
+
- Tests: [`hash/sha512_256.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/hash/sha512_256.test.js) — **61 tests** (60 pass + 1 skip LDT — `CRYPTO_FULL=1` to enable; 53 AFT + 1 MCT + 6 module + 1 LDT)
|
|
93
|
+
- Underlying SHA-512 module: [`./sha512.js`](./sha512.js) — see [sha512.acvp.md](./sha512.acvp.md) (iteration A2 exposes `_internal.makeSha`)
|
|
94
|
+
- Sibling SHA-512/224 module: [`./sha512_224.js`](./sha512_224.js) — see [sha512_224.acvp.md](./sha512_224.acvp.md)
|
|
95
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/SHA2-512-256-1.0/`
|
|
96
|
+
- Overall conformance: [`../NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|