@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,110 @@
|
|
|
1
|
+
# `hmac.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **FIPS 198-1** — *The Keyed-Hash Message Authentication Code (HMAC)*.
|
|
6
|
+
- **Secondary**: **RFC 2104** (HMAC) + **RFC 4231** (HMAC-SHA-2 test vectors).
|
|
7
|
+
- **ACVP draft**: `references/NIST/ACVP/src/` (HMAC sub-spec).
|
|
8
|
+
- **Vectors**:
|
|
9
|
+
- `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/HMAC-SHA2-{224,256,384,512}-2.0/`
|
|
10
|
+
|
|
11
|
+
## Implemented algorithm
|
|
12
|
+
|
|
13
|
+
HMAC `H(K xor opad || H(K xor ipad || M))` (FIPS 198-1 / RFC 2104). Underlying
|
|
14
|
+
hash passed as a constructor argument (default `sha256`). If the key
|
|
15
|
+
exceeds `blockSize`, it is pre-hashed. Dual streaming state: `_baseHash[0]`
|
|
16
|
+
(ipad), `_baseHash[1]` (opad), result derived via `_resultHash`. API:
|
|
17
|
+
`new fn(key, Hash).update(data).digest()` or `.encrypt(data)`; `verify(key,
|
|
18
|
+
data, tag, Hash)` constant-time via `bitArray.equal`. Output: `bitArray`
|
|
19
|
+
(length = underlying hash's `digestSize`). MAC truncation is the
|
|
20
|
+
caller's responsibility (`bitArray.clamp(tag, macLen)`).
|
|
21
|
+
|
|
22
|
+
## Test coverage
|
|
23
|
+
|
|
24
|
+
### Built-in official vectors
|
|
25
|
+
|
|
26
|
+
| Source | Reference | Test (`describe` / `test`) | Property verified |
|
|
27
|
+
|---|---|---|---|
|
|
28
|
+
| RFC 4231 | TC 1, 2, 3, 4, 6 (HMAC-SHA-256) | `RFC 4231 HMAC-SHA-256 vectors` | byte-exact KAT (incl. key > blockSize) |
|
|
29
|
+
| RFC 4231 | TC 1 (HMAC-SHA-512) | `HMAC-SHA-512 (custom hash arg)` | byte-exact KAT, validates custom hash injection |
|
|
30
|
+
| **ACVP-HMAC-SHA2-224-2.0** | AFT sub-sample 36/150 | `ACVP HMAC-SHA2-224-2.0 / AFT` | byte-exact KAT, keyLen 8..2048, variable macLen |
|
|
31
|
+
| **ACVP-HMAC-SHA2-256-2.0** | AFT sub-sample 35/150 | `ACVP HMAC-SHA2-256-2.0 / AFT` | byte-exact KAT, keyLen 8..2048, variable macLen |
|
|
32
|
+
| **ACVP-HMAC-SHA2-384-2.0** | AFT sub-sample 35/150 | `ACVP HMAC-SHA2-384-2.0 / AFT` | byte-exact KAT, keyLen 8..2048, variable macLen |
|
|
33
|
+
| **ACVP-HMAC-SHA2-512-2.0** | AFT sub-sample 36/150 | `ACVP HMAC-SHA2-512-2.0 / AFT` | byte-exact KAT, keyLen 8..2048, variable macLen |
|
|
34
|
+
| **ACVP-HMAC-SHA3-224-2.0** (B1) | AFT sub-sample 31/150 | `hmac - ACVP HMAC-SHA3-224-2.0` | byte-exact KAT via `sha3.sha3_224_hash` (rate 1152 bits) |
|
|
35
|
+
| **ACVP-HMAC-SHA3-256-2.0** (B1) | AFT sub-sample 31/150 | `hmac - ACVP HMAC-SHA3-256-2.0` | byte-exact KAT via `sha3.sha3_256_hash` (rate 1088 bits) |
|
|
36
|
+
| **ACVP-HMAC-SHA3-384-2.0** (B1) | AFT sub-sample 31/150 | `hmac - ACVP HMAC-SHA3-384-2.0` | byte-exact KAT via `sha3.sha3_384_hash` (rate 832 bits) |
|
|
37
|
+
| **ACVP-HMAC-SHA3-512-2.0** (B1) | AFT sub-sample 31/150 | `hmac - ACVP HMAC-SHA3-512-2.0` | byte-exact KAT via `sha3.sha3_512_hash` (rate 576 bits) |
|
|
38
|
+
| **ACVP-HMAC-SHA2-512-224-2.0** (B2) | AFT sub-sample 31/150 | `hmac - ACVP HMAC-SHA2-512-224-2.0` | byte-exact KAT via `sha512_224.factory(sha512)` (block 1024, digest 224 bits) |
|
|
39
|
+
| **ACVP-HMAC-SHA2-512-256-2.0** (B2) | AFT sub-sample 31/150 | `hmac - ACVP HMAC-SHA2-512-256-2.0` | byte-exact KAT via `sha512_256.factory(sha512)` (block 1024, digest 256 bits) |
|
|
40
|
+
|
|
41
|
+
#### AFT sub-sampling strategy
|
|
42
|
+
|
|
43
|
+
Each ACVP HMAC-SHA2-X-2.0 suite enumerates 150 tests (1 testGroup) covering
|
|
44
|
+
~130 distinct keyLen × 129 msgLen × 11 macLen, **all byte-aligned** (verified
|
|
45
|
+
at extraction time). Strategy:
|
|
46
|
+
|
|
47
|
+
- **Regular stride**: one tcId in 5.
|
|
48
|
+
- **Anchors**: `min/max(keyLen)`, `min/max(msgLen)`, `min/max(macLen)`,
|
|
49
|
+
first and last tcId.
|
|
50
|
+
- **Total integrated**: ~35 / 150 per variant (≈ 23%).
|
|
51
|
+
|
|
52
|
+
### Security properties tested
|
|
53
|
+
|
|
54
|
+
- [x] **Key pre-hashing > blockSize** — RFC 4231 TC 6 (131-byte key; SHA-256
|
|
55
|
+
blockSize = 64) + ACVP case `keyLen ∈ {1024..2048}`.
|
|
56
|
+
- [x] **Correct ipad/opad padding** — implicitly covered by every KAT.
|
|
57
|
+
- [x] **MAC truncation** — variable `macLen` validated on 11 distinct values
|
|
58
|
+
per variant via `bitArray.clamp(tag, macBits)`.
|
|
59
|
+
- [x] **Streaming = one-shot** — `chunked update matches one-shot`.
|
|
60
|
+
- [x] **Reset after digest** — `reset allows reuse after digest`.
|
|
61
|
+
- [x] **Double-encrypt guard** — `encrypt` on an already-`update`-d instance
|
|
62
|
+
returns `false` + `console.warn`.
|
|
63
|
+
- [x] **Constant-time verify** — `verify` uses `bitArray.equal`
|
|
64
|
+
(XOR-accumulated, no short-circuit) — see tests `accepts correct tag`,
|
|
65
|
+
`rejects single-bit tampered tag`, `rejects different message`,
|
|
66
|
+
`rejects different key`, `verify with custom hash module`.
|
|
67
|
+
- [x] **Arbitrary hash injection** — `Hash` constructor parameter,
|
|
68
|
+
validated by HMAC-SHA-{224,256,384,512} in the same suite.
|
|
69
|
+
- [ ] **Key pre-hashing timing side-channel** — N/A (pre-hashing
|
|
70
|
+
consumes the key in a block, no data-dependent comparison).
|
|
71
|
+
|
|
72
|
+
## FIPS 140-3 conformance
|
|
73
|
+
|
|
74
|
+
| Requirement | Status | Evidence |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| Approved algorithm | ✅ | FIPS 198-1 + ACVP-HMAC-SHA2-{224,256,384,512}-2.0 + ACVP-HMAC-SHA2-512-{224,256}-2.0 (B2) + ACVP-HMAC-SHA3-{224,256,384,512}-2.0 (B1) |
|
|
77
|
+
| Validated parameter sizes | ✅ | **10 underlying hashes** (4 SHA-2 + 2 SHA-512-truncated + 4 SHA-3) × keyLen 8..2048 × 11 macLen values |
|
|
78
|
+
| Power-on KAT / self-test | ✅ | RFC 4231 + ~140 SHA-2 vectors + 62 SHA-512-truncated vectors + 124 SHA-3 ACVP vectors executed on every `bun test` |
|
|
79
|
+
| CT comparisons (if secret) | ✅ | `verify` → `bitArray.equal` (XOR-accumulated) |
|
|
80
|
+
| No `throw` / timing leak | ✅ | Review: `console.warn` + `return false` (encrypt on an updated instance) |
|
|
81
|
+
|
|
82
|
+
## Known limitations
|
|
83
|
+
|
|
84
|
+
- **HMAC-SHA-1 not covered**: SHA-1 is out of scope (discouraged by NIST SP
|
|
85
|
+
800-131A); no `sha1.js` module exposed. The ACVP
|
|
86
|
+
`HMAC-SHA-1-{1.0,2.0}` folders present under `references/NIST/` remain unused.
|
|
87
|
+
- ~~**HMAC-SHA-3 not covered**~~ ✅ **Iteration B1 (upgrade plan)**:
|
|
88
|
+
HMAC-SHA-3-{224,256,384,512} now covered via the streaming modules
|
|
89
|
+
`sha3.sha3_{224,256,384,512}_hash` exposed in iteration A1. **31
|
|
90
|
+
byte-exact ACVP HMAC-SHA3-*-2.0 vectors per variant** (124 total).
|
|
91
|
+
- ~~**HMAC-SHA-512/224 and HMAC-SHA-512/256 not covered**~~ ✅ **Iteration
|
|
92
|
+
B2**: covered via the `sha512_224.js` / `sha512_256.js` modules created
|
|
93
|
+
in A3. **62 byte-exact ACVP HMAC-SHA2-512-{224,256}-2.0 vectors**
|
|
94
|
+
(31 + 31 sub-samples).
|
|
95
|
+
- **AFT sub-sampling**: ~23% per variant. The HMAC code path is unique
|
|
96
|
+
(`encrypt`), only the `keyLen > blockSize` and `keyLen <
|
|
97
|
+
blockSize` transitions diverge; both branches are covered by the
|
|
98
|
+
`min/max(keyLen)` anchors.
|
|
99
|
+
- **No HMAC MCT**: the ACVP HMAC suite does not define a Monte Carlo
|
|
100
|
+
Test (unlike SHA-2 / SHA-3).
|
|
101
|
+
- **No explicit guard against an empty key**: `keyLen=0` is accepted by the
|
|
102
|
+
constructor (equivalent to HMAC of an all-zero key after ipad/opad XOR);
|
|
103
|
+
not forbidden by RFC 2104 but to be avoided in production.
|
|
104
|
+
|
|
105
|
+
## Cross references
|
|
106
|
+
|
|
107
|
+
- Module: [`hash/hmac.js`](./hmac.js)
|
|
108
|
+
- Tests: [`hash/hmac.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/hash/hmac.test.js) — 344 tests (158 SHA-2 + 124 SHA-3 [B1] + 62 SHA-512-truncated [B2])
|
|
109
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/HMAC-SHA2-*-2.0/`
|
|
110
|
+
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview HMAC (RFC 2104) keyed-hash construction.
|
|
7
|
+
*
|
|
8
|
+
* Defaults to SHA-256 but accepts any hash module exposing the same shape
|
|
9
|
+
* (`{ fn, hash, fn.prototype.blockSize }`) as `Hash` in the constructor -
|
|
10
|
+
* e.g. `sha512` for HMAC-SHA-512.
|
|
11
|
+
*
|
|
12
|
+
* Streaming usage: `new hmac.fn(key).update(chunk).update(chunk).digest()`.
|
|
13
|
+
* One-shot: `new hmac.fn(key).encrypt(data)` (alias: `.mac(data)`).
|
|
14
|
+
*
|
|
15
|
+
* **Mutual exclusion**: `encrypt`/`mac` and the `update`+`digest` streaming
|
|
16
|
+
* path are mutually exclusive on a single instance. Once `update` has been
|
|
17
|
+
* called, `encrypt` rejects with a warning (the `_updated` guard) - use
|
|
18
|
+
* `reset()` to reuse the instance, or call `digest()` to consume the stream.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Public shape of a constructed HMAC instance (prototype methods).
|
|
24
|
+
* `bitArray` values are represented as `number[]`.
|
|
25
|
+
* @typedef {object} HmacInstance
|
|
26
|
+
* @property {(data: (number[]|Uint8Array|string)) => HmacInstance} update Streaming absorb; returns `this`.
|
|
27
|
+
* @property {() => number[]} digest Finalize and return the MAC tag (bitArray); resets the instance.
|
|
28
|
+
* @property {(data: (number[]|Uint8Array|string)) => (number[]|false)} encrypt One-shot MAC; `false` if already updated.
|
|
29
|
+
* @property {(data: (number[]|Uint8Array|string)) => (number[]|false)} mac Alias for `encrypt`.
|
|
30
|
+
* @property {() => void} reset Reset streaming state (key schedule preserved).
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Public shape returned by `hmac.factory()`.
|
|
35
|
+
* @typedef {object} HmacAPI
|
|
36
|
+
* @property {new (key: (number[]|Uint8Array|string), Hash?: object) => HmacInstance} fn
|
|
37
|
+
* HMAC constructor bound to `key` under the (optional) hash module.
|
|
38
|
+
* @property {(key: (number[]|Uint8Array|string), data: (number[]|Uint8Array|string), tag: number[], Hash?: object) => boolean} verify
|
|
39
|
+
* Constant-time MAC verification.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
import { bitArray } from '../utils/bitArray.js';
|
|
43
|
+
import { utf8 } from '../../io/codec/utf8.js';
|
|
44
|
+
import { sha256 } from './sha256.js';
|
|
45
|
+
|
|
46
|
+
export const hmac = {
|
|
47
|
+
name: 'hmac',
|
|
48
|
+
version: '1.0.0',
|
|
49
|
+
type: 'fw.crypto.hash',
|
|
50
|
+
dependencies: ['bitArray', 'utf8', 'sha256'],
|
|
51
|
+
deps: [bitArray, utf8, sha256],
|
|
52
|
+
|
|
53
|
+
/** @returns {HmacAPI} */
|
|
54
|
+
factory(bitArray, utf8, sha256) {
|
|
55
|
+
|
|
56
|
+
const api = {};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Construct an HMAC instance bound to `key` under hash module `Hash`.
|
|
60
|
+
* @param {bitArray|Uint8Array|string} key Secret key.
|
|
61
|
+
* @param {Object} [Hash] Hash module (default: sha256). Must expose
|
|
62
|
+
* `{ fn, hash, fn.prototype.blockSize }`.
|
|
63
|
+
*/
|
|
64
|
+
api.fn = function (key, Hash) {
|
|
65
|
+
/** @type {boolean} */
|
|
66
|
+
this._updated = false;
|
|
67
|
+
this._hash = Hash || sha256;
|
|
68
|
+
|
|
69
|
+
if (typeof key === 'string') {
|
|
70
|
+
key = bitArray.ui8_to_ba(utf8.toBytes(key));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const exKey = [[], []];
|
|
74
|
+
// `bs` is the block size expressed in 32-bit words (e.g. 16 for
|
|
75
|
+
// SHA-256's 512-bit block). `key.length` is the count of words
|
|
76
|
+
// in the bitArray representation, so the comparison is in the
|
|
77
|
+
// same unit on both sides.
|
|
78
|
+
const bs = this._hash.fn.prototype.blockSize / 32;
|
|
79
|
+
this._baseHash = [new this._hash.fn(), new this._hash.fn()];
|
|
80
|
+
|
|
81
|
+
if (key.length > bs) {
|
|
82
|
+
key = this._hash.hash(key);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// By this point `key` is a bitArray (32-bit words) : the string
|
|
86
|
+
// branch above converted it via `bitArray.ui8_to_ba`, and
|
|
87
|
+
// `hash()` always returns a bitArray. The declared union type
|
|
88
|
+
// still allows `string`, so we narrow locally for the bitwise
|
|
89
|
+
// loop below.
|
|
90
|
+
const k = /** @type {number[]} */ (/** @type {any} */ (key));
|
|
91
|
+
for (let i = 0; i < bs; i++) {
|
|
92
|
+
exKey[0][i] = (k[i] | 0) ^ 0x36363636;
|
|
93
|
+
exKey[1][i] = (k[i] | 0) ^ 0x5C5C5C5C;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this._baseHash[0].update(exKey[0]);
|
|
97
|
+
this._baseHash[1].update(exKey[1]);
|
|
98
|
+
this._resultHash = new this._hash.fn(this._baseHash[0]);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* One-shot MAC: feed `data` and return the digest. Rejects (returns
|
|
103
|
+
* `false`) if `update` has already been called on this instance -
|
|
104
|
+
* use `reset()` to recycle the instance for another one-shot call.
|
|
105
|
+
* @param {bitArray|Uint8Array|string} data
|
|
106
|
+
* @returns {bitArray|false} MAC tag, or `false` on misuse.
|
|
107
|
+
*/
|
|
108
|
+
api.fn.prototype.encrypt = function (data) {
|
|
109
|
+
if (this._updated) {
|
|
110
|
+
console.warn('[crypto] INVALID: hmac: encrypt called on already-updated instance');
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
this.update(data);
|
|
114
|
+
return this.digest();
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Alias for {@link encrypt} - preferred name when the semantic is a
|
|
119
|
+
* Message Authentication Code rather than encryption. Same behaviour
|
|
120
|
+
* and same mutual-exclusion contract as `encrypt`.
|
|
121
|
+
*/
|
|
122
|
+
api.fn.prototype.mac = api.fn.prototype.encrypt;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Reset internal streaming state so the instance can be reused for a
|
|
126
|
+
* fresh `update`/`digest` cycle or a new `encrypt`/`mac` call. The
|
|
127
|
+
* key schedule (`_baseHash`) is preserved.
|
|
128
|
+
*/
|
|
129
|
+
api.fn.prototype.reset = function () {
|
|
130
|
+
this._resultHash = new this._hash.fn(this._baseHash[0]);
|
|
131
|
+
this._updated = false;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Streaming update: absorb `data` into the inner hash.
|
|
136
|
+
* @param {bitArray|Uint8Array|string} data
|
|
137
|
+
* @returns {this} For chaining.
|
|
138
|
+
*/
|
|
139
|
+
api.fn.prototype.update = function (data) {
|
|
140
|
+
this._updated = true;
|
|
141
|
+
this._resultHash.update(data);
|
|
142
|
+
// @ts-ignore - TS2719: constructor-function 'this' return type narrowing limitation
|
|
143
|
+
return this;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Finalize the streaming computation and return the MAC tag. Resets
|
|
148
|
+
* the instance afterwards so it can be reused.
|
|
149
|
+
* @returns {bitArray} MAC tag.
|
|
150
|
+
*/
|
|
151
|
+
api.fn.prototype.digest = function () {
|
|
152
|
+
const w = this._resultHash.finalize();
|
|
153
|
+
const result = new this._hash.fn(this._baseHash[1]).update(w).finalize();
|
|
154
|
+
this.reset();
|
|
155
|
+
return result;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Constant-time MAC verification. Computes HMAC(key, data) under the
|
|
160
|
+
* same hash family and compares against `tag` using `bitArray.equal`
|
|
161
|
+
* (XOR-accumulated, no early exit).
|
|
162
|
+
*
|
|
163
|
+
* @param {bitArray|Uint8Array|string} key
|
|
164
|
+
* @param {bitArray|Uint8Array|string} data
|
|
165
|
+
* @param {bitArray} tag Expected MAC as a bitArray.
|
|
166
|
+
* @param {Object} [Hash] Optional hash module (defaults to sha256).
|
|
167
|
+
* @returns {boolean} true iff the recomputed MAC matches `tag`.
|
|
168
|
+
*/
|
|
169
|
+
api.verify = function (key, data, tag, Hash) {
|
|
170
|
+
const expected = new api.fn(key, Hash).encrypt(data);
|
|
171
|
+
if (expected === false) return false;
|
|
172
|
+
return bitArray.equal(expected, tag);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
return api;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# `pbkdf2.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **NIST SP 800-132** — *Recommendation for
|
|
6
|
+
Password-Based Key Derivation, Part 1: Storage Applications*.
|
|
7
|
+
- **Secondary**: **RFC 2898 / PKCS #5 v2.1 / RFC 8018** — *PKCS #5:
|
|
8
|
+
Password-Based Cryptography Specification* (PBKDF2 algorithm,
|
|
9
|
+
reference vectors for HMAC-SHA-1/256).
|
|
10
|
+
- **OWASP conformance**: Password Storage Cheat Sheet (2023) —
|
|
11
|
+
`count ≥ 600 000` for PBKDF2-HMAC-SHA-256.
|
|
12
|
+
- **ACVP draft**: `references/NIST/ACVP/src/draft-celi-acvp-pbkdf.adoc`
|
|
13
|
+
- **Vectors**: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/PBKDF-1.0/`
|
|
14
|
+
|
|
15
|
+
## Implemented algorithm
|
|
16
|
+
|
|
17
|
+
PBKDF2 (PKCS #5 §5.2 / RFC 2898):
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
DK = T_1 || T_2 || ... || T_l (truncated to dkLen)
|
|
21
|
+
T_i = F(P, S, c, i)
|
|
22
|
+
F(P, S, c, i) = U_1 ⊕ U_2 ⊕ ... ⊕ U_c
|
|
23
|
+
U_1 = PRF(P, S || INT_be32(i))
|
|
24
|
+
U_j = PRF(P, U_{j-1})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Default PRF = HMAC-SHA-256 (`Prff` overridable). `dkLen` in bits.
|
|
28
|
+
Bounds: `count ≥ 0`, `length ≥ 0`; warning if `count < 100 000`
|
|
29
|
+
(`MIN_RECOMMENDED_COUNT`). Default `count = 600 000` (OWASP 2023).
|
|
30
|
+
|
|
31
|
+
API: `pbkdf2(password, salt, count, length_bits, Prff?)` — directly
|
|
32
|
+
callable; `.derive(...)` alias. `password`/`salt` accept `string`
|
|
33
|
+
(UTF-8 → bytes → bitArray) or `bitArray`. Output `bitArray | false`.
|
|
34
|
+
|
|
35
|
+
## Test coverage
|
|
36
|
+
|
|
37
|
+
### Built-in official vectors
|
|
38
|
+
|
|
39
|
+
| Source | Reference | Test (`describe` / `test`) | Property verified |
|
|
40
|
+
|---|---|---|---|
|
|
41
|
+
| RFC 7914 / PKCS #5 (de-facto) | TC 1 (c=1, dkLen=256) | `c=1, dkLen=256 bits` | byte-exact KAT (sanity) |
|
|
42
|
+
| RFC 7914 / PKCS #5 (de-facto) | TC 2 (c=2) | `c=2, dkLen=256 bits` | byte-exact KAT |
|
|
43
|
+
| RFC 7914 / PKCS #5 (de-facto) | TC 3 (c=4096) | `c=4096, dkLen=256 bits` | byte-exact KAT (nominal count) |
|
|
44
|
+
| RFC 7914 / PKCS #5 (de-facto) | TC 4 (long P/S) | `c=4096, dkLen=320 bits` | byte-exact KAT, multi-block T_2 |
|
|
45
|
+
| **PBKDF-1.0** | AFT 25/50 (sub-sample 1/2) | `pbkdf2 - PBKDF-1.0 / AFT` | byte-exact dkm (HMAC-SHA-224 × 25 vectors) |
|
|
46
|
+
| **Cross-check against Python `hashlib.pbkdf2_hmac()`** (B4) | 9 families × 5 cases = 45 vectors | `pbkdf2 - itération B4 (10-family cross-check)` | byte-exact against the `hashlib.pbkdf2_hmac()` reference (SHA-2-256/384/512, SHA-512/{224,256}, SHA-3-{224,256,384,512}) |
|
|
47
|
+
|
|
48
|
+
#### AFT sub-sampling strategy
|
|
49
|
+
|
|
50
|
+
`PBKDF-1.0` exposes only **1 testGroup × 50 AFT** (HMAC-SHA-224;
|
|
51
|
+
the other PRFs are absent from the v1.0 draft). Sub-sample applied:
|
|
52
|
+
|
|
53
|
+
- **1 vector out of 2** (even index) → 25 vectors integrated.
|
|
54
|
+
- Total `iterationCount` executed = **135 077** HMAC-SHA-224
|
|
55
|
+
iterations (~5 s wall-time in pure JS).
|
|
56
|
+
- Covers `iterationCount ∈ [1, 10 000]`, `keyLen ∈ [112, 560]` bits,
|
|
57
|
+
`saltLen ∈ [16, 32]` bytes, `passwordLen ∈ [8, 32]` ASCII characters.
|
|
58
|
+
|
|
59
|
+
### Security properties tested
|
|
60
|
+
|
|
61
|
+
- [x] **F(P, S, c, i) chain (XOR of c PRF calls)** — covered by all
|
|
62
|
+
vectors with `c > 1` (24/25 ACVP).
|
|
63
|
+
- [x] **Multi-block T_i (dkLen > HashLen)** — `keyLen > 224` bits forces
|
|
64
|
+
≥ 2 blocks T_1, T_2 (16/25 ACVP with keyLen ∈ [232, 560]).
|
|
65
|
+
- [x] **Single-iteration KAT** — `c=1` covers the initial output `T_i =
|
|
66
|
+
PRF(P, S || INT_be32(i))` (1 ACVP + 1 RFC).
|
|
67
|
+
- [x] **High-iteration count** — `c=10 000` exercised (1 ACVP), `c=4096`
|
|
68
|
+
(2 RFC).
|
|
69
|
+
- [x] **HMAC-SHA-256** (default PRF) — RFC 7914 vectors.
|
|
70
|
+
- [x] **HMAC-SHA-224** (Prff override) — 25 byte-exact ACVP.
|
|
71
|
+
- [x] **HMAC-SHA-{384,512}** ✅ B4 — 5 vectors/family cross-checked against Python `hashlib`.
|
|
72
|
+
- [x] **HMAC-SHA-512/{224,256}** ✅ B4 — 5 vectors/family cross-checked against Python `hashlib`.
|
|
73
|
+
- [x] **HMAC-SHA-3-{224,256,384,512}** ✅ B4 — 5 vectors/family cross-checked against Python `hashlib`.
|
|
74
|
+
- [x] **String → UTF-8 bytes** — handcrafted (`'password'` direct).
|
|
75
|
+
- [x] **Default count 600 000 applied** — `pbkdf2('p', 's', undefined,
|
|
76
|
+
128) === pbkdf2('p', 's', 600000, 128)`.
|
|
77
|
+
- [x] **Warning if count < 100 000** — emits `console.warn('WEAK:')`;
|
|
78
|
+
observed on 25/25 ACVP (all < 100 000) + 45 cross-check (same).
|
|
79
|
+
- [x] **Bounds** — `count < 0` → `false`; `length < 0` → `false`.
|
|
80
|
+
- [x] **Empty password** ✅ B4 — `pbkdf2('', 'salt', 10, 128)` covered
|
|
81
|
+
for the 9 new families (degenerate PRF-over-zero-length-input case).
|
|
82
|
+
- [x] **dkLen < HashLen (T_1 truncation)** ✅ B4 — `dkLen=160` bits with
|
|
83
|
+
HashLen=512 bits forces a single truncated `T_1` output; covered for
|
|
84
|
+
the 9 new families.
|
|
85
|
+
- [ ] **PBKDF-2.0 ACVP** — not published to date; the Python cross-check
|
|
86
|
+
remains the authority for the 9 families not covered by v1.0.
|
|
87
|
+
- [ ] **HMAC side-channel** — delegated to `hmac.js`.
|
|
88
|
+
|
|
89
|
+
## FIPS 140-3 conformance
|
|
90
|
+
|
|
91
|
+
| Requirement | Status | Evidence |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| Approved algorithm | ✅ | SP 800-132 (PBKDF) + PKCS #5 v2.1 |
|
|
94
|
+
| Validated parameter sizes | ✅ | dkLen 112..560 bits × salt 16..32 B × password 8..32 B × iter 1..10000 + cross-check 9 PRF families (B4) |
|
|
95
|
+
| Power-on KAT / self-test | ✅ | RFC 7914 + 25 ACVP SHA-224 + 45 cross-check (B4) executed on every `bun test` |
|
|
96
|
+
| CT comparisons (if secret) | N/A (PBKDF2 performs no comparison; delegated to the caller) | — |
|
|
97
|
+
| No `throw` / timing leak | ✅ | Review: `console.warn` + `return false` |
|
|
98
|
+
| Production hardening | ✅ | Default `count = 600 000` (OWASP 2023); warning below 100 000 |
|
|
99
|
+
|
|
100
|
+
## Known limitations
|
|
101
|
+
|
|
102
|
+
- **PBKDF-1.0 covers only HMAC-SHA-224**: the 9 other families
|
|
103
|
+
(SHA-256/384/512, SHA-512/{224,256}, SHA-3-{224,256,384,512}) are
|
|
104
|
+
validated in B4 via cross-check against Python **`hashlib.pbkdf2_hmac()`**
|
|
105
|
+
(5 vectors/family = 45 regression vectors). A future PBKDF-2.0
|
|
106
|
+
ACVP would replace these snapshots with official NIST vectors.
|
|
107
|
+
- **50% sub-sampling**: 25 ACVP vectors not exercised (out of 50). The
|
|
108
|
+
even-index pattern uniformly covers the `iterationCount` range.
|
|
109
|
+
- ~~**HMAC-SHA-3**~~ ✅ B4 — supported via the A1 streaming modules.
|
|
110
|
+
- **B4 wall-time cost**: 6.3 s for the 80 tests (including 18 vectors
|
|
111
|
+
at `c=4096` across 9 families). For `count = 600 000` (default
|
|
112
|
+
production), a single call = 30-60 s; the module is designed for
|
|
113
|
+
off-critical-path usage (key wrapping/storage).
|
|
114
|
+
|
|
115
|
+
## Cross references
|
|
116
|
+
|
|
117
|
+
- Module: [`hash/pbkdf2.js`](./pbkdf2.js)
|
|
118
|
+
- Tests: [`hash/pbkdf2.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/hash/pbkdf2.test.js) — 80 tests (35 baseline + 45 cross-check over 9 families since iteration B4)
|
|
119
|
+
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-pbkdf.adoc`
|
|
120
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/PBKDF-1.0/`
|
|
121
|
+
- Underlying HMAC: [`hmac.acvp.md`](./hmac.acvp.md)
|
|
122
|
+
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview PBKDF2 (PKCS #5 v2 / RFC 2898) password-based key derivation.
|
|
7
|
+
*
|
|
8
|
+
* Default iteration count is 600000 (OWASP 2023 recommendation for
|
|
9
|
+
* PBKDF2-HMAC-SHA-256 password storage). A console warning is emitted when
|
|
10
|
+
* an explicit count below 100000 is used, so test/KAT vectors continue to
|
|
11
|
+
* work but accidentally weak production calls are flagged.
|
|
12
|
+
*
|
|
13
|
+
* The pseudo-random function family defaults to HMAC-SHA-256; pass any
|
|
14
|
+
* module shaped like `hmac` as `Prff` for a different PRF.
|
|
15
|
+
*
|
|
16
|
+
* Public API: the factory returns a callable function `pbkdf2(password,
|
|
17
|
+
* salt, count, length, Prff)` that also exposes `.derive(...)` (alias),
|
|
18
|
+
* `.name` and `.MIN_RECOMMENDED_COUNT` so it integrates cleanly with the
|
|
19
|
+
* standard `{ name, ... }` module shape used elsewhere in the framework.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Single PBKDF2 derivation call signature. `bitArray` values are `number[]`.
|
|
25
|
+
* @typedef {(password: (number[]|string), salt: (number[]|string), count?: number, length?: number, Prff?: {fn:Function}) => (number[]|false)} Pbkdf2Derive
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Public shape returned by `pbkdf2.factory()`: a callable function carrying
|
|
30
|
+
* `.derive` (alias of itself) and the recommended-count constants.
|
|
31
|
+
* @typedef {Pbkdf2Derive & { derive: Pbkdf2Derive, MIN_RECOMMENDED_COUNT: number, DEFAULT_COUNT: number }} Pbkdf2API
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import { bitArray } from '../utils/bitArray.js';
|
|
35
|
+
import { utf8 } from '../../io/codec/utf8.js';
|
|
36
|
+
import { hmac } from './hmac.js';
|
|
37
|
+
|
|
38
|
+
export const pbkdf2 = {
|
|
39
|
+
name: 'pbkdf2',
|
|
40
|
+
version: '1.0.0',
|
|
41
|
+
type: 'fw.crypto.hash',
|
|
42
|
+
dependencies: ['bitArray', 'utf8', 'hmac'],
|
|
43
|
+
deps: [bitArray, utf8, hmac],
|
|
44
|
+
|
|
45
|
+
/** @returns {Pbkdf2API} */
|
|
46
|
+
factory(bitArray, utf8, hmac) {
|
|
47
|
+
|
|
48
|
+
const DEFAULT_COUNT = 600000;
|
|
49
|
+
const MIN_RECOMMENDED_COUNT = 100000;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* PBKDF2 key derivation (PKCS #5 v2 / RFC 2898 §5.2).
|
|
53
|
+
* @param {bitArray|string} password Password / passphrase.
|
|
54
|
+
* @param {bitArray|string} salt Salt (≥ 64 bits recommended).
|
|
55
|
+
* @param {number} [count] Iteration count
|
|
56
|
+
* (default: 600000 = OWASP-2023 for HMAC-SHA-256).
|
|
57
|
+
* @param {number} [length] Desired output length in **bits**.
|
|
58
|
+
* `0` returns `[]` (off-spec convenience); the caller is responsible
|
|
59
|
+
* for picking ≥ 128 bits for security uses.
|
|
60
|
+
* @param {{fn:Function}} [Prff] PRF module (default: hmac, i.e.
|
|
61
|
+
* HMAC-SHA-256). Must expose `.fn` constructor + `.encrypt(data)`.
|
|
62
|
+
* @returns {bitArray|false} Derived key, or `false` on invalid
|
|
63
|
+
* parameters (negative length/count).
|
|
64
|
+
*/
|
|
65
|
+
function derive(password, salt, count, length, Prff) {
|
|
66
|
+
if (count === undefined) {
|
|
67
|
+
count = DEFAULT_COUNT;
|
|
68
|
+
} else if (count > 0 && count < MIN_RECOMMENDED_COUNT) {
|
|
69
|
+
console.warn(
|
|
70
|
+
'[crypto] WEAK: pbkdf2: count=' + count +
|
|
71
|
+
' below recommended minimum (' + MIN_RECOMMENDED_COUNT + ')'
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (length < 0 || count < 0) {
|
|
76
|
+
console.warn('[crypto] INVALID: pbkdf2: invalid params');
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
// Edge case (post-upgrade audit): `length === 0` must return []
|
|
80
|
+
// without entering the loop - otherwise the `length || 1` fallback
|
|
81
|
+
// below would compute a phantom block. RFC 2898 §5.2 requires
|
|
82
|
+
// dkLen ≥ 1 octet; this case is off-spec but we handle it cleanly
|
|
83
|
+
// rather than emitting a stray block.
|
|
84
|
+
if (length === 0) return [];
|
|
85
|
+
|
|
86
|
+
if (typeof password === 'string') {
|
|
87
|
+
password = bitArray.ui8_to_ba(utf8.toBytes(password));
|
|
88
|
+
}
|
|
89
|
+
if (typeof salt === 'string') {
|
|
90
|
+
salt = bitArray.ui8_to_ba(utf8.toBytes(salt));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const Prf = Prff || hmac;
|
|
94
|
+
const prf = new Prf.fn(password);
|
|
95
|
+
let out = [];
|
|
96
|
+
|
|
97
|
+
for (let k = 1; 32 * out.length < (length || 1); k++) {
|
|
98
|
+
let u = prf.encrypt(bitArray.concat(salt, [k]));
|
|
99
|
+
let ui = u;
|
|
100
|
+
for (let i = 1; i < count; i++) {
|
|
101
|
+
ui = prf.encrypt(ui);
|
|
102
|
+
for (let j = 0; j < ui.length; j++) {
|
|
103
|
+
u[j] ^= ui[j];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
out = out.concat(u);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (length) {
|
|
110
|
+
out = bitArray.clamp(out, length);
|
|
111
|
+
}
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
derive.derive = derive;
|
|
116
|
+
derive.MIN_RECOMMENDED_COUNT = MIN_RECOMMENDED_COUNT;
|
|
117
|
+
derive.DEFAULT_COUNT = DEFAULT_COUNT;
|
|
118
|
+
return derive;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# `poly1305.js` — RFC interop conformance
|
|
2
|
+
|
|
3
|
+
> **STATUS: RFC interop — outside NIST/CAVP validation.**
|
|
4
|
+
> Poly1305 is not a FIPS 140-3 approved MAC (NIST/SP 800-38B
|
|
5
|
+
> retains CMAC, NIST/FIPS 198-1 retains HMAC). Coverage is exclusively
|
|
6
|
+
> RFC 8439 (IETF) — no published NIST ACVP vector. Poly1305 is
|
|
7
|
+
> nonetheless mandated by TLS 1.3 (RFC 8446 §B.4 ChaCha20-Poly1305), QUIC
|
|
8
|
+
> (RFC 9001), Noise, WireGuard, Signal, OpenSSH.
|
|
9
|
+
|
|
10
|
+
## Standards
|
|
11
|
+
|
|
12
|
+
- **Primary**: **RFC 8439** — *ChaCha20 and Poly1305 for IETF
|
|
13
|
+
Protocols* (June 2018, obsoletes RFC 7539). §2.5 *The Poly1305
|
|
14
|
+
Algorithm*, §2.5.2 *Poly1305 Example and Test Vector*, §A.3 (11
|
|
15
|
+
additional vectors).
|
|
16
|
+
- **Origin**: Bernstein 2005 — *The Poly1305-AES message-authentication
|
|
17
|
+
code*. RFC 8439 uses the one-time MAC variant without an AES key (IETF
|
|
18
|
+
variant: 32-byte key = `r ‖ s`, with `r` clamped).
|
|
19
|
+
|
|
20
|
+
## Implemented algorithm
|
|
21
|
+
|
|
22
|
+
`poly1305.factory()` exposes the Poly1305 one-time MAC (disposable
|
|
23
|
+
32-byte key, typically derived from a ChaCha20 keystream, see RFC 8439
|
|
24
|
+
§2.6). Public API (`Uint8Array`):
|
|
25
|
+
|
|
26
|
+
- `mac(key, msg)` → 16-byte tag, or `false` if key ≠ 32 bytes.
|
|
27
|
+
`r` clamping per RFC 8439 §2.5.1:
|
|
28
|
+
`r[3], r[7], r[11], r[15] &= 15`; `r[4], r[8], r[12] &= 252`.
|
|
29
|
+
- `verify(key, msg, tag)` → `true | false`. Constant-time comparison
|
|
30
|
+
via `bitArray.equal` or accumulated XOR.
|
|
31
|
+
|
|
32
|
+
BigInt implementation (modulo p = 2¹³⁰−5).
|
|
33
|
+
|
|
34
|
+
## Test coverage
|
|
35
|
+
|
|
36
|
+
### Built-in official vectors
|
|
37
|
+
|
|
38
|
+
| Source | Reference | Test | Property verified |
|
|
39
|
+
|---|---|---|---|
|
|
40
|
+
| RFC 8439 §2.5.2 | example "Cryptographic Forum..." | `§2.5.2 example` | byte-exact KAT tag |
|
|
41
|
+
| RFC 8439 §A.3 #1 | all-zero | `§A.3 #1 all-zero key/msg` | tag=0 |
|
|
42
|
+
| RFC 8439 §A.3 #2 | r=0, s set, msg "Any submission..." (375 bytes) | `§A.3 #2 r=0, s set` | tag = s (Poly1305 degenerates into addition) |
|
|
43
|
+
| RFC 8439 §A.3 #3 | r set, s=0, same msg | `§A.3 #3 r set, s=0` | KAT — verifies the pure polynomial term |
|
|
44
|
+
| RFC 8439 §A.3 #4 | "'Twas brillig..." | `§A.3 #4 long msg` | multi-block KAT, 159 bytes |
|
|
45
|
+
| RFC 8439 §A.3 #5 | r=02..00, msg=ff..ff (16) | `§A.3 #5 carry test` | tag=03..00 — single-block carry |
|
|
46
|
+
| RFC 8439 §A.3 #6 | s=ff..ff, msg=02..00 | `§A.3 #6 carry test: 2nd carry` | tag=03..00 — add-s carry |
|
|
47
|
+
| RFC 8439 §A.3 #7 | rolling carry over 48 bytes | `§A.3 #7 rolling carry` | tag=05..00 |
|
|
48
|
+
| RFC 8439 §A.3 #8 | alternating bits, 48 bytes | `§A.3 #8 alternating bits` | tag=00..00 |
|
|
49
|
+
| RFC 8439 §A.3 #9 | r=02..00, msg=fdff..ff | `§A.3 #9 r set, msg=fdff..` | tag=faff..ff |
|
|
50
|
+
| RFC 8439 §A.3 #10 | crossing 2¹³⁰ boundary, 64 bytes | `§A.3 #10 carry-out clamping` | tag=14..55.. (high-low split) |
|
|
51
|
+
| RFC 8439 §A.3 #11 | crossing boundary again (48 bytes) | `§A.3 #11 carry-out clamping bis` | tag=13..00 |
|
|
52
|
+
| Pre-existing | positive verify | `verify accepts correct tag` | true |
|
|
53
|
+
| Extended | negative verify (16 positions) | `verify rejects tampered tag (every byte position)` | false on every XOR |
|
|
54
|
+
| Extended | tampered msg verify | `verify rejects tampered message` | false |
|
|
55
|
+
| Extended | wrong-size verify | `verify rejects tag of wrong length` | false on 15 + 17 bytes |
|
|
56
|
+
| Edge | empty msg | `empty message produces tag = s` | tag = key low half s |
|
|
57
|
+
| Edge | 1-byte msg | `1-byte message (sub-block padding)` | deterministic tag + verify |
|
|
58
|
+
| Edge | 16-byte boundary | `exactly 16-byte boundary` | deterministic tag + verify |
|
|
59
|
+
| Edge | key size rejection | `rejects non-32-byte key` | false on 31 + 33 bytes |
|
|
60
|
+
|
|
61
|
+
### Security properties tested
|
|
62
|
+
|
|
63
|
+
- [x] **Full RFC 8439 §A.3 conformance** — 11/11 byte-exact KAT
|
|
64
|
+
vectors (degenerate r=0/s=0 cases, single-block carry,
|
|
65
|
+
multi-block carry, crossing 2¹³⁰).
|
|
66
|
+
- [x] **Constant-time tag comparison** — `verify` rejects via a
|
|
67
|
+
comparison with no early-return; tested via 16 XOR mutations.
|
|
68
|
+
- [x] **§2.5.1 r clamping** — implicit in every byte-exact KAT;
|
|
69
|
+
without correct clamping, no vector would pass.
|
|
70
|
+
- [x] **Edge cases** — empty message (tag=s), 1-byte sub-block, exact
|
|
71
|
+
16-byte boundary.
|
|
72
|
+
- [x] **key/tag length validation** — early return false on 31, 33,
|
|
73
|
+
15, 17 bytes.
|
|
74
|
+
- [x] **No `throw`** — `console.warn` + `return false` (reviewed
|
|
75
|
+
lines 51-78).
|
|
76
|
+
- [ ] **Reuse of disposable `r,s`** — Poly1305 loses all security
|
|
77
|
+
guarantees if `(r,s)` is reused across messages. **Out of module
|
|
78
|
+
scope**: protection is the responsibility of the AEAD wrapper
|
|
79
|
+
ChaCha20-Poly1305 (see mode/chacha20poly1305.js, which derives a
|
|
80
|
+
distinct `(r,s)` per ChaCha20 nonce).
|
|
81
|
+
- [ ] **Strict constant-time (BigInt)** — modular operations on
|
|
82
|
+
native Node/Bun BigInt; not formally CT but the algorithm's
|
|
83
|
+
structure (no data-dependent branch in the hot path) limits
|
|
84
|
+
the leak.
|
|
85
|
+
|
|
86
|
+
## FIPS 140-3 conformance
|
|
87
|
+
|
|
88
|
+
| Requirement | Status | Evidence |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| NIST-approved algorithm | ❌ N/A | Poly1305 outside FIPS 198-1 / SP 800-38B |
|
|
91
|
+
| RFC 8439 conformance | ✅ | 12 KAT vectors (1× §2.5.2 + 11× §A.3) |
|
|
92
|
+
| Constant-time tag verify | ✅ | 16 XOR mutations rejected |
|
|
93
|
+
| Parameter validation | ✅ | early return false |
|
|
94
|
+
| No `throw` | ✅ | `console.warn` + return false |
|
|
95
|
+
|
|
96
|
+
## Known limitations
|
|
97
|
+
|
|
98
|
+
- **Outside NIST scope** — no ACVP vector. Validation = RFC 8439.
|
|
99
|
+
- **One-time MAC**: security depends on the uniqueness of `(r,s)` per
|
|
100
|
+
message. Our module enforces nothing — caller responsibility or
|
|
101
|
+
AEAD wrapper.
|
|
102
|
+
- **BigInt not formally constant-time**: see P3 above.
|
|
103
|
+
|
|
104
|
+
## Cross references
|
|
105
|
+
|
|
106
|
+
- Module: [`hash/poly1305.js`](./poly1305.js)
|
|
107
|
+
- Tests: [`hash/poly1305.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/hash/poly1305.test.js) — 21 tests (was 5 before this iteration)
|
|
108
|
+
- RFC 8439: [`https://datatracker.ietf.org/doc/html/rfc8439`](https://datatracker.ietf.org/doc/html/rfc8439)
|
|
109
|
+
- Associated stream cipher: [`../cipher/chacha20.js`](../cipher/chacha20.js) — see [chacha20.acvp.md](../cipher/chacha20.acvp.md)
|
|
110
|
+
- AEAD wrapper: [`../mode/chacha20poly1305.js`](../mode/chacha20poly1305.js) — see [chacha20poly1305.acvp.md](../mode/chacha20poly1305.acvp.md) (upcoming)
|
|
111
|
+
- Overall conformance: [`../NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|