@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,75 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview SHA-512/256 (FIPS 180-4 §5.3.6.2).
|
|
7
|
+
*
|
|
8
|
+
* Truncated SHA-512 variant: same compression function as SHA-512 (cf. sha512.js)
|
|
9
|
+
* but with a distinct initial hash value (IV) and a 256-bit final digest taken
|
|
10
|
+
* from the first 32 bytes of the 64-byte SHA-512 internal state.
|
|
11
|
+
*
|
|
12
|
+
* Block size: 1024 bits (same as SHA-512 - required for HMAC-SHA-512/256).
|
|
13
|
+
*
|
|
14
|
+
* SHA-512/256 is significantly faster than SHA-256 on 64-bit platforms while
|
|
15
|
+
* providing the same 256-bit security level. Recommended by NIST in
|
|
16
|
+
* SP 800-185 §4 for KMAC and elsewhere when 256-bit output is needed and
|
|
17
|
+
* 64-bit performance matters.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { sha512 } from './sha512.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Streaming SHA-512/256 hasher instance (truncated SHA-512; bitArray = `number[]` of 32-bit words).
|
|
25
|
+
* @typedef {object} Sha512_256Hasher
|
|
26
|
+
* @property {number} blockSize Block size in bits (1024).
|
|
27
|
+
* @property {number[]} _init IV (16 × 32-bit halves = 8 × 64-bit lanes).
|
|
28
|
+
* @property {number} _outWords Number of 32-bit words retained in the digest (8).
|
|
29
|
+
* @property {number[]} _key Round constants.
|
|
30
|
+
* @property {() => Sha512_256Hasher} reset Reset internal state; returns `this`.
|
|
31
|
+
* @property {(data: number[]|string) => (Sha512_256Hasher|false)} update Absorb a bitArray or UTF-8 string; returns `this`, or `false` on > 2^53-1 bit overflow.
|
|
32
|
+
* @property {() => number[]} finalize Pad and emit the 256-bit digest as a bitArray (8 words).
|
|
33
|
+
* @property {(words: ArrayLike<number>) => void} _block Compress one 32-word (1024-bit) block.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Object returned by `sha512_256.factory()`.
|
|
38
|
+
* @typedef {object} Sha512_256API
|
|
39
|
+
* @property {new (hash?: Sha512_256Hasher) => Sha512_256Hasher} fn Streaming hasher constructor (optional arg clones an existing instance).
|
|
40
|
+
* @property {(data: number[]|string) => number[]} hash One-shot hash; returns the 256-bit digest as a bitArray.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
export const sha512_256 = {
|
|
44
|
+
name: 'sha512_256',
|
|
45
|
+
version: '1.0.0',
|
|
46
|
+
type: 'fw.crypto.hash',
|
|
47
|
+
dependencies: ['sha512'],
|
|
48
|
+
deps: [sha512],
|
|
49
|
+
|
|
50
|
+
/** @returns {Sha512_256API} */
|
|
51
|
+
factory(sha512) {
|
|
52
|
+
// FIPS 180-4 §5.3.6.2 - IV for SHA-512/256 (8 × 64-bit, 16 × 32-bit halves).
|
|
53
|
+
// H_0..H_7 = SHA-512(ASCII("SHA-512/256")) using IV = SHA-512_IV ⊕ a5...a5.
|
|
54
|
+
// Derived via the spec procedure and cross-checked against OpenSSL's
|
|
55
|
+
// crypto/sha/sha512.c sha512_256_init constants.
|
|
56
|
+
const _INIT_512_256 = [
|
|
57
|
+
0x22312194, 0xfc2bf72c, // H_0
|
|
58
|
+
0x9f555fa3, 0xc84c64c2, // H_1
|
|
59
|
+
0x2393b86b, 0x6f53b151, // H_2
|
|
60
|
+
0x96387719, 0x5940eabd, // H_3
|
|
61
|
+
0x96283ee2, 0xa88effe3, // H_4
|
|
62
|
+
0xbe5e1e25, 0x53863992, // H_5
|
|
63
|
+
0x2b0199fc, 0x2c85b8aa, // H_6
|
|
64
|
+
0x0eb72ddc, 0x81c52ca2 // H_7
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
// outWords = 8 → 8 × 32-bit = 256 bits.
|
|
68
|
+
const inner = sha512._internal.makeSha(_INIT_512_256, 8);
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
fn: inner.fn,
|
|
72
|
+
hash: inner.hash
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# `cbc.js` — ACVP / NIST conformance
|
|
2
|
+
|
|
3
|
+
## Standards
|
|
4
|
+
|
|
5
|
+
- **Primary**: **NIST SP 800-38A** — *Recommendation for Block Cipher Modes
|
|
6
|
+
of Operation: Methods and Techniques*, §6.2 (CBC).
|
|
7
|
+
- **Secondary**: **RFC 3602** (test vectors); FIPS 197 for the underlying
|
|
8
|
+
AES block cipher.
|
|
9
|
+
- **ACVP draft**: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
10
|
+
- **Vectors**: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-CBC-1.0/`
|
|
11
|
+
|
|
12
|
+
## Implemented algorithm
|
|
13
|
+
|
|
14
|
+
CBC (SP 800-38A §6.2): `C[i] = AES_K(P[i] XOR C[i-1])`; `C[-1] = IV`. Block
|
|
15
|
+
PRF supplied by the caller (`{ encrypt, decrypt }`), block-size = 128 bits.
|
|
16
|
+
**Does not perform padding** — the caller must deliver a message that is a
|
|
17
|
+
multiple of 16 bytes (use `pad/strip` around it for PKCS#7). Returns `false`
|
|
18
|
+
on IV ≠ 128 bits, a non-block-aligned message, or a PRF without `decrypt`
|
|
19
|
+
(cipher built with `full=false`). State: none (pure functions).
|
|
20
|
+
|
|
21
|
+
## Test coverage
|
|
22
|
+
|
|
23
|
+
### Integrated official vectors
|
|
24
|
+
|
|
25
|
+
| Source | Reference | Test (`describe` / `test`) | Property verified |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| RFC 3602 §4.1 | TC #1 (16 B / 1 block) | `RFC 3602 §4 vector #1` | KAT byte-exact + round-trip AES-128 |
|
|
28
|
+
| RFC 3602 §4.2 | TC #2 (32 B / 2 blocks) | `RFC 3602 §4 vector #2` | KAT byte-exact + round-trip AES-128 |
|
|
29
|
+
| RFC 3602 §4.3 | TC #3 (48 B / 3 blocks) | `RFC 3602 §4 vector #3` | KAT byte-exact, multi-block CBC chain |
|
|
30
|
+
| RFC 3602 §4.4 | TC #4 (64 B / 4 blocks) | `RFC 3602 §4 vector #4` | KAT byte-exact, multi-block CBC chain |
|
|
31
|
+
| **ACVP-AES-CBC-1.0** | AFT encrypt 72 / 1284 (12 testGroups) | `AFT encrypt` | KAT byte-exact (AES-128/192/256, ptLen 128..1280 bits) |
|
|
32
|
+
| **ACVP-AES-CBC-1.0** | AFT decrypt 72 / 1284 (12 testGroups) | `AFT decrypt` | KAT byte-exact (AES-128/192/256, ctLen 128..1280 bits) |
|
|
33
|
+
|
|
34
|
+
#### AFT sub-sampling strategy
|
|
35
|
+
|
|
36
|
+
ACVP-AES-CBC-1.0 exposes **42 testGroups / 2156 tests**: 36 AFT (12 per
|
|
37
|
+
direction × 3 keyLen) and 6 MCT. AFT strategy:
|
|
38
|
+
|
|
39
|
+
- **Single-block groups (KAT/MMT)**: `[first, middle, last]` → 3 tcId.
|
|
40
|
+
- **Multi-block groups (tgId 25-30)**: **ALL 10 tcId** (ptLen ∈ {128,
|
|
41
|
+
256, 384, 512, 640, 768, 896, 1024, 1152, 1280} bits). This is the only
|
|
42
|
+
subset that exercises the CBC chain over ≥ 2 blocks; full coverage.
|
|
43
|
+
- **"Extended" groups (tgId 31-36)**: 2 tcId each → all taken.
|
|
44
|
+
- **Total integrated**: **144 / 2156** AFT (≈ 6.7 %).
|
|
45
|
+
|
|
46
|
+
### Security properties tested
|
|
47
|
+
|
|
48
|
+
- [x] **Multi-block CBC chain** — 60 multi-block ACVP vectors (tgId 25-30,
|
|
49
|
+
up to 10 blocks / 1280 bits) + RFC 3602 #2/#3/#4. Any chaining error
|
|
50
|
+
(XOR on the wrong output, wrong previous block) deviates byte-exact.
|
|
51
|
+
- [x] **AES-128 + AES-192 + AES-256** — covered by 3 keyLens × 2 directions.
|
|
52
|
+
- [x] **Encrypt + decrypt** — separate directions in the ACVP: no
|
|
53
|
+
trivial self-verification, each ct/pt is validated independently.
|
|
54
|
+
- [x] **Round-trip** — RFC 3602 #1-#4 (encrypt(decrypt(x)) == x).
|
|
55
|
+
- [x] **Non-standard IV** — `iv must be 128 bits` (rejection `false` +
|
|
56
|
+
`console.warn`).
|
|
57
|
+
- [x] **Non-aligned message** — `plaintext must be a whole number of 16-byte
|
|
58
|
+
blocks` (rejection `false`).
|
|
59
|
+
- [x] **PRF without decrypt** — `cipher built with full=true` required
|
|
60
|
+
(otherwise `false`).
|
|
61
|
+
- [ ] **Padding (PKCS#7) interop** — N/A: `cbc.js` operates on an already
|
|
62
|
+
padded message (wrapper's responsibility). Padding is tested separately
|
|
63
|
+
in `pad.test.js`.
|
|
64
|
+
- [ ] **Side-channel on PRF** — delegated to `aes.js` (the CBC module is
|
|
65
|
+
data-independent at the XOR/branching level).
|
|
66
|
+
|
|
67
|
+
## FIPS 140-3 conformance
|
|
68
|
+
|
|
69
|
+
| Requirement | Status | Evidence |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| Approved algorithm | ✅ | SP 800-38A §6.2 + ACVP-AES-CBC-1.0 |
|
|
72
|
+
| Validated parameter sizes | ✅ | AES-128/192/256 × ptLen 128..1280 bits |
|
|
73
|
+
| KAT power-on / self-test | ✅ | RFC 3602 + 144 AFT executed on every `bun test` |
|
|
74
|
+
| CT comparisons (if secret) | N/A | Deterministic mode with no secret branch; CT guaranteed by AES |
|
|
75
|
+
| No `throw` / timing leak | ✅ | Reviewed: `console.warn` + `return false` |
|
|
76
|
+
|
|
77
|
+
## Known limitations
|
|
78
|
+
|
|
79
|
+
- ~~**MCT not integrated**~~ ✅ **Iteration D4** — implemented.
|
|
80
|
+
6 MCT testGroups from ACVP-AES-CBC-1.0 (37-42, encrypt + decrypt × AES-128/192/256)
|
|
81
|
+
integrated. Each MCT runs 100 outer × 1000 inner AES-CBC ops with:
|
|
82
|
+
1. Per-iter key transition (`Key[j+1] = Key[j] XOR last(keyLen, CT[998]||CT[999])`).
|
|
83
|
+
2. `IV[j+1] = CT[999]` and `PT[0]_{j+1} = CT[998]`.
|
|
84
|
+
Byte-exact assertions on `resultsArray[0]` AND `resultsArray[99]` (input +
|
|
85
|
+
final state) — any drift on any of the 100 outer iters breaks iter99.
|
|
86
|
+
Cost: ~6 s per MCT (×6 MCTs = ~36 s additional).
|
|
87
|
+
- **Other ACVP CBC modes** (`ACVP-AES-CBC-CS{1,2,3}-1.0` — Ciphertext
|
|
88
|
+
Stealing) not integrated: `cbc.js` does not implement CTS (rarely used
|
|
89
|
+
mode, delegated to a separate module if needed).
|
|
90
|
+
- **AFT sub-sampling**: 6.7 % of the total. The 2012 unplayed vectors
|
|
91
|
+
share the same code paths as the 144 retained ones (XOR + PRF call
|
|
92
|
+
unchanged). Representativeness is guaranteed by: (a) coverage of the 3
|
|
93
|
+
keyLens, (b) full coverage of the 10 multi-block ptLens, (c) 3
|
|
94
|
+
vectors per testGroup for the single-block groups.
|
|
95
|
+
- **No IV-reuse test**: CBC with a repeated IV under the same K causes an
|
|
96
|
+
XOR leak of the first blocks; the caller's responsibility (the module
|
|
97
|
+
does not keep an IV tracker unlike `gcm.js`).
|
|
98
|
+
|
|
99
|
+
## Cross-references
|
|
100
|
+
|
|
101
|
+
- Module: [`mode/cbc.js`](./cbc.js)
|
|
102
|
+
- Tests: [`mode/cbc.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/mode/cbc.test.js) — 163 tests (157 baseline + 6 MCT [D4]: 3 encrypt + 3 decrypt × AES-128/192/256, byte-exact iter0 + iter99)
|
|
103
|
+
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
104
|
+
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/ACVP-AES-CBC-1.0/`
|
|
105
|
+
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview AES-CBC mode of operation (NIST SP 800-38A).
|
|
7
|
+
*
|
|
8
|
+
* Cipher Block Chaining XORs each plaintext block with the previous
|
|
9
|
+
* ciphertext block (or the IV, for the first block) before encrypting it.
|
|
10
|
+
* Decryption reverses the chain. The PRF must expose **both** `encrypt` and
|
|
11
|
+
* `decrypt` (i.e. an AES instance built with `full = true`).
|
|
12
|
+
*
|
|
13
|
+
* This module operates on 16-byte blocks (PRF block size = 128 bits) and
|
|
14
|
+
* does not handle padding - callers should run `pad.pad` / `pad.strip`
|
|
15
|
+
* around it (or use a higher-level wrapper) when the message length is not
|
|
16
|
+
* a multiple of 16 bytes.
|
|
17
|
+
*
|
|
18
|
+
* **Authentication contract - encrypt-then-MAC required.**
|
|
19
|
+
* CBC alone is malleable : bit-flipping attacks and padding-oracle attacks
|
|
20
|
+
* (Vaudenay 2002, Lucky-13, POODLE) recover plaintext when the caller leaks
|
|
21
|
+
* any signal - timing, side-channel, or distinct error codes - about pad
|
|
22
|
+
* validity. **Always** compose CBC with an independent MAC over the IV ‖
|
|
23
|
+
* ciphertext (encrypt-then-MAC, RFC 7366) and verify the MAC in constant
|
|
24
|
+
* time **before** running `decrypt` or attempting unpad. Prefer an AEAD
|
|
25
|
+
* construction (`mode/gcm`, `mode/chacha20poly1305`) for new code - CBC is
|
|
26
|
+
* kept here only for protocols that mandate it.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { bitArray } from '../utils/bitArray.js';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Object returned by `cbc.factory()`. bitArrays are `number[]` (32-bit words).
|
|
34
|
+
* @typedef {object} CbcAPI
|
|
35
|
+
* @property {(prf: {encrypt: Function}, plaintext: number[], iv: number[]) => (number[]|false)} encrypt Encrypt in CBC mode.
|
|
36
|
+
* @property {(prf: {decrypt: Function}, ciphertext: number[], iv: number[]) => (number[]|false)} decrypt Decrypt in CBC mode.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
export const cbc = {
|
|
40
|
+
name: 'cbc',
|
|
41
|
+
version: '1.0.0',
|
|
42
|
+
type: 'fw.crypto.mode',
|
|
43
|
+
dependencies: ['bitArray'],
|
|
44
|
+
deps: [bitArray],
|
|
45
|
+
|
|
46
|
+
/** @returns {CbcAPI} */
|
|
47
|
+
factory(bitArray) {
|
|
48
|
+
|
|
49
|
+
function _checkBlockAligned(data, label) {
|
|
50
|
+
if (data.length % 4 !== 0 || bitArray.bitLength(data) !== data.length * 32) {
|
|
51
|
+
console.warn(`[crypto] INVALID: cbc: ${label} must be a whole number of 16-byte blocks`);
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function _checkIv(iv) {
|
|
58
|
+
if (bitArray.bitLength(iv) !== 128) {
|
|
59
|
+
console.warn('[crypto] INVALID: cbc: iv must be 128 bits');
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Encrypt in CBC mode.
|
|
67
|
+
* @param {{encrypt:Function}} prf 16-byte block PRF (e.g. AES instance).
|
|
68
|
+
* @param {Array} plaintext bitArray of 16-byte blocks (length multiple of 4 words).
|
|
69
|
+
* @param {Array} iv 128-bit bitArray IV.
|
|
70
|
+
* @returns {Array|false}
|
|
71
|
+
*/
|
|
72
|
+
function encrypt(prf, plaintext, iv) {
|
|
73
|
+
if (!_checkIv(iv)) return false;
|
|
74
|
+
if (!_checkBlockAligned(plaintext, 'plaintext')) return false;
|
|
75
|
+
|
|
76
|
+
const l = plaintext.length;
|
|
77
|
+
const out = new Array(l);
|
|
78
|
+
let p0 = iv[0], p1 = iv[1], p2 = iv[2], p3 = iv[3];
|
|
79
|
+
|
|
80
|
+
for (let i = 0; i < l; i += 4) {
|
|
81
|
+
const block = [
|
|
82
|
+
plaintext[i] ^ p0,
|
|
83
|
+
plaintext[i + 1] ^ p1,
|
|
84
|
+
plaintext[i + 2] ^ p2,
|
|
85
|
+
plaintext[i + 3] ^ p3
|
|
86
|
+
];
|
|
87
|
+
const enc = prf.encrypt(block);
|
|
88
|
+
out[i] = enc[0];
|
|
89
|
+
out[i + 1] = enc[1];
|
|
90
|
+
out[i + 2] = enc[2];
|
|
91
|
+
out[i + 3] = enc[3];
|
|
92
|
+
p0 = enc[0]; p1 = enc[1]; p2 = enc[2]; p3 = enc[3];
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Decrypt in CBC mode.
|
|
99
|
+
* @param {{decrypt:Function}} prf 16-byte block PRF with decrypt support.
|
|
100
|
+
* @param {Array} ciphertext bitArray of 16-byte blocks.
|
|
101
|
+
* @param {Array} iv 128-bit bitArray IV.
|
|
102
|
+
* @returns {Array|false}
|
|
103
|
+
*/
|
|
104
|
+
function decrypt(prf, ciphertext, iv) {
|
|
105
|
+
if (!_checkIv(iv)) return false;
|
|
106
|
+
if (!_checkBlockAligned(ciphertext, 'ciphertext')) return false;
|
|
107
|
+
if (typeof prf.decrypt !== 'function') {
|
|
108
|
+
console.warn('[crypto] INVALID: cbc: prf does not expose decrypt (build the cipher with full=true)');
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const l = ciphertext.length;
|
|
113
|
+
const out = new Array(l);
|
|
114
|
+
let p0 = iv[0], p1 = iv[1], p2 = iv[2], p3 = iv[3];
|
|
115
|
+
|
|
116
|
+
for (let i = 0; i < l; i += 4) {
|
|
117
|
+
const c0 = ciphertext[i];
|
|
118
|
+
const c1 = ciphertext[i + 1];
|
|
119
|
+
const c2 = ciphertext[i + 2];
|
|
120
|
+
const c3 = ciphertext[i + 3];
|
|
121
|
+
const dec = prf.decrypt([c0, c1, c2, c3]);
|
|
122
|
+
out[i] = dec[0] ^ p0;
|
|
123
|
+
out[i + 1] = dec[1] ^ p1;
|
|
124
|
+
out[i + 2] = dec[2] ^ p2;
|
|
125
|
+
out[i + 3] = dec[3] ^ p3;
|
|
126
|
+
p0 = c0; p1 = c1; p2 = c2; p3 = c3;
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
encrypt,
|
|
133
|
+
decrypt
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# `chacha20poly1305.js` — RFC interop conformance
|
|
2
|
+
|
|
3
|
+
> **STATUS: RFC interop — outside NIST/CAVP validation.**
|
|
4
|
+
> ChaCha20-Poly1305 is not a FIPS 140-3 approved AEAD (NIST/SP
|
|
5
|
+
> 800-38D retains AES-GCM). Coverage exclusively RFC 8439 (IETF) —
|
|
6
|
+
> no published NIST ACVP vector. Nevertheless mandated by TLS 1.3 (RFC
|
|
7
|
+
> 8446 §B.4 `TLS_CHACHA20_POLY1305_SHA256`), QUIC (RFC 9001), Noise,
|
|
8
|
+
> WireGuard, OpenSSH, Signal, OAuth.
|
|
9
|
+
|
|
10
|
+
## Standards
|
|
11
|
+
|
|
12
|
+
- **Primary**: **RFC 8439** — *ChaCha20 and Poly1305 for IETF
|
|
13
|
+
Protocols* (June 2018, obsoletes RFC 7539). §2.6 *Generating the
|
|
14
|
+
Poly1305 Key Using ChaCha20*, §2.8 *AEAD Construction*, §A.5 (test
|
|
15
|
+
vector decrypt).
|
|
16
|
+
- **Origin**: Adam Langley & Yoav Nir, Bernstein's AEAD integration of
|
|
17
|
+
ChaCha20 + Poly1305.
|
|
18
|
+
|
|
19
|
+
## Implemented algorithm
|
|
20
|
+
|
|
21
|
+
`chacha20poly1305.factory(chacha20, poly1305)` exposes the IETF
|
|
22
|
+
ChaCha20-Poly1305 AEAD (256-bit key, 96-bit nonce, 128-bit tag). Public
|
|
23
|
+
API (`Uint8Array`):
|
|
24
|
+
|
|
25
|
+
- `encrypt(key, nonce, plaintext, aad?)` → `{ ct, tag }` (16-byte
|
|
26
|
+
tag), or `false` if key/nonce has the wrong size.
|
|
27
|
+
- `decrypt(key, nonce, ciphertext, tag, aad?)` → `Uint8Array` (plaintext)
|
|
28
|
+
or `false` if tag verification fails (`console.error CORRUPT`).
|
|
29
|
+
|
|
30
|
+
Internal construction (RFC 8439 §2.8.1):
|
|
31
|
+
1. `polyKey = ChaCha20(key, nonce, 0×64)[0..31]` — counter=0 block.
|
|
32
|
+
2. `ct = ChaCha20(key, nonce, plaintext)` starting at counter=1.
|
|
33
|
+
3. `macInput = aad ‖ pad16 ‖ ct ‖ pad16 ‖ |aad|₈ ‖ |ct|₈` (64-bit
|
|
34
|
+
little-endian lengths).
|
|
35
|
+
4. `tag = Poly1305(polyKey, macInput)`.
|
|
36
|
+
5. Constant-time tag verification on decrypt via `poly1305.verify`.
|
|
37
|
+
|
|
38
|
+
## Test coverage
|
|
39
|
+
|
|
40
|
+
### Integrated official vectors
|
|
41
|
+
|
|
42
|
+
| Source | Reference | Test | Property verified |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| RFC 8439 §2.6.2 | polyKey derivation | `§2.6.2 polyKey derivation` | KAT first 32 bytes of ChaCha20(counter=0) |
|
|
45
|
+
| RFC 8439 §2.8.2 | AEAD example | `§2.8.2 AEAD encrypt KAT` | KAT byte-exact ct + tag |
|
|
46
|
+
| RFC 8439 §2.8.2 | AEAD example | `§2.8.2 AEAD decrypt KAT` | round-trip decrypt byte-exact |
|
|
47
|
+
| RFC 8439 §A.5 | AEAD decrypt fixture | `§A.5 AEAD decrypt KAT` | KAT decrypt byte-exact (different key/nonce/aad/ct/tag, msg "Internet-Drafts...") |
|
|
48
|
+
| Edge | empty pt + AAD | `round-trip with empty plaintext + non-empty AAD` | ct.length=0 + valid tag |
|
|
49
|
+
| Edge | pt + empty AAD | `round-trip with empty AAD + non-empty plaintext` | round-trip OK |
|
|
50
|
+
| Edge | both empty | `round-trip with both empty` | tag = MAC of the length-encoding |
|
|
51
|
+
| Tampering | ct (every position) | `decrypt rejects tampered ciphertext (every byte position)` | false on every XOR |
|
|
52
|
+
| Tampering | tag (16 positions) | `decrypt rejects tampered tag (every byte position)` | false on every XOR |
|
|
53
|
+
| Tampering | aad (every position) | `decrypt rejects tampered AAD (every byte position)` | false on every XOR |
|
|
54
|
+
| Tampering | nonce | `decrypt rejects altered nonce` | false (cross-binding) |
|
|
55
|
+
| Tampering | ct length | `decrypt rejects truncated/appended ciphertext` | false (length-encoding bind) |
|
|
56
|
+
| Validation | reject 31-byte key | `encrypt rejects non-32-byte key` | false |
|
|
57
|
+
| Validation | reject 11-byte nonce | `encrypt rejects non-12-byte nonce` | false |
|
|
58
|
+
| Validation | reject 15/17-byte tag | `decrypt rejects bad-length tag` | false |
|
|
59
|
+
| Counter | counter=1 ChaCha20 | `encrypt uses ChaCha20 counter=1 for keystream` | direct equivalence with `_cc.xor(., 1)` |
|
|
60
|
+
|
|
61
|
+
### Security properties tested
|
|
62
|
+
|
|
63
|
+
- [x] **RFC 8439 §2.8 conformance** — KAT byte-exact ct + tag (§2.8.2)
|
|
64
|
+
+ decrypt KAT (§A.5).
|
|
65
|
+
- [x] **polyKey/keystream domain separation** — explicitly verified:
|
|
66
|
+
polyKey = ChaCha20 counter=0, ct = counter=1.
|
|
67
|
+
- [x] **Length-encoding binding** — ct truncation and appending
|
|
68
|
+
detected (the MAC's `len64le` binding rejects altered lengths).
|
|
69
|
+
- [x] **Exhaustive tampering** — 4 categories (ct, tag, aad, nonce) +
|
|
70
|
+
ct lengths; per-byte coverage on ct/tag/aad.
|
|
71
|
+
- [x] **Constant-time tag comparison** — delegated to `poly1305.verify`
|
|
72
|
+
(see poly1305.acvp.md; accumulated XOR).
|
|
73
|
+
- [x] **key/nonce/tag length validation** — early return false;
|
|
74
|
+
negative tests.
|
|
75
|
+
- [x] **No `throw`** — `console.error CORRUPT` + `return false`
|
|
76
|
+
on tag mismatch (reviewed lines 80-85).
|
|
77
|
+
- [ ] **XChaCha20-Poly1305 (192-bit nonce)** — not implemented
|
|
78
|
+
(draft-irtf-cfrg-xchacha). **P3**.
|
|
79
|
+
- [ ] **Per-(key, nonce) limit** — RFC 8439 §6 documents the limit at
|
|
80
|
+
~2⁶⁴ ChaCha20 blocks per (key, nonce) pair. No runtime guard;
|
|
81
|
+
caller's responsibility. **P3** — could be added as a
|
|
82
|
+
counter.
|
|
83
|
+
- [x] **Nonce-reuse detection** — **Iteration G2**: `nonceTracker(key)`
|
|
84
|
+
exposed (symmetric pattern to `mode/gcm.js:258`). Wraps `encrypt` /
|
|
85
|
+
`decrypt` with a `Set` of seen nonces, reuse → `console.error('[crypto]
|
|
86
|
+
CORRUPT: chacha20poly1305: nonce reuse rejected by tracker')` + `false`.
|
|
87
|
+
Process-local and per-wrapper (no global sharing). Opt-in (no
|
|
88
|
+
breaking change).
|
|
89
|
+
|
|
90
|
+
## FIPS 140-3 conformance
|
|
91
|
+
|
|
92
|
+
| Requirement | Status | Evidence |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| NIST-approved algorithm | ❌ N/A | ChaCha20-Poly1305 outside SP 800-38D |
|
|
95
|
+
| RFC 8439 conformance | ✅ | KAT §2.6.2 + §2.8.2 + §A.5 byte-exact |
|
|
96
|
+
| polyKey/ct domain separation | ✅ | counter=0 vs counter=1 verified |
|
|
97
|
+
| Length-encoding binding | ✅ | ct length tampering rejected |
|
|
98
|
+
| Constant-time tag verify | ✅ | delegated to poly1305.verify |
|
|
99
|
+
| No `throw` | ✅ | `console.error` + return false |
|
|
100
|
+
| Nonce-reuse protection | ✅ (opt-in) | **Iteration G2**: `nonceTracker(key)` wraps encrypt/decrypt with a Set of nonces, reuse → `false` + `CORRUPT` warn |
|
|
101
|
+
|
|
102
|
+
## Known limitations
|
|
103
|
+
|
|
104
|
+
- **Outside NIST scope** — no ACVP vector. Validation = RFC 8439.
|
|
105
|
+
- **No XChaCha20-Poly1305**: see P3 above.
|
|
106
|
+
- ~~**No nonce-reuse tracker**~~ — resolved in G2 (see above).
|
|
107
|
+
|
|
108
|
+
## Cross-references
|
|
109
|
+
|
|
110
|
+
- Module: [`mode/chacha20poly1305.js`](./chacha20poly1305.js)
|
|
111
|
+
- Tests: [`mode/chacha20poly1305.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/mode/chacha20poly1305.test.js) — **23 tests** (including the 5 added in G2: `nonceTracker` opt-in — first-encrypt / reuse rejected / distinct nonces / decrypt does not increment the set / per-wrapper scope; was 6 before the upgrade)
|
|
112
|
+
- RFC 8439: [`https://datatracker.ietf.org/doc/html/rfc8439`](https://datatracker.ietf.org/doc/html/rfc8439)
|
|
113
|
+
- Stream cipher: [`../cipher/chacha20.js`](../cipher/chacha20.js) — see [chacha20.acvp.md](../cipher/chacha20.acvp.md)
|
|
114
|
+
- MAC: [`../hash/poly1305.js`](../hash/poly1305.js) — see [poly1305.acvp.md](../hash/poly1305.acvp.md)
|
|
115
|
+
- Sibling NIST AEAD: [`./gcm.js`](./gcm.js) — see [gcm.acvp.md](./gcm.acvp.md)
|
|
116
|
+
- Overall conformance: [`../NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview ChaCha20-Poly1305 AEAD construction (RFC 8439 §2.8).
|
|
7
|
+
*
|
|
8
|
+
* The Poly1305 one-time key is derived from `ChaCha20(key, nonce, counter=0)`
|
|
9
|
+
* (the first 32 bytes of the keystream block). Encryption uses
|
|
10
|
+
* `counter=1..` for the actual data. The MAC input is constructed as:
|
|
11
|
+
*
|
|
12
|
+
* pad16(AAD) || pad16(ciphertext) || len64_le(AAD) || len64_le(ciphertext)
|
|
13
|
+
*
|
|
14
|
+
* Decryption verifies the tag in constant time and never releases the
|
|
15
|
+
* plaintext on failure (returns `false`).
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { chacha20 } from '../cipher/chacha20.js';
|
|
20
|
+
import { poly1305 } from '../hash/poly1305.js';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Process-local nonce-uniqueness guard returned by `chacha20poly1305.nonceTracker()`.
|
|
24
|
+
* @typedef {object} ChaCha20Poly1305NonceTracker
|
|
25
|
+
* @property {Set<string>} seenNonces Set of hex-encoded nonces already used (inspectable).
|
|
26
|
+
* @property {(nonce: Uint8Array, plaintext: Uint8Array, aad?: Uint8Array) => ({ct: Uint8Array, tag: Uint8Array}|false)} encrypt Encrypt, rejecting reused nonces.
|
|
27
|
+
* @property {(nonce: Uint8Array, ciphertext: Uint8Array, tag: Uint8Array, aad?: Uint8Array) => (Uint8Array|false)} decrypt Decrypt (does not consult the seen set).
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Object returned by `chacha20poly1305.factory()`.
|
|
32
|
+
* @typedef {object} ChaCha20Poly1305API
|
|
33
|
+
* @property {string} name Module name (`'chacha20poly1305'`).
|
|
34
|
+
* @property {(key: Uint8Array, nonce: Uint8Array, plaintext: Uint8Array, aad?: Uint8Array) => ({ct: Uint8Array, tag: Uint8Array}|false)} encrypt AEAD encrypt.
|
|
35
|
+
* @property {(key: Uint8Array, nonce: Uint8Array, ciphertext: Uint8Array, tag: Uint8Array, aad?: Uint8Array) => (Uint8Array|false)} decrypt AEAD decrypt; `false` on tag mismatch.
|
|
36
|
+
* @property {(key: Uint8Array) => ChaCha20Poly1305NonceTracker} nonceTracker Wrap key in an in-process nonce-uniqueness guard.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
export const chacha20poly1305 = {
|
|
40
|
+
name: 'chacha20poly1305',
|
|
41
|
+
version: '1.0.0',
|
|
42
|
+
type: 'fw.crypto.mode',
|
|
43
|
+
dependencies: ['chacha20', 'poly1305'],
|
|
44
|
+
deps: [chacha20, poly1305],
|
|
45
|
+
|
|
46
|
+
/** @returns {ChaCha20Poly1305API} */
|
|
47
|
+
factory(chacha20, poly1305) {
|
|
48
|
+
|
|
49
|
+
function _padTo16(len) {
|
|
50
|
+
return (16 - (len % 16)) % 16;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// RFC 8439 §2.8 mandates a 64-bit little-endian length field for
|
|
54
|
+
// both AAD and ciphertext. `n` is a JS Number here ; for values up
|
|
55
|
+
// to 2^53 (≈ 9 PiB) the `Math.floor(v / 256)` chain is exact. We
|
|
56
|
+
// would lose precision only for payloads ≥ 2^53 bytes, far beyond
|
|
57
|
+
// any realistic in-process buffer, so a BigInt path is unnecessary
|
|
58
|
+
// in practice. The 2^53 boundary is documented here for future
|
|
59
|
+
// hardening if a streaming AEAD ever exceeds it.
|
|
60
|
+
function _len64le(n) {
|
|
61
|
+
const out = new Uint8Array(8);
|
|
62
|
+
let v = n;
|
|
63
|
+
for (let i = 0; i < 8; i++) {
|
|
64
|
+
out[i] = v & 0xff;
|
|
65
|
+
v = Math.floor(v / 256);
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function _polyKey(key, nonce) {
|
|
71
|
+
// First 32 bytes of ChaCha20 keystream at counter=0.
|
|
72
|
+
const zero = new Uint8Array(32);
|
|
73
|
+
return chacha20.xor(key, nonce, zero, 0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _macInput(aad, ct) {
|
|
77
|
+
const aadPad = _padTo16(aad.length);
|
|
78
|
+
const ctPad = _padTo16(ct.length);
|
|
79
|
+
const total = aad.length + aadPad + ct.length + ctPad + 16;
|
|
80
|
+
const buf = new Uint8Array(total);
|
|
81
|
+
let off = 0;
|
|
82
|
+
buf.set(aad, off); off += aad.length + aadPad;
|
|
83
|
+
buf.set(ct, off); off += ct.length + ctPad;
|
|
84
|
+
buf.set(_len64le(aad.length), off); off += 8;
|
|
85
|
+
buf.set(_len64le(ct.length), off);
|
|
86
|
+
return buf;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* AEAD encrypt.
|
|
91
|
+
* @param {Uint8Array} key 32 bytes.
|
|
92
|
+
* @param {Uint8Array} nonce 12 bytes.
|
|
93
|
+
* @param {Uint8Array} plaintext
|
|
94
|
+
* @param {Uint8Array} [aad] Additional authenticated data (default empty).
|
|
95
|
+
* @returns {{ct:Uint8Array, tag:Uint8Array}|false}
|
|
96
|
+
*/
|
|
97
|
+
function encrypt(key, nonce, plaintext, aad) {
|
|
98
|
+
aad = aad || new Uint8Array(0);
|
|
99
|
+
const polyKey = _polyKey(key, nonce);
|
|
100
|
+
if (polyKey === false) return false;
|
|
101
|
+
const ct = chacha20.xor(key, nonce, plaintext, 1);
|
|
102
|
+
if (ct === false) return false;
|
|
103
|
+
const tag = poly1305.mac(polyKey, _macInput(aad, ct));
|
|
104
|
+
return { ct, tag };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* AEAD decrypt.
|
|
109
|
+
* @returns {Uint8Array|false} Plaintext on success, `false` on tag mismatch.
|
|
110
|
+
*/
|
|
111
|
+
function decrypt(key, nonce, ciphertext, tag, aad) {
|
|
112
|
+
aad = aad || new Uint8Array(0);
|
|
113
|
+
const polyKey = _polyKey(key, nonce);
|
|
114
|
+
if (polyKey === false) return false;
|
|
115
|
+
if (!poly1305.verify(polyKey, _macInput(aad, ciphertext), tag)) {
|
|
116
|
+
console.error('[crypto] CORRUPT: chacha20poly1305: authentication tag mismatch');
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return chacha20.xor(key, nonce, ciphertext, 1);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// ── Iteration G2 - Nonce-uniqueness tracker (opt-in) ─────────────
|
|
123
|
+
//
|
|
124
|
+
// ChaCha20-Poly1305 (RFC 8439) requires the (key, nonce) pair to be
|
|
125
|
+
// unique : reuse leaks the Poly1305 key (forgery + plaintext recovery
|
|
126
|
+
// via two-time pad). Unlike GCM nonce reuse, Poly1305's tag will
|
|
127
|
+
// *still validate* on the second message - there is no cryptographic
|
|
128
|
+
// canary. The application must enforce uniqueness.
|
|
129
|
+
//
|
|
130
|
+
// `nonceTracker(key)` wraps `encrypt`/`decrypt` with an in-process
|
|
131
|
+
// Set of seen nonces (per-wrapper, not global). Mirrors the GCM
|
|
132
|
+
// pattern (`mode/gcm.js:258`). Process-local only - distributed or
|
|
133
|
+
// persistent uniqueness must be enforced upstream.
|
|
134
|
+
//
|
|
135
|
+
// Not enabled by default (no breaking change). Use this to harden
|
|
136
|
+
// long-lived sessions where the caller can't reason about nonce
|
|
137
|
+
// collisions.
|
|
138
|
+
function nonceTracker(key) {
|
|
139
|
+
const seen = new Set();
|
|
140
|
+
const k2s = (nonce) => {
|
|
141
|
+
let s = '';
|
|
142
|
+
for (let i = 0; i < nonce.length; i++) {
|
|
143
|
+
s += (nonce[i] < 16 ? '0' : '') + nonce[i].toString(16);
|
|
144
|
+
}
|
|
145
|
+
return s;
|
|
146
|
+
};
|
|
147
|
+
return {
|
|
148
|
+
seenNonces: seen,
|
|
149
|
+
encrypt(nonce, plaintext, aad) {
|
|
150
|
+
const s = k2s(nonce);
|
|
151
|
+
if (seen.has(s)) {
|
|
152
|
+
console.error('[crypto] CORRUPT: chacha20poly1305: nonce reuse rejected by tracker');
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
seen.add(s);
|
|
156
|
+
return encrypt(key, nonce, plaintext, aad);
|
|
157
|
+
},
|
|
158
|
+
// ── Decrypt policy ───────────────────────────────────────
|
|
159
|
+
// `decrypt` deliberately does NOT consult or mutate the
|
|
160
|
+
// `seen` Set. Rationale :
|
|
161
|
+
//
|
|
162
|
+
// • Decryption with the right key + tag proves the message
|
|
163
|
+
// was produced by someone holding the key - replaying a
|
|
164
|
+
// valid (nonce, ct, tag) tuple is harmless at the AEAD
|
|
165
|
+
// layer (it yields the same plaintext, no key/MAC
|
|
166
|
+
// leakage). Anti-replay is the application's job (e.g.
|
|
167
|
+
// sequence numbers in TLS, packet IDs in Noise).
|
|
168
|
+
//
|
|
169
|
+
// • Forbidding decrypt-replay would break legitimate
|
|
170
|
+
// use cases : verifying a long-lived stored ciphertext
|
|
171
|
+
// on every load, idempotent retries over an unreliable
|
|
172
|
+
// transport, multiple readers of the same blob.
|
|
173
|
+
//
|
|
174
|
+
// • The catastrophic failure ChaCha20-Poly1305 guards
|
|
175
|
+
// against is **encrypt** nonce reuse (two-time pad on
|
|
176
|
+
// the Poly1305 key). The encrypt path is where the
|
|
177
|
+
// tracker matters.
|
|
178
|
+
//
|
|
179
|
+
// If your protocol needs replay protection at this layer,
|
|
180
|
+
// wrap `decrypt` upstream with a windowed sequence-number
|
|
181
|
+
// check rather than enabling it here.
|
|
182
|
+
decrypt(nonce, ciphertext, tag, aad) {
|
|
183
|
+
return decrypt(key, nonce, ciphertext, tag, aad);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return { name: 'chacha20poly1305', encrypt, decrypt, nonceTracker };
|
|
189
|
+
}
|
|
190
|
+
};
|