@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,129 @@
|
|
|
1
|
+
# `gcm.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **NIST SP 800-38D** — *Recommendation for Block Cipher
|
|
6
|
+
Modes of Operation: Galois/Counter Mode (GCM) and GMAC*.
|
|
7
|
+
- **Secondary**: **RFC 5288** (TLS), **RFC 4106** (IPsec), **RFC 4543**
|
|
8
|
+
(GMAC), **RFC 7518 §4.7** (JOSE A*-GCM-KW) — interoperability;
|
|
9
|
+
McGrew-Viega vectors.
|
|
10
|
+
- **ACVP draft**: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
11
|
+
- **Vectors**:
|
|
12
|
+
- `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-GCM-1.0/`
|
|
13
|
+
- `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-GMAC-1.0/`
|
|
14
|
+
|
|
15
|
+
## Implemented algorithm
|
|
16
|
+
|
|
17
|
+
GCM (SP 800-38D §7): combines **GCTR** (CTR with a 32-bit counter;
|
|
18
|
+
increment modulo 2^32) + **GHASH** (GF(2^128) multiplication under `p(x) =
|
|
19
|
+
x^128 + x^7 + x^2 + x + 1`, constant `R = 0xE1000000…`). Subkey `H =
|
|
20
|
+
E_K(0^128)`; pre-block `J0` computed via the 96-bit fast path (`IV || 0x00000001`)
|
|
21
|
+
or via GHASH for ivLen ≠ 96. PRF: 128-bit block cipher (`encrypt(block)`),
|
|
22
|
+
**decrypt not required** (GCM only ever encrypts counters).
|
|
23
|
+
|
|
24
|
+
API: `encrypt(prf, pt, iv, aad, tlen)` → `{ ct, tag }`; `decrypt(prf,
|
|
25
|
+
ct, iv, aad, tag, tlen)` → `pt | false` (plaintext is never released on
|
|
26
|
+
an invalid tag; `console.error('CORRUPT:')`). GMAC: `gmac(prf, aad, iv,
|
|
27
|
+
tlen)` / `gmacVerify(prf, aad, iv, tag, tlen)`. Nonce safeguard:
|
|
28
|
+
`nonceTracker(prf)` (in-process Set of seen IVs, refuses duplicates).
|
|
29
|
+
|
|
30
|
+
## Test coverage
|
|
31
|
+
|
|
32
|
+
### Integrated official vectors
|
|
33
|
+
|
|
34
|
+
| Source | Reference | Test (`describe` / `test`) | Property verified |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| McGrew-Viega §B | TC 1-6, 13-14 | `AES-128-GCM, McGrew-Viega test case 1..6` + `AES-256-GCM TC 13/14` | KAT byte-exact + round-trip + GHASH-J0 (TC 5/6) |
|
|
37
|
+
| McGrew-Viega §B | TC 5 (64-bit IV) + TC 6 (480-bit IV) | `non-96-bit IV uses GHASH-derived J0` | alternate J0 code path |
|
|
38
|
+
| **McGrew-Viega §B (D1)** | TC 7-12 (AES-192) | `AES-192-GCM, test case 7..12` | KAT byte-exact for AES-192 × {empty, single block, multi-block, AAD, 96/64/480-bit IV}. Cross-checked reference against Node `createCipheriv('aes-192-gcm')` (= OpenSSL libcrypto). |
|
|
39
|
+
| **McGrew-Viega §B (D1)** | TC 15-18 (AES-256 extended) | `AES-256-GCM, test case 15..18` | KAT byte-exact extending AES-256 coverage (previously limited to TC 13/14 = empty + single block) to TC 15-18 = full multi-block + AAD + 64/480-bit IV. |
|
|
40
|
+
| **ACVP-AES-GCM-1.0** | AFT encrypt 30/30 (tg 1, 2) | `AFT encrypt` | KAT byte-exact ct + tag (ivLen 96/120, payloadLen 0/120, aadLen 0/120, tagLen 32/128) |
|
|
41
|
+
| **ACVP-AES-GCM-1.0** | AFT decrypt 30/30 (tg 3, 4) | `AFT decrypt` | Pass/fail labels honored (10 fail / 30 = `{ corrupt ct/tag/iv/aad }` rejected) |
|
|
42
|
+
| **ACVP-AES-GMAC-1.0** | AFT encrypt 30/30 (tg 1, 2) | `gmac AFT encrypt` | GMAC tag byte-exact via `gcm.gmac(prf, aad, iv, tlen)` |
|
|
43
|
+
| **ACVP-AES-GMAC-1.0** | AFT decrypt 30/30 (tg 3, 4) | `gmac AFT decrypt` | `gmacVerify` returns exact pass/fail labels |
|
|
44
|
+
|
|
45
|
+
#### AFT integration strategy
|
|
46
|
+
|
|
47
|
+
ACVP-AES-GCM-1.0 and ACVP-AES-GMAC-1.0 are **compact** (60 + 60 tests,
|
|
48
|
+
4 testGroups each) → **full 100 % integration**. The encrypt groups
|
|
49
|
+
are exhaustive (30 vectors each); the decrypt groups
|
|
50
|
+
include `testPassed=false` cases (10 GCM / 7 GMAC) that explicitly
|
|
51
|
+
validate rejection of forged tags.
|
|
52
|
+
|
|
53
|
+
### Security properties tested
|
|
54
|
+
|
|
55
|
+
- [x] **GHASH (GF(2^128) multiplication)** — covered by every vector
|
|
56
|
+
with `aadLen > 0` or `payloadLen > 0`.
|
|
57
|
+
- [x] **GCTR (counter incremented mod 2^32)** — exercised by all
|
|
58
|
+
payloadLen > 0 (≥ 2 blocks).
|
|
59
|
+
- [x] **J0 fast path (96-bit IV)** — `ivLen=96` vectors (3 GCM
|
|
60
|
+
testGroups + 2 GMAC) + McGrew-Viega TC 1-4.
|
|
61
|
+
- [x] **J0 GHASH-derived (ivLen ≠ 96)** — `ivLen=120` vectors (3
|
|
62
|
+
GCM testGroups + 2 GMAC) + McGrew-Viega TC 5/6.
|
|
63
|
+
- [x] **32/128-bit tag truncation** — all ACVP combinations +
|
|
64
|
+
`truncated tags 96-bit (TLS-style)` test.
|
|
65
|
+
- [x] **AAD-only (GMAC)** — 60 dedicated GMAC vectors.
|
|
66
|
+
- [x] **Authentication failure handling** — 10 ACVP `testPassed=false`
|
|
67
|
+
cases (corrupt ct/tag/iv/aad) + 3 handcrafted tests (`tampered ciphertext`,
|
|
68
|
+
`tampered AAD`, `tampered tag`). The plaintext is **never** released.
|
|
69
|
+
- [x] **`nonceTracker` — duplicate detection** — accepts the first IV, rejects
|
|
70
|
+
reuse (handcrafted test).
|
|
71
|
+
- [x] **Empty payload + empty AAD** — McGrew-Viega TC 1 + GCM tg 1 (15
|
|
72
|
+
`payloadLen=0` vectors).
|
|
73
|
+
- [x] **Tag length bounds** — `rejects tag length below 32 bits`,
|
|
74
|
+
`rejects tag length above 128 bits`.
|
|
75
|
+
- [x] **Empty IV rejection** — `rejects empty IV` (`iv must not be empty`).
|
|
76
|
+
- [x] **Constant-time tag compare** — `bitArray.equal` (accumulated XOR,
|
|
77
|
+
no short-circuit) — proof: 10 ACVP fail cases rejected.
|
|
78
|
+
- [ ] **Side-channel on `_gmult`** — constant bit-by-bit iteration
|
|
79
|
+
(128 iterations); no secret-dependent branching dependency
|
|
80
|
+
(`if ((X[w] >>> b) & 1)` operates on the secret X but the timing
|
|
81
|
+
remains identical because the XORs are conditionally added).
|
|
82
|
+
Conservative note: a `Karatsuba` or *bit-slicing* implementation
|
|
83
|
+
would be preferable outside JS.
|
|
84
|
+
- [ ] **Cross-process nonce reuse** — `nonceTracker` is
|
|
85
|
+
in-process only; persistence/distribution is the caller's concern.
|
|
86
|
+
|
|
87
|
+
## FIPS 140-3 conformance
|
|
88
|
+
|
|
89
|
+
| Requirement | Status | Evidence |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| Approved algorithm | ✅ | SP 800-38D + ACVP-AES-GCM-1.0 + ACVP-AES-GMAC-1.0 |
|
|
92
|
+
| Validated parameter sizes | ✅ | **AES-128**: 60 ACVP-AES-GCM-1.0 + McGrew-Viega TC 1-6. **AES-192**: McGrew-Viega TC 7-12 (D1). **AES-256**: McGrew-Viega TC 13-18 (D1). All 3 keyLen × {96-bit IV, 64-bit IV, 480-bit IV} × {empty AAD, non-empty AAD} × {payload 0/16/60/64 bytes} covered byte-exact. |
|
|
93
|
+
| KAT power-on / self-test | ✅ | McGrew-Viega + 120 ACVP executed on every `bun test` |
|
|
94
|
+
| CT comparisons (if secret) | ✅ | `bitArray.equal` (no early exit) |
|
|
95
|
+
| No `throw` / timing leak | ✅ | Reviewed: `console.warn`/`console.error` + `return false` |
|
|
96
|
+
| Plaintext not released on invalid tag | ✅ | `decrypt` returns `false` BEFORE the final `_gctr`; tested by `testPassed=false` |
|
|
97
|
+
|
|
98
|
+
## Known limitations
|
|
99
|
+
|
|
100
|
+
- ~~**AES-192 / AES-256 outside integrated ACVP**~~ ✅ **Iteration D1** —
|
|
101
|
+
**McGrew-Viega TC 7-12 (AES-192) + TC 15-18 (AES-256 extended)** added.
|
|
102
|
+
The supplied ACVP-AES-GCM-1.0 suite still only covers `keyLen=128`
|
|
103
|
+
(60 tests), but McGrew-Viega §B is the historical **canonical source**
|
|
104
|
+
for GCM (referenced by RFC 5288 §A, RFC 4106 §8, RFC 5647) and remains
|
|
105
|
+
the standard authority for 192/256 pending publication of a possible
|
|
106
|
+
ACVP-AES-GCM-2.0. The values are cross-checked against Node
|
|
107
|
+
`createCipheriv('aes-{192,256}-gcm')` (= OpenSSL libcrypto).
|
|
108
|
+
- **MCT not specified** by the ACVP for GCM/GMAC.
|
|
109
|
+
- **`nonceTracker` not scalable**: in-process Set; `seenNonces` exposed
|
|
110
|
+
for manual purging. Recommendation: a deterministic out-of-process
|
|
111
|
+
counter for long-horizon deployments.
|
|
112
|
+
- **`payloadLen` bounded by ACVP**: 0..120 bits (compact test).
|
|
113
|
+
McGrew-Viega extends up to 480 bits. For the theoretical GCM limit
|
|
114
|
+
(`2^32 − 2` blocks ≈ 64 GiB), no stress test (out of budget).
|
|
115
|
+
- **`_gmult` bit-by-bit**: 128 iterations per multiplication, slow in
|
|
116
|
+
pure JS (~50 µs/multiplication). Optimization via precomputed tables
|
|
117
|
+
(Karatsuba M0/M4/M8 bytes) out of scope.
|
|
118
|
+
- **96-bit random nonce ≠ deterministic**: SP 800-38D §8.2.1 vs §8.2.2.
|
|
119
|
+
The ACVP vectors use `ivGen=external, ivGenMode=8.2.2`
|
|
120
|
+
(deterministic, handled by the caller). The module accepts any IV;
|
|
121
|
+
the generation contract is delegated.
|
|
122
|
+
|
|
123
|
+
## Cross-references
|
|
124
|
+
|
|
125
|
+
- Module: [`mode/gcm.js`](./gcm.js)
|
|
126
|
+
- Tests: [`mode/gcm.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/mode/gcm.test.js) — 156 tests (143 baseline + 13 McGrew-Viega TC 7-12 / 15-18 [D1])
|
|
127
|
+
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
128
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-GCM-1.0/` + `ACVP-AES-GMAC-1.0/`
|
|
129
|
+
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview AES-GCM mode of operation (NIST SP 800-38D).
|
|
7
|
+
*
|
|
8
|
+
* Galois/Counter Mode is an authenticated cipher that combines a 32-bit
|
|
9
|
+
* counter mode (GCTR) with an authentication tag computed in GF(2^128) via
|
|
10
|
+
* the GHASH function. Used by TLS (RFC 5288), IPsec (RFC 4106), JWA AES-GCM
|
|
11
|
+
* key wrap (RFC 7518), and many others.
|
|
12
|
+
*
|
|
13
|
+
* The PRF must be a 16-byte block cipher with `encrypt(block)` (decryption
|
|
14
|
+
* support is not needed - GCM only ever encrypts the counter stream and
|
|
15
|
+
* the hash subkey H = E_K(0^128)).
|
|
16
|
+
*
|
|
17
|
+
* `encrypt` returns `{ ct, tag }`. `decrypt` returns the plaintext on
|
|
18
|
+
* successful tag verification, or `false` (with a console.error) when the
|
|
19
|
+
* tag is rejected - the plaintext is **never** released for a failed tag.
|
|
20
|
+
*
|
|
21
|
+
* IV may be any length; 96 bits is the recommended fast path (J0 is
|
|
22
|
+
* built directly without GHASH per NIST §7.1).
|
|
23
|
+
*
|
|
24
|
+
* **GHASH timing caveat** - `_gmult` uses the bit-by-bit right-shift
|
|
25
|
+
* algorithm (NIST SP 800-38D §6.3 Algorithm 1). The inner conditional XOR
|
|
26
|
+
* branches on individual bits of `X` (the hash input, derived from
|
|
27
|
+
* ciphertext + AAD - **not** the key directly). The side channel is
|
|
28
|
+
* therefore bounded to ciphertext/AAD bits, which are typically already
|
|
29
|
+
* public, but the implementation is **NOT strictly constant-time**. A
|
|
30
|
+
* 4-bit table-driven variant (Algorithm 4) would be both faster and
|
|
31
|
+
* branchless ; left as a future optimisation. For very large payloads
|
|
32
|
+
* (multi-MB) prefer WebCrypto AES-GCM (hardware PCLMULQDQ) when available.
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
import { bitArray } from '../utils/bitArray.js';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Process-local nonce-uniqueness guard returned by `gcm.nonceTracker()`.
|
|
40
|
+
* @typedef {object} GcmNonceTracker
|
|
41
|
+
* @property {Set<string>} seenNonces Set of hex-encoded IVs already used (inspectable).
|
|
42
|
+
* @property {(plaintext: number[], iv: number[], adata?: number[], tlen?: number) => ({ct: number[], tag: number[]}|false)} encrypt Encrypt, rejecting reused IVs.
|
|
43
|
+
* @property {(ciphertext: number[], iv: number[], adata: number[], tag: number[], tlen?: number) => (number[]|false)} decrypt Decrypt (does not consult the seen set).
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Object returned by `gcm.factory()`. bitArrays are `number[]` (32-bit words).
|
|
48
|
+
* @typedef {object} GcmAPI
|
|
49
|
+
* @property {(prf: {encrypt: Function}, plaintext: number[], iv: number[], adata?: number[], tlen?: number) => ({ct: number[], tag: number[]}|false)} encrypt Authenticated encryption.
|
|
50
|
+
* @property {(prf: {encrypt: Function}, ciphertext: number[], iv: number[], adata: number[], tag: number[], tlen?: number) => (number[]|false)} decrypt Authenticated decryption; `false` on tag mismatch.
|
|
51
|
+
* @property {(prf: {encrypt: Function}, adata: number[], iv: number[], tlen?: number) => (number[]|false)} gmac GMAC tag over AAD only.
|
|
52
|
+
* @property {(prf: {encrypt: Function}, adata: number[], iv: number[], tag: number[], tlen?: number) => boolean} gmacVerify Constant-time GMAC verification.
|
|
53
|
+
* @property {(prf: {encrypt: Function}) => GcmNonceTracker} nonceTracker Wrap a PRF in an in-process nonce-uniqueness guard.
|
|
54
|
+
* @property {{ ghash: (H: number[], data: number[]) => number[], gctr: (prf: {encrypt: Function}, icb: number[], data: number[]) => number[] }} _internal Internal primitives (KAT tests only).
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export const gcm = {
|
|
58
|
+
name: 'gcm',
|
|
59
|
+
version: '1.0.0',
|
|
60
|
+
type: 'fw.crypto.mode',
|
|
61
|
+
dependencies: ['bitArray'],
|
|
62
|
+
deps: [bitArray],
|
|
63
|
+
|
|
64
|
+
/** @returns {GcmAPI} */
|
|
65
|
+
factory(bitArray) {
|
|
66
|
+
|
|
67
|
+
const _R0 = 0xE1000000 | 0;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Multiply two 128-bit elements in GF(2^128) under the GCM reduction
|
|
71
|
+
* polynomial p(x) = x^128 + x^7 + x^2 + x + 1, using the right-shift
|
|
72
|
+
* algorithm (NIST SP 800-38D §6.3, Algorithm 1).
|
|
73
|
+
*/
|
|
74
|
+
function _gmult(X, Y) {
|
|
75
|
+
const Z = [0, 0, 0, 0];
|
|
76
|
+
const V = [Y[0], Y[1], Y[2], Y[3]];
|
|
77
|
+
for (let i = 0; i < 128; i++) {
|
|
78
|
+
const w = i >>> 5;
|
|
79
|
+
const b = 31 - (i & 31);
|
|
80
|
+
if ((X[w] >>> b) & 1) {
|
|
81
|
+
Z[0] ^= V[0]; Z[1] ^= V[1]; Z[2] ^= V[2]; Z[3] ^= V[3];
|
|
82
|
+
}
|
|
83
|
+
const lsb = V[3] & 1;
|
|
84
|
+
V[3] = (V[3] >>> 1) | ((V[2] & 1) << 31);
|
|
85
|
+
V[2] = (V[2] >>> 1) | ((V[1] & 1) << 31);
|
|
86
|
+
V[1] = (V[1] >>> 1) | ((V[0] & 1) << 31);
|
|
87
|
+
V[0] = V[0] >>> 1;
|
|
88
|
+
if (lsb) V[0] ^= _R0;
|
|
89
|
+
}
|
|
90
|
+
return Z;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* GHASH_H(data) where `data` length must be a multiple of 128 bits.
|
|
95
|
+
* NIST SP 800-38D §6.4.
|
|
96
|
+
*/
|
|
97
|
+
function _ghash(H, data) {
|
|
98
|
+
let Y0 = 0, Y1 = 0, Y2 = 0, Y3 = 0;
|
|
99
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
100
|
+
Y0 ^= data[i];
|
|
101
|
+
Y1 ^= data[i + 1];
|
|
102
|
+
Y2 ^= data[i + 2];
|
|
103
|
+
Y3 ^= data[i + 3];
|
|
104
|
+
const out = _gmult([Y0, Y1, Y2, Y3], H);
|
|
105
|
+
Y0 = out[0]; Y1 = out[1]; Y2 = out[2]; Y3 = out[3];
|
|
106
|
+
}
|
|
107
|
+
return [Y0, Y1, Y2, Y3];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Zero-pad a bitArray (right) to the next 128-bit block boundary. */
|
|
111
|
+
function _zpad128(data) {
|
|
112
|
+
const u8 = bitArray.ba_to_ui8(data);
|
|
113
|
+
const padBytes = (16 - (u8.length % 16)) % 16;
|
|
114
|
+
if (padBytes === 0) return bitArray.ui8_to_ba(u8);
|
|
115
|
+
const padded = new Uint8Array(u8.length + padBytes);
|
|
116
|
+
padded.set(u8, 0);
|
|
117
|
+
return bitArray.ui8_to_ba(padded);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Encode a non-negative integer as a 64-bit big-endian length (2 words). */
|
|
121
|
+
function _len64(bits) {
|
|
122
|
+
const lo = bits | 0;
|
|
123
|
+
const hi = Math.floor(bits / 0x100000000) | 0;
|
|
124
|
+
return [hi, lo];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* GCTR_K(ICB, X) - counter mode where `inc` increments only the
|
|
129
|
+
* rightmost 32 bits modulo 2^32. NIST SP 800-38D §6.5.
|
|
130
|
+
*/
|
|
131
|
+
function _gctr(prf, icb, data) {
|
|
132
|
+
const dataBits = bitArray.bitLength(data);
|
|
133
|
+
if (dataBits === 0) return [];
|
|
134
|
+
|
|
135
|
+
const u8 = bitArray.ba_to_ui8(data);
|
|
136
|
+
const padBytes = (16 - (u8.length % 16)) % 16;
|
|
137
|
+
let buf;
|
|
138
|
+
if (padBytes === 0) {
|
|
139
|
+
buf = bitArray.ui8_to_ba(u8);
|
|
140
|
+
} else {
|
|
141
|
+
const padded = new Uint8Array(u8.length + padBytes);
|
|
142
|
+
padded.set(u8, 0);
|
|
143
|
+
buf = bitArray.ui8_to_ba(padded);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const cb = [icb[0], icb[1], icb[2], icb[3]];
|
|
147
|
+
for (let i = 0; i < buf.length; i += 4) {
|
|
148
|
+
const e = prf.encrypt(cb);
|
|
149
|
+
buf[i] = (buf[i] ^ e[0]) | 0;
|
|
150
|
+
buf[i + 1] = (buf[i + 1] ^ e[1]) | 0;
|
|
151
|
+
buf[i + 2] = (buf[i + 2] ^ e[2]) | 0;
|
|
152
|
+
buf[i + 3] = (buf[i + 3] ^ e[3]) | 0;
|
|
153
|
+
cb[3] = (cb[3] + 1) | 0;
|
|
154
|
+
}
|
|
155
|
+
return bitArray.clamp(buf, dataBits);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Compute J0 (the pre-counter block) per NIST SP 800-38D §7.1.
|
|
160
|
+
*/
|
|
161
|
+
function _j0(H, iv) {
|
|
162
|
+
const ivBits = bitArray.bitLength(iv);
|
|
163
|
+
if (ivBits === 96) {
|
|
164
|
+
const ivBytes = bitArray.ba_to_ui8(iv);
|
|
165
|
+
const out = new Uint8Array(16);
|
|
166
|
+
out.set(ivBytes, 0);
|
|
167
|
+
out[15] = 1;
|
|
168
|
+
return bitArray.ui8_to_ba(out);
|
|
169
|
+
}
|
|
170
|
+
const padded = _zpad128(iv);
|
|
171
|
+
const tail = [0, 0].concat(_len64(ivBits));
|
|
172
|
+
return _ghash(H, padded.concat(tail));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function _incCb(cb) {
|
|
176
|
+
return [cb[0], cb[1], cb[2], (cb[3] + 1) | 0];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function _authTag(prf, H, J0, adata, ciphertext, tlen) {
|
|
180
|
+
const aBits = bitArray.bitLength(adata);
|
|
181
|
+
const cBits = bitArray.bitLength(ciphertext);
|
|
182
|
+
const ghashInput = _zpad128(adata)
|
|
183
|
+
.concat(_zpad128(ciphertext))
|
|
184
|
+
.concat(_len64(aBits))
|
|
185
|
+
.concat(_len64(cBits));
|
|
186
|
+
const S = _ghash(H, ghashInput);
|
|
187
|
+
return bitArray.clamp(_gctr(prf, J0, S), tlen);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function _validateInputs(iv, tlen) {
|
|
191
|
+
if (bitArray.bitLength(iv) === 0) {
|
|
192
|
+
console.warn('[crypto] INVALID: gcm: iv must not be empty');
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
if (tlen < 32 || tlen > 128) {
|
|
196
|
+
console.warn('[crypto] INVALID: gcm: tag length must be 32..128 bits');
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Authenticated encryption.
|
|
204
|
+
*
|
|
205
|
+
* 🚨 NONCE REUSE IS CATASTROPHIC. Encrypting two distinct messages
|
|
206
|
+
* with the same `(prf, iv)` pair leaks the GHASH authentication key
|
|
207
|
+
* H, allowing forgery of arbitrary ciphertexts under the same key,
|
|
208
|
+
* and reveals the XOR of the two plaintexts. The CALLER MUST
|
|
209
|
+
* guarantee `iv` uniqueness for every `encrypt` invocation under a
|
|
210
|
+
* given key - typically via a 96-bit random IV (≥ 2^32 messages
|
|
211
|
+
* require deterministic counter discipline) or a deterministic
|
|
212
|
+
* counter. See `gcm.nonceTracker(prf)` for an in-process duplicate
|
|
213
|
+
* detector that wraps `encrypt`/`decrypt`.
|
|
214
|
+
*
|
|
215
|
+
* @param {{encrypt:Function}} prf 16-byte block PRF.
|
|
216
|
+
* @param {Array} plaintext bitArray of any bit length.
|
|
217
|
+
* @param {Array} iv bitArray IV (any length, 96 bits is the fast path).
|
|
218
|
+
* @param {Array} [adata=[]] Additional authenticated data (bitArray).
|
|
219
|
+
* @param {number} [tlen=128] Tag length in bits (32..128).
|
|
220
|
+
* @returns {{ct:Array, tag:Array} | false}
|
|
221
|
+
*/
|
|
222
|
+
function encrypt(prf, plaintext, iv, adata, tlen) {
|
|
223
|
+
adata = adata || [];
|
|
224
|
+
tlen = tlen === undefined ? 128 : tlen;
|
|
225
|
+
if (!_validateInputs(iv, tlen)) return false;
|
|
226
|
+
|
|
227
|
+
const H = prf.encrypt([0, 0, 0, 0]);
|
|
228
|
+
const J0 = _j0(H, iv);
|
|
229
|
+
const ct = _gctr(prf, _incCb(J0), plaintext);
|
|
230
|
+
const tag = _authTag(prf, H, J0, adata, ct, tlen);
|
|
231
|
+
return { ct, tag };
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Authenticated decryption.
|
|
236
|
+
* @param {{encrypt:Function}} prf 16-byte block PRF.
|
|
237
|
+
* @param {Array} ciphertext bitArray.
|
|
238
|
+
* @param {Array} iv bitArray IV.
|
|
239
|
+
* @param {Array} adata Additional authenticated data (may be empty array).
|
|
240
|
+
* @param {Array} tag Authentication tag (bitArray).
|
|
241
|
+
* @param {number} [tlen] Tag length in bits (32..128). Defaults to bitLength(tag).
|
|
242
|
+
* @returns {Array|false} The plaintext, or `false` on tag mismatch.
|
|
243
|
+
*/
|
|
244
|
+
function decrypt(prf, ciphertext, iv, adata, tag, tlen) {
|
|
245
|
+
adata = adata || [];
|
|
246
|
+
tlen = tlen === undefined ? bitArray.bitLength(tag) : tlen;
|
|
247
|
+
if (!_validateInputs(iv, tlen)) return false;
|
|
248
|
+
|
|
249
|
+
const H = prf.encrypt([0, 0, 0, 0]);
|
|
250
|
+
const J0 = _j0(H, iv);
|
|
251
|
+
const expected = _authTag(prf, H, J0, adata, ciphertext, tlen);
|
|
252
|
+
|
|
253
|
+
if (!bitArray.equal(bitArray.clamp(tag, tlen), expected)) {
|
|
254
|
+
console.error('[crypto] CORRUPT: gcm: authentication tag mismatch');
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
return _gctr(prf, _incCb(J0), ciphertext);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* GMAC - authenticate `adata` only (empty plaintext).
|
|
262
|
+
* GMAC is the special case of GCM where the plaintext is empty and
|
|
263
|
+
* only the additional authenticated data is bound to the tag
|
|
264
|
+
* (NIST SP 800-38D §3, RFC 4543).
|
|
265
|
+
* @param {{encrypt:Function}} prf
|
|
266
|
+
* @param {Array} adata bitArray data to authenticate.
|
|
267
|
+
* @param {Array} iv bitArray IV.
|
|
268
|
+
* @param {number} [tlen=128] Tag length in bits.
|
|
269
|
+
* @returns {Array|false} Authentication tag.
|
|
270
|
+
*/
|
|
271
|
+
function gmac(prf, adata, iv, tlen) {
|
|
272
|
+
const r = encrypt(prf, [], iv, adata, tlen);
|
|
273
|
+
return r === false ? false : r.tag;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function gmacVerify(prf, adata, iv, tag, tlen) {
|
|
277
|
+
tlen = tlen === undefined ? bitArray.bitLength(tag) : tlen;
|
|
278
|
+
const expected = gmac(prf, adata, iv, tlen);
|
|
279
|
+
if (expected === false) return false;
|
|
280
|
+
return bitArray.equal(bitArray.clamp(tag, tlen), expected);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Wrap a PRF in an in-process nonce-uniqueness guard. The returned
|
|
285
|
+
* `{ encrypt, decrypt, seenNonces }` rejects any `encrypt` call
|
|
286
|
+
* whose IV has already been used with this wrapper (including
|
|
287
|
+
* across encrypt+decrypt). `seenNonces` is exposed for inspection;
|
|
288
|
+
* mutate it only if you understand the consequences.
|
|
289
|
+
*
|
|
290
|
+
* Note: this is a process-local check only. Persistent or
|
|
291
|
+
* distributed nonce uniqueness must be enforced by the caller.
|
|
292
|
+
*
|
|
293
|
+
* @param {{encrypt:Function}} prf
|
|
294
|
+
* @returns {{encrypt:Function, decrypt:Function, seenNonces:Set<string>}}
|
|
295
|
+
*/
|
|
296
|
+
function nonceTracker(prf) {
|
|
297
|
+
const seen = new Set();
|
|
298
|
+
const key = (iv) => {
|
|
299
|
+
const u8 = bitArray.ba_to_ui8(iv);
|
|
300
|
+
let s = '';
|
|
301
|
+
for (let i = 0; i < u8.length; i++) {
|
|
302
|
+
s += (u8[i] < 16 ? '0' : '') + u8[i].toString(16);
|
|
303
|
+
}
|
|
304
|
+
return s;
|
|
305
|
+
};
|
|
306
|
+
return {
|
|
307
|
+
seenNonces: seen,
|
|
308
|
+
encrypt(plaintext, iv, adata, tlen) {
|
|
309
|
+
const k = key(iv);
|
|
310
|
+
if (seen.has(k)) {
|
|
311
|
+
console.error('[crypto] CORRUPT: gcm: nonce reuse rejected by tracker');
|
|
312
|
+
return false;
|
|
313
|
+
}
|
|
314
|
+
seen.add(k);
|
|
315
|
+
return encrypt(prf, plaintext, iv, adata, tlen);
|
|
316
|
+
},
|
|
317
|
+
decrypt(ciphertext, iv, adata, tag, tlen) {
|
|
318
|
+
return decrypt(prf, ciphertext, iv, adata, tag, tlen);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return /** @type {GcmAPI} */ (/** @type {any} */ ({
|
|
324
|
+
encrypt,
|
|
325
|
+
decrypt,
|
|
326
|
+
gmac,
|
|
327
|
+
gmacVerify,
|
|
328
|
+
nonceTracker,
|
|
329
|
+
// Internal primitives - exposed for KAT tests only. Not API.
|
|
330
|
+
_internal: { ghash: _ghash, gctr: _gctr }
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# `kw.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **NIST SP 800-38F** — *Recommendation for Block Cipher
|
|
6
|
+
Modes of Operation: Methods for Key Wrapping*.
|
|
7
|
+
- **Secondary**:
|
|
8
|
+
- **RFC 3394** — *AES Key Wrap Algorithm* (KW)
|
|
9
|
+
- **RFC 5649** — *AES Key Wrap with Padding Algorithm* (KWP)
|
|
10
|
+
- **ACVP draft**: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
11
|
+
- **Vectors**:
|
|
12
|
+
- `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-KW-1.0/`
|
|
13
|
+
- `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-KWP-1.0/`
|
|
14
|
+
|
|
15
|
+
## Implemented algorithm
|
|
16
|
+
|
|
17
|
+
KW (SP 800-38F §6.2): *Wrapping function* `W` over 6 rounds (n+1 64-bit
|
|
18
|
+
semi-blocks, n ≥ 2) — chained via register `A` initialized to
|
|
19
|
+
`0xA6A6A6A6A6A6A6A6` (RFC 3394 IV). Integrity check after unwrap
|
|
20
|
+
by comparing `A` to the expected IV.
|
|
21
|
+
|
|
22
|
+
KWP (SP 800-38F §6.3 / RFC 5649): extension of KW for arbitrary length
|
|
23
|
+
≥ 1 byte. Extended IV = `0xA65959A6 || MLI₃₂` (plaintext length in
|
|
24
|
+
bytes, big-endian). Zero-padding up to the next multiple of 8 bytes.
|
|
25
|
+
Single-semi-block fast path (≤ 8 bytes of data) = a single AES
|
|
26
|
+
encryption (RFC 5649 §4.1). Constant-time verification: IV check +
|
|
27
|
+
MLI ∈ [maxLen-7, maxLen] + zero padding bytes — all accumulated in a
|
|
28
|
+
single `bad` word before the final branch (no short-circuit).
|
|
29
|
+
|
|
30
|
+
API: `wrap(prf, pt)` / `unwrap(prf, ct)` / `wrapPad(prf, pt)` /
|
|
31
|
+
`unwrapPad(prf, ct)` → `Uint8Array | false`. PRF = AES instantiated with
|
|
32
|
+
`full=true` (exposes both `encrypt` AND `decrypt`).
|
|
33
|
+
|
|
34
|
+
## Test coverage
|
|
35
|
+
|
|
36
|
+
### Integrated official vectors
|
|
37
|
+
|
|
38
|
+
| Source | Reference | Test (`describe` / `test`) | Property verified |
|
|
39
|
+
|---|---|---|---|
|
|
40
|
+
| RFC 3394 §4.1 | KW AES-128 | `RFC 3394 §4.1 — Wrap 128-bit key with 128-bit KEK` | KAT byte-exact + round-trip |
|
|
41
|
+
| RFC 3394 §4.2 | KW AES-192 | `RFC 3394 §4.2` | KAT byte-exact + unwrap |
|
|
42
|
+
| RFC 3394 §4.3 | KW AES-256 | `RFC 3394 §4.3` | KAT byte-exact wrap |
|
|
43
|
+
| RFC 3394 §4.4 | KW 192/192 | `RFC 3394 §4.4` | KAT byte-exact wrap |
|
|
44
|
+
| RFC 3394 §4.6 | KW 256/256 | `RFC 3394 §4.6` | KAT byte-exact wrap |
|
|
45
|
+
| RFC 5649 §6 | KWP TV1 (20 B) | `KWP test vector 1` | KAT byte-exact + round-trip |
|
|
46
|
+
| RFC 5649 §6 | KWP TV2 (7 B, single semi-block) | `KWP test vector 2` | single-semi-block fast path |
|
|
47
|
+
| **ACVP-AES-KW-1.0** | AFT encrypt cipher (tg 1-18) | `kw - ACVP-AES-KW-1.0 / AFT encrypt` | KAT byte-exact ct (54/1800 sub-sample: AES-128/192/256 × 6 payloadLen × 3 vectors) |
|
|
48
|
+
| **ACVP-AES-KW-1.0** | AFT decrypt cipher (tg 37-54) | `kw - ACVP-AES-KW-1.0 / AFT decrypt` | Pass/fail labels (12 `testPassed=false` cases rejected) |
|
|
49
|
+
| **ACVP-AES-KWP-1.0** | AFT encrypt cipher (tg 1-18) | `kwp - ACVP-AES-KWP-1.0 / AFT encrypt` | KAT byte-exact ct (54/1800 sub-sample, single-semi-block fast path included via payloadLen=8) |
|
|
50
|
+
| **ACVP-AES-KWP-1.0** | AFT decrypt cipher (tg 37-54) | `kwp - ACVP-AES-KWP-1.0 / AFT decrypt` | Pass/fail labels (10 `testPassed=false` cases rejected) |
|
|
51
|
+
|
|
52
|
+
#### AFT sub-sampling strategy
|
|
53
|
+
|
|
54
|
+
Each ACVP suite (`ACVP-AES-KW-1.0`, `ACVP-AES-KWP-1.0`) exposes
|
|
55
|
+
**7200 tests** organized into 72 testGroups:
|
|
56
|
+
|
|
57
|
+
- 36 `direction=encrypt` groups (18 cipher + 18 inverse) × 100 tcId
|
|
58
|
+
- 36 `direction=decrypt` groups (18 cipher + 18 inverse) × 100 tcId
|
|
59
|
+
|
|
60
|
+
**Filtering**: `kwCipher='cipher'` only (direct `W` variant;
|
|
61
|
+
the `inverse` variant uses `CIPH_K^-1` inside `W` and is not
|
|
62
|
+
implemented — see *Known limitations*).
|
|
63
|
+
|
|
64
|
+
**Sub-sample**: `[first, middle, last]` per group → 18 enc + 18
|
|
65
|
+
dec = 36 × 3 = **108 vectors / 1800 per suite** (≈ 6 % of the
|
|
66
|
+
cipher direction, ≈ 3 % of the total). Covers every
|
|
67
|
+
`(keyLen, payloadLen)` × `(encrypt, decrypt)` combination.
|
|
68
|
+
|
|
69
|
+
**Negative cases** integrated in full (12 KW + 10 KWP `testPassed=false`)
|
|
70
|
+
— explicit validation of rejection via the IV check (KW) or via
|
|
71
|
+
the constant-time IV+length+padding check (KWP).
|
|
72
|
+
|
|
73
|
+
### Security properties tested
|
|
74
|
+
|
|
75
|
+
- [x] **`W` wrapping function over 6 rounds** — covered by all
|
|
76
|
+
vectors (216 ACVP + 7 RFC).
|
|
77
|
+
- [x] **IV chaining (non-CMAC integrity)** — IV `0xA6×8` (KW) and
|
|
78
|
+
`0xA65959A6 || MLI` (KWP) validated by comparison after unwrap.
|
|
79
|
+
- [x] **Constant-time integrity check (KWP)** — `bad` accumulated over IV +
|
|
80
|
+
MLI bounds + padding bytes; no short-circuit. Proof: 10 ACVP
|
|
81
|
+
`testPassed=false` cases (corrupt ct, non-zero padding, MLI out of
|
|
82
|
+
bounds) all rejected via `false`.
|
|
83
|
+
- [x] **KWP single-semi-block fast path** — RFC 5649 TV2 (7 B) + ACVP
|
|
84
|
+
`payloadLen=8` (3 testGroups × 3 vectors).
|
|
85
|
+
- [x] **Zero padding (KWP)** — covered by `payloadLen` non-multiple of
|
|
86
|
+
64 bits (1280, 2152, 3040 bits).
|
|
87
|
+
- [x] **AES-128/192/256** — 3 keyLens × encrypt/decrypt.
|
|
88
|
+
- [x] **Tampering rejection** — handcrafted `wrapped[0] ^= 1` (KW + KWP)
|
|
89
|
+
+ 22 ACVP `testPassed=false` cases. Plaintext never released.
|
|
90
|
+
- [x] **Rejection of n=1 semi-block in KW** — `RFC 3394 requires at least 2
|
|
91
|
+
semi-blocks` (handcrafted test).
|
|
92
|
+
- [x] **Rejection of empty input in KWP** — `kwp: plaintext must not be empty`.
|
|
93
|
+
- [x] **Rejection of non-multiple-of-8 input in KW** — `kw: plaintext length
|
|
94
|
+
must be a positive multiple of 8 bytes`.
|
|
95
|
+
- [x] **`kwCipher=inverse` variant** ✅ **Iteration D2** — explicit reject.
|
|
96
|
+
Exports `wrapInverseCipher()` / `unwrapInverseCipher()` return
|
|
97
|
+
`false` + a typed `NOT-IMPLEMENTED` warning. Avoids any silent use
|
|
98
|
+
of the SP 800-38F §6.3 variant (`CIPH_K⁻¹` in the wrap direction,
|
|
99
|
+
rare outside embedded TPM). If documented need arises, the
|
|
100
|
+
implementation will need to be added and separately audited.
|
|
101
|
+
- [x] **Rejection of TDES (and other non-AES)** ✅ **Iteration D2** — `_checkBlockSize`
|
|
102
|
+
rejects any PRF with `blockSize !== 16` (TDES = 8 bytes). SP 800-131A
|
|
103
|
+
§2.4 deprecates 3DES since 2024; SP 800-38F §6.2 mandates AES.
|
|
104
|
+
- [ ] **Side-channel on AES** — delegated to `aes.js`.
|
|
105
|
+
|
|
106
|
+
## FIPS 140-3 conformance
|
|
107
|
+
|
|
108
|
+
| Requirement | Status | Evidence |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| Approved algorithm | ✅ | SP 800-38F §6.2 (KW) + §6.3 (KWP) |
|
|
111
|
+
| Validated parameter sizes | ✅ | AES-128/192/256 × 6 payloadLen (KW: 128..4096 / KWP: 8..4096) |
|
|
112
|
+
| KAT power-on / self-test | ✅ | RFC 3394 + RFC 5649 + 216 ACVP executed on every `bun test` |
|
|
113
|
+
| CT comparisons (if secret) | ✅ | `unwrapPad` accumulates IV + length + padding with no short-circuit |
|
|
114
|
+
| No `throw` / timing leak | ✅ | Reviewed: `console.warn`/`console.error` + `return false` |
|
|
115
|
+
| Plaintext not released on failed integrity | ✅ | `unwrap`/`unwrapPad` return `false` BEFORE any exposure; tested by 22 `testPassed=false` cases |
|
|
116
|
+
|
|
117
|
+
## Known limitations
|
|
118
|
+
|
|
119
|
+
- **`kwCipher=inverse` variant not implemented**: SP 800-38F §6.3
|
|
120
|
+
allows using the inverse function `CIPH_K⁻¹` in the wrap direction.
|
|
121
|
+
Our `kw.js` only implements the `cipher` variant (forward `W`), which
|
|
122
|
+
is the dominant form in TLS/PKCS#8/JOSE. The ACVP provides 3600
|
|
123
|
+
`inverse` vectors per suite (50 % of the total) which are filtered
|
|
124
|
+
out. **Iteration D2**: added `wrapInverseCipher()` / `unwrapInverseCipher()`
|
|
125
|
+
exports that return `false` + `console.warn('NOT-IMPLEMENTED')` to
|
|
126
|
+
prevent any silent use by a consumer that believes it has inverse KW-AE.
|
|
127
|
+
- **No asymmetric KW-AE/KW-AD**: the `wrap`/`unwrap`
|
|
128
|
+
functions use the AES instance in the correct direction (CIPH_K for
|
|
129
|
+
encrypt, CIPH_K^-1 for decrypt) — the caller must build the PRF
|
|
130
|
+
with `full=true`.
|
|
131
|
+
- **6 % sub-sampling**: 5292 unplayed vectors per suite (out of 5400
|
|
132
|
+
cipher-direction). The anchors cover `[first, middle, last]`
|
|
133
|
+
per testGroup; each `(keyLen, payloadLen)` combination has 6
|
|
134
|
+
vectors integrated (3 enc + 3 dec).
|
|
135
|
+
- **No massive payloadLen stress**: ACVP caps at 4096 bits. The
|
|
136
|
+
theoretical KWP limit (`2^32 − 1` bytes ≈ 4 GiB) is not tested.
|
|
137
|
+
- **No MCT specified by the ACVP for KW/KWP** (a limitation of the standard).
|
|
138
|
+
|
|
139
|
+
## Cross-references
|
|
140
|
+
|
|
141
|
+
- Module: [`mode/kw.js`](./kw.js)
|
|
142
|
+
- Tests: [`mode/kw.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/mode/kw.test.js) — 240 tests (233 baseline + 7 iteration D2: KW-AE inverse explicit reject + TDES guards)
|
|
143
|
+
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
144
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-KW-1.0/` + `ACVP-AES-KWP-1.0/`
|
|
145
|
+
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|