@awacloud/fw 0.1.0 → 1.0.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 +125 -0
- package/NOTICE +8 -0
- package/README.md +163 -31
- package/dist/build/fw.core.pure.meta.json +6 -6
- package/dist/build/fw.core.pure.min.js +15 -12
- package/dist/build/fw.full.pure.meta.json +13 -7
- package/dist/build/fw.full.pure.min.js +45 -42
- package/dist/build/fw.minimal.pure.meta.json +6 -6
- package/dist/build/fw.minimal.pure.min.js +16 -13
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +6 -6
- package/dist/build/fw.pack.compress-heavy.pure.min.js +3 -3
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +6 -6
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +1 -1
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +6 -6
- package/dist/build/fw.pack.crypto-basic.pure.min.js +1 -1
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +7 -6
- package/dist/build/fw.pack.crypto-identity.pure.min.js +4 -4
- package/dist/build/fw.pwa.pure.meta.json +7 -6
- package/dist/build/fw.pwa.pure.min.js +38 -35
- package/dist/build/fw.site-interactive.pure.meta.json +6 -6
- package/dist/build/fw.site-interactive.pure.min.js +37 -34
- package/dist/build/fw.site.pure.meta.json +6 -6
- package/dist/build/fw.site.pure.min.js +24 -21
- package/dist/build/fw.spa.pure.meta.json +8 -7
- package/dist/build/fw.spa.pure.min.js +41 -38
- package/dist/build/sanity-base-classic.min.js +1 -1
- package/dist/build/sanity.min.js +1 -1
- package/dist/types/core/internal.d.ts +29 -0
- package/dist/types/core/internal.d.ts.map +1 -0
- package/dist/types/core/logger.d.ts +23 -4
- package/dist/types/core/logger.d.ts.map +1 -1
- package/dist/types/core/modules.d.ts +374 -61
- package/dist/types/core/modules.d.ts.map +1 -1
- package/dist/types/core/runtime.d.ts +10 -6
- package/dist/types/core/runtime.d.ts.map +1 -1
- package/dist/types/core/worker-helper.d.ts +35 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -1
- package/dist/types/crypto/cipher/aes.d.ts +1 -7
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -1
- package/dist/types/crypto/cipher/chacha20.d.ts +0 -10
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -1
- package/dist/types/crypto/hash/argon2.d.ts +0 -15
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -1
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -1
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -1
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -1
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha224.d.ts +1 -1
- package/dist/types/crypto/hash/sha256.d.ts +4 -13
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha384.d.ts +1 -1
- package/dist/types/crypto/hash/sha512.d.ts +4 -13
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -1
- package/dist/types/crypto/mode/cmac.d.ts +0 -6
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -1
- package/dist/types/crypto/mode/ctr.d.ts +0 -6
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -1
- package/dist/types/crypto/mode/gcm.d.ts +0 -9
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ecc.d.ts +0 -1
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ed25519.d.ts +4 -25
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -1
- package/dist/types/crypto/pkc/hybridSign.d.ts +25 -5
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ml_dsa.d.ts +6 -26
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ml_kem.d.ts +0 -43
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -1
- package/dist/types/crypto/pkc/rsa.d.ts +0 -24
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/slh_dsa.d.ts +6 -16
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/x25519.d.ts +0 -6
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -1
- package/dist/types/crypto/utils/bitArray.d.ts +0 -8
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -1
- package/dist/types/crypto/utils/jws.d.ts +6 -14
- package/dist/types/crypto/utils/jws.d.ts.map +1 -1
- package/dist/types/crypto/utils/keyformat.d.ts +52 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -1
- package/dist/types/crypto/utils/random.d.ts +1 -10
- package/dist/types/crypto/utils/random.d.ts.map +1 -1
- package/dist/types/crypto/utils/rsaKeygen.d.ts +0 -10
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -1
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -1
- package/dist/types/crypto/utils/x509.d.ts +397 -0
- package/dist/types/crypto/utils/x509.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +2 -1
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -1
- package/dist/types/crypto/wasm/pbkdf2.d.ts +2 -2
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -1
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -1
- package/dist/types/crypto/wasm/runtime.d.ts +13 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/digest.d.ts +0 -4
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -1
- package/dist/types/dom/fs/fileIntake.d.ts +59 -0
- package/dist/types/dom/fs/fileIntake.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -1
- package/dist/types/dom/query/dnd.d.ts.map +1 -1
- package/dist/types/dom/query/sound.d.ts +89 -0
- package/dist/types/dom/query/sound.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -1
- package/dist/types/dom/rendering/component.d.ts +9 -3
- package/dist/types/dom/rendering/component.d.ts.map +1 -1
- package/dist/types/dom/rendering/parser.d.ts +39 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -1
- package/dist/types/dom/rendering/render.d.ts.map +1 -1
- package/dist/types/dom/rendering/sanitize.d.ts +4 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -1
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -1
- package/dist/types/dom/rendering/styleSheet.d.ts +74 -0
- package/dist/types/dom/rendering/styleSheet.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +9 -3
- package/dist/types/dom/rendering/template.d.ts.map +1 -1
- package/dist/types/dom/rendering/themeTokens.d.ts +9 -3
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession-core.d.ts +9 -3
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession-list.d.ts +9 -3
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession.d.ts +18 -6
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -1
- package/dist/types/dom/sw/installPrompt.d.ts +89 -0
- package/dist/types/dom/sw/installPrompt.d.ts.map +1 -0
- package/dist/types/dom/sw/precache.d.ts +149 -0
- package/dist/types/dom/sw/precache.d.ts.map +1 -0
- package/dist/types/dom/sw/swUpdate.d.ts +129 -0
- package/dist/types/dom/sw/swUpdate.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +8 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -1
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -1
- package/dist/types/dom/utils/route.d.ts.map +1 -1
- package/dist/types/dom/utils/ua.d.ts +2 -2
- package/dist/types/dom/utils/ua.d.ts.map +1 -1
- package/dist/types/io/calc/crc32.d.ts.map +1 -1
- package/dist/types/io/codec/b64.d.ts +24 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -1
- package/dist/types/io/codec/cbor.d.ts +1 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -1
- package/dist/types/io/codec/hex.d.ts.map +1 -1
- package/dist/types/io/codec/msgpack.d.ts +1 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -1
- package/dist/types/io/codec/url.d.ts +3 -1
- package/dist/types/io/codec/url.d.ts.map +1 -1
- package/dist/types/io/codec/utf8.d.ts.map +1 -1
- package/dist/types/io/compress/bitstream.d.ts +1 -1
- package/dist/types/io/compress/brotli.d.ts +0 -1
- package/dist/types/io/compress/brotli.d.ts.map +1 -1
- package/dist/types/io/compress/brotli_shared.d.ts +0 -4
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -1
- package/dist/types/io/compress/deflate.d.ts +14 -1
- package/dist/types/io/compress/deflate.d.ts.map +1 -1
- package/dist/types/io/compress/gzip.d.ts +4 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -1
- package/dist/types/io/compress/huffman.d.ts +7 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -1
- package/dist/types/io/compress/lz4.d.ts +4 -2
- package/dist/types/io/compress/lz4.d.ts.map +1 -1
- package/dist/types/io/compress/lz77.d.ts +17 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -1
- package/dist/types/io/compress/lzw.d.ts +2 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -1
- package/dist/types/io/compress/zip.d.ts.map +1 -1
- package/dist/types/io/compress/zlib.d.ts +9 -2
- package/dist/types/io/compress/zlib.d.ts.map +1 -1
- package/dist/types/io/math/linalg.d.ts.map +1 -1
- package/dist/types/process/rpc.d.ts.map +1 -1
- package/dist/types/process/workerPool.d.ts.map +1 -1
- package/dist/types/sanity/base.d.ts +12 -2
- package/dist/types/sanity/base.d.ts.map +1 -1
- package/dist/types/sanity/lockdown.d.ts +6 -5
- package/dist/types/sanity/lockdown.d.ts.map +1 -1
- package/dist/types/sanity/wasm-gate.d.ts +1 -1
- package/docs/README.md +17 -10
- package/docs/api/README.md +5 -5
- package/docs/api/core/logger.md +2 -1
- package/docs/api/core/modules.md +3 -3
- package/docs/api/core/runtime.md +9 -9
- package/docs/api/core/worker-helper.md +12 -2
- package/docs/api/crypto/README.md +1 -1
- package/docs/api/crypto/cipher/README.md +2 -2
- package/docs/api/crypto/cipher/aes.md +5 -10
- package/docs/api/crypto/cipher/chacha20.md +3 -8
- package/docs/api/crypto/hash/README.md +5 -5
- package/docs/api/crypto/hash/adf.md +21 -11
- package/docs/api/crypto/hash/argon2.md +3 -12
- package/docs/api/crypto/hash/blake2b.md +12 -14
- package/docs/api/crypto/hash/pbkdf2.md +1 -1
- package/docs/api/crypto/hash/sha224.md +2 -2
- package/docs/api/crypto/hash/sha256.md +4 -4
- package/docs/api/crypto/hash/sha3.md +2 -2
- package/docs/api/crypto/hash/sha384.md +1 -1
- package/docs/api/crypto/hash/sha512.md +5 -5
- package/docs/api/crypto/hash/sha512_224.md +1 -1
- package/docs/api/crypto/hash/sha512_256.md +1 -1
- package/docs/api/crypto/mode/README.md +3 -3
- package/docs/api/crypto/mode/cbc.md +2 -2
- package/docs/api/crypto/mode/chacha20poly1305.md +1 -1
- package/docs/api/crypto/mode/cmac.md +4 -4
- package/docs/api/crypto/mode/ctr.md +2 -3
- package/docs/api/crypto/mode/gcm.md +5 -5
- package/docs/api/crypto/mode/kw.md +4 -4
- package/docs/api/crypto/pkc/README.md +8 -8
- package/docs/api/crypto/pkc/ecc.md +19 -17
- package/docs/api/crypto/pkc/ed25519.md +10 -15
- package/docs/api/crypto/pkc/hybridKem.md +8 -2
- package/docs/api/crypto/pkc/hybridSign.md +34 -7
- package/docs/api/crypto/pkc/ml_dsa.md +20 -19
- package/docs/api/crypto/pkc/ml_kem.md +3 -3
- package/docs/api/crypto/pkc/rsa.md +7 -9
- package/docs/api/crypto/pkc/slh_dsa.md +12 -12
- package/docs/api/crypto/pkc/x25519.md +5 -4
- package/docs/api/crypto/utils/README.md +7 -7
- package/docs/api/crypto/utils/aes_modes.md +2 -5
- package/docs/api/crypto/utils/asn1.md +25 -16
- package/docs/api/crypto/utils/jws.md +6 -4
- package/docs/api/crypto/utils/keyformat.md +24 -15
- package/docs/api/crypto/utils/pad.md +1 -1
- package/docs/api/crypto/utils/pem.md +3 -3
- package/docs/api/crypto/utils/random.md +3 -4
- package/docs/api/crypto/utils/rsaKeygen.md +2 -2
- package/docs/api/crypto/utils/totp.md +2 -2
- package/docs/api/crypto/utils/uuid.md +5 -5
- package/docs/api/crypto/utils/x509.md +124 -0
- package/docs/api/crypto/wasm/aes.md +1 -1
- package/docs/api/crypto/wasm/argon2.md +6 -4
- package/docs/api/crypto/wasm/ml_kem.md +1 -0
- package/docs/api/crypto/wasm/pbkdf2.md +8 -8
- package/docs/api/crypto/wasm/rsa.md +1 -1
- package/docs/api/crypto/wasm/runtime.md +27 -10
- package/docs/api/crypto/webcrypto/aes.md +1 -1
- package/docs/api/crypto/webcrypto/aeskw.md +2 -2
- package/docs/api/crypto/webcrypto/digest.md +3 -5
- package/docs/api/crypto/webcrypto/ecc.md +1 -1
- package/docs/api/crypto/webcrypto/ed25519.md +1 -1
- package/docs/api/crypto/webcrypto/rsa.md +3 -2
- package/docs/api/crypto/webcrypto/x25519.md +1 -1
- package/docs/api/dom/README.md +6 -1
- package/docs/api/dom/fs/README.md +1 -0
- package/docs/api/dom/fs/fileIntake.md +120 -0
- package/docs/api/dom/fs/fsAccess.md +1 -0
- package/docs/api/dom/fs/indexedDB.md +1 -1
- package/docs/api/dom/fs/storage.md +1 -1
- package/docs/api/dom/query/README.md +2 -1
- package/docs/api/dom/query/dnd.md +4 -1
- package/docs/api/dom/query/dom.md +5 -0
- package/docs/api/dom/query/sound.md +103 -0
- package/docs/api/dom/rendering/README.md +4 -3
- package/docs/api/dom/rendering/chart.md +5 -4
- package/docs/api/dom/rendering/component.md +25 -3
- package/docs/api/dom/rendering/parser.md +5 -2
- package/docs/api/dom/rendering/reactiveBind.md +1 -1
- package/docs/api/dom/rendering/render.md +2 -2
- package/docs/api/dom/rendering/sanitize.md +10 -2
- package/docs/api/dom/rendering/secPolicy.md +4 -4
- package/docs/api/dom/rendering/styleSheet.md +85 -0
- package/docs/api/dom/rendering/template.md +20 -5
- package/docs/api/dom/rendering/themeTokens.md +6 -3
- package/docs/api/dom/rendering/uiSession.md +18 -5
- package/docs/api/dom/rendering/virtualScroll.md +2 -2
- package/docs/api/dom/sensors/geolocation.md +1 -1
- package/docs/api/dom/sw/README.md +7 -1
- package/docs/api/dom/sw/cache.md +2 -1
- package/docs/api/dom/sw/installPrompt.md +111 -0
- package/docs/api/dom/sw/precache.md +124 -0
- package/docs/api/dom/sw/serviceWorker.md +4 -2
- package/docs/api/dom/sw/swUpdate.md +112 -0
- package/docs/api/dom/utils/clipboard.md +56 -5
- package/docs/api/dom/utils/entropyCollector.md +1 -1
- package/docs/api/dom/utils/keybindings.md +17 -2
- package/docs/api/dom/utils/leaderElection.md +2 -2
- package/docs/api/dom/utils/route.md +1 -0
- package/docs/api/dom/utils/ua.md +15 -10
- package/docs/api/io/calc/crc32.md +4 -1
- package/docs/api/io/codec/README.md +2 -2
- package/docs/api/io/codec/b64.md +31 -2
- package/docs/api/io/codec/buffer.md +1 -1
- package/docs/api/io/codec/cbor.md +6 -4
- package/docs/api/io/codec/csv.md +178 -178
- package/docs/api/io/codec/hex.md +10 -2
- package/docs/api/io/codec/msgpack.md +4 -3
- package/docs/api/io/codec/url.md +4 -3
- package/docs/api/io/codec/utf8.md +3 -3
- package/docs/api/io/compress/bitstream.md +6 -3
- package/docs/api/io/compress/brotli.md +36 -4
- package/docs/api/io/compress/brotli_shared.md +1 -1
- package/docs/api/io/compress/deflate.md +42 -34
- package/docs/api/io/compress/gzip.md +26 -6
- package/docs/api/io/compress/huffman.md +2 -1
- package/docs/api/io/compress/lz4.md +5 -3
- package/docs/api/io/compress/lz77.md +26 -3
- package/docs/api/io/compress/lzw.md +13 -8
- package/docs/api/io/compress/zip.md +36 -10
- package/docs/api/io/compress/zlib.md +21 -5
- package/docs/api/io/math/linalg.md +1 -1
- package/docs/api/io/utils/valid.md +1 -1
- package/docs/api/process/rpc.md +3 -2
- package/docs/api/process/workerPool.md +1 -1
- package/docs/api/sanity/base.md +9 -5
- package/docs/api/sanity/lockdown.md +7 -6
- package/docs/api/surface.json +12311 -0
- package/docs/api/typed.md +5 -3
- package/docs/dev/README.md +2 -0
- package/docs/dev/bench.md +76 -0
- package/docs/dev/crypto-references.md +54 -0
- package/docs/dev/provenance.md +30 -7
- package/docs/dev/publishing.md +7 -7
- package/docs/dev/runtime.md +1 -1
- package/docs/dev/testing.md +13 -0
- package/docs/evidence/l4-evidence.md +86 -0
- package/docs/evidence/pqc-hybrid-evidence.md +7 -6
- package/docs/guide/README.md +1 -0
- package/docs/guide/_QUICK_REF.md +5 -5
- package/docs/guide/doc-format.md +4 -3
- package/docs/guide/integrations-hmr.md +1 -1
- package/docs/guide/module-creation-workflow.md +8 -8
- package/docs/guide/rendering-pipeline.md +11 -4
- package/docs/guide/security.md +7 -5
- package/docs/guide/stability.md +123 -0
- package/docs/guide/tutorial-todo.md +20 -8
- package/docs/guide/typescript.md +9 -0
- package/docs/guide/worker-confinement.md +30 -17
- package/docs/notes/lz77-deflate-factorization.md +3 -3
- package/docs/tools/README.md +1 -1
- package/docs/tools/bundler.md +3 -3
- package/docs/tools/codegen.md +1 -1
- package/docs/tools/standalone.md +0 -1
- package/fw.config.json +2 -2
- package/integrations/_shared/catalog.generated.json +7 -1
- package/integrations/_shared/core.js +1 -1
- package/integrations/astro/index.js +1 -1
- package/integrations/eslint/README.md +7 -1
- package/integrations/nextjs/index.js +1 -1
- package/integrations/nodejs/README.md +3 -3
- package/integrations/turbopack/index.js +2 -2
- package/integrations/typedoc/categorize.js +1 -1
- package/integrations/typedoc/typedoc.json +2 -1
- package/integrations/vite/index.js +2 -2
- package/integrations/vite/vite-env.d.ts +7 -4
- package/integrations/webpack/index.js +3 -3
- package/package.json +76 -10
- package/src/core/internal.js +31 -0
- package/src/core/logger.js +95 -23
- package/src/core/modules.js +17 -8
- package/src/core/readyState.js +1 -1
- package/src/core/runtime.js +74 -27
- package/src/core/worker-helper.js +83 -4
- package/src/crypto/NIST_CONFORMANCE.md +47 -34
- package/src/crypto/cipher/aes.acvp.md +7 -8
- package/src/crypto/cipher/aes.js +280 -229
- package/src/crypto/cipher/chacha20.acvp.md +6 -7
- package/src/crypto/cipher/chacha20.js +91 -61
- package/src/crypto/hash/adf.js +1 -1
- package/src/crypto/hash/argon2.acvp.md +11 -15
- package/src/crypto/hash/argon2.js +9 -24
- package/src/crypto/hash/blake2b.js +157 -125
- package/src/crypto/hash/hkdf.acvp.md +15 -15
- package/src/crypto/hash/hkdf.js +1 -1
- package/src/crypto/hash/hmac.acvp.md +10 -12
- package/src/crypto/hash/hmac.js +5 -1
- package/src/crypto/hash/pbkdf2.acvp.md +13 -13
- package/src/crypto/hash/pbkdf2.js +36 -8
- package/src/crypto/hash/poly1305.acvp.md +10 -6
- package/src/crypto/hash/poly1305.js +171 -50
- package/src/crypto/hash/sha224.acvp.md +3 -3
- package/src/crypto/hash/sha224.js +4 -4
- package/src/crypto/hash/sha256.acvp.md +2 -2
- package/src/crypto/hash/sha256.js +514 -50
- package/src/crypto/hash/sha3.acvp.md +9 -9
- package/src/crypto/hash/sha3.js +127 -71
- package/src/crypto/hash/sha384.acvp.md +3 -3
- package/src/crypto/hash/sha384.js +4 -4
- package/src/crypto/hash/sha512.acvp.md +7 -8
- package/src/crypto/hash/sha512.js +107 -108
- package/src/crypto/hash/sha512_224.acvp.md +6 -6
- package/src/crypto/hash/sha512_224.js +2 -2
- package/src/crypto/hash/sha512_256.acvp.md +6 -6
- package/src/crypto/hash/sha512_256.js +2 -2
- package/src/crypto/mode/cbc.acvp.md +2 -2
- package/src/crypto/mode/cbc.js +1 -1
- package/src/crypto/mode/chacha20poly1305.acvp.md +6 -6
- package/src/crypto/mode/chacha20poly1305.js +3 -3
- package/src/crypto/mode/cmac.acvp.md +5 -5
- package/src/crypto/mode/cmac.js +8 -8
- package/src/crypto/mode/ctr.acvp.md +2 -2
- package/src/crypto/mode/ctr.js +1 -3
- package/src/crypto/mode/gcm.acvp.md +6 -6
- package/src/crypto/mode/gcm.js +7 -7
- package/src/crypto/mode/kw.acvp.md +4 -4
- package/src/crypto/mode/kw.js +5 -5
- package/src/crypto/pkc/ecc.acvp.md +13 -13
- package/src/crypto/pkc/ecc.js +9 -11
- package/src/crypto/pkc/ed25519.acvp.md +30 -34
- package/src/crypto/pkc/ed25519.js +453 -94
- package/src/crypto/pkc/hybrid-kat.provenance.md +4 -4
- package/src/crypto/pkc/hybridSign.js +103 -24
- package/src/crypto/pkc/ml_dsa.acvp.md +18 -18
- package/src/crypto/pkc/ml_dsa.js +29 -32
- package/src/crypto/pkc/ml_kem.acvp.md +7 -7
- package/src/crypto/pkc/ml_kem.js +15 -21
- package/src/crypto/pkc/rsa.acvp.md +11 -15
- package/src/crypto/pkc/rsa.js +7 -44
- package/src/crypto/pkc/slh_dsa.acvp.md +16 -16
- package/src/crypto/pkc/slh_dsa.js +16 -18
- package/src/crypto/pkc/x25519.acvp.md +13 -10
- package/src/crypto/pkc/x25519.js +273 -29
- package/src/crypto/utils/aes_modes.acvp.md +1 -2
- package/src/crypto/utils/aes_modes.js +2 -2
- package/src/crypto/utils/asn1-oid.js +1 -1
- package/src/crypto/utils/asn1.js +1 -1
- package/src/crypto/utils/bitArray.js +33 -48
- package/src/crypto/utils/bn.js +1 -1
- package/src/crypto/utils/jws.js +37 -41
- package/src/crypto/utils/keyformat.js +181 -2
- package/src/crypto/utils/pem.js +1 -1
- package/src/crypto/utils/random.acvp.md +5 -5
- package/src/crypto/utils/random.js +845 -846
- package/src/crypto/utils/rsaKeygen.acvp.md +3 -2
- package/src/crypto/utils/rsaKeygen.js +6 -6
- package/src/crypto/utils/totp.js +1 -1
- package/src/crypto/utils/uuid.acvp.md +5 -5
- package/src/crypto/utils/uuid.js +11 -10
- package/src/crypto/utils/x509.js +591 -0
- package/src/crypto/wasm/aes.js +1 -1
- package/src/crypto/wasm/aes.scalar.wasm +0 -0
- package/src/crypto/wasm/argon2.js +17 -1
- package/src/crypto/wasm/argon2.scalar.wasm +0 -0
- package/src/crypto/wasm/blake2b.scalar.wasm +0 -0
- package/src/crypto/wasm/blake2b.simd.wasm +0 -0
- package/src/crypto/wasm/chacha20poly1305.scalar.wasm +0 -0
- package/src/crypto/wasm/chacha20poly1305.simd.wasm +0 -0
- package/src/crypto/wasm/cmac.scalar.wasm +0 -0
- package/src/crypto/wasm/ecc.js +3 -3
- package/src/crypto/wasm/ecc.scalar.wasm +0 -0
- package/src/crypto/wasm/ed25519.js +1 -1
- package/src/crypto/wasm/ed25519.scalar.wasm +0 -0
- package/src/crypto/wasm/hkdf.scalar.wasm +0 -0
- package/src/crypto/wasm/hmac.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_dsa.js +2 -2
- package/src/crypto/wasm/ml_dsa.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_dsa.simd.wasm +0 -0
- package/src/crypto/wasm/ml_kem.js +2 -2
- package/src/crypto/wasm/ml_kem.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_kem.simd.wasm +0 -0
- package/src/crypto/wasm/pbkdf2.js +8 -6
- package/src/crypto/wasm/pbkdf2.scalar.wasm +0 -0
- package/src/crypto/wasm/rsa.js +6 -5
- package/src/crypto/wasm/rsa.scalar.wasm +0 -0
- package/src/crypto/wasm/runtime.js +84 -17
- package/src/crypto/wasm/sha2.scalar.wasm +0 -0
- package/src/crypto/wasm/sha3.scalar.wasm +0 -0
- package/src/crypto/wasm/sha3.simd.wasm +0 -0
- package/src/crypto/wasm/slh_dsa.js +1 -1
- package/src/crypto/wasm/slh_dsa.scalar.wasm +0 -0
- package/src/crypto/wasm/x25519.js +1 -1
- package/src/crypto/wasm/x25519.scalar.wasm +0 -0
- package/src/crypto/webcrypto/aes.js +8 -2
- package/src/crypto/webcrypto/aeskw.js +7 -2
- package/src/crypto/webcrypto/digest.js +1 -15
- package/src/crypto/webcrypto/ecc.js +2 -2
- package/src/crypto/webcrypto/ed25519.js +2 -2
- package/src/crypto/webcrypto/hmac.js +2 -2
- package/src/crypto/webcrypto/rsa.js +7 -2
- package/src/crypto/webcrypto/x25519.js +2 -2
- package/src/dom/display/animate.js +1 -1
- package/src/dom/display/fullscreen.js +1 -1
- package/src/dom/fs/download.js +1 -1
- package/src/dom/fs/fileIntake.js +192 -0
- package/src/dom/fs/fsAccess.js +2 -3
- package/src/dom/fs/indexedDB.js +1 -1
- package/src/dom/fs/remoteStore.js +1 -1
- package/src/dom/fs/storage.js +1 -1
- package/src/dom/lifecycle/idle.js +1 -1
- package/src/dom/lifecycle/visibility.js +1 -1
- package/src/dom/lifecycle/wakeLock.js +1 -1
- package/src/dom/net/ajax.js +1 -1
- package/src/dom/net/network.js +1 -1
- package/src/dom/net/sse.js +1 -1
- package/src/dom/net/webrtc.js +1 -1
- package/src/dom/net/ws.js +1 -1
- package/src/dom/query/dnd.js +56 -4
- package/src/dom/query/dom.js +1 -1
- package/src/dom/query/events.js +1 -1
- package/src/dom/query/gesture.js +1 -1
- package/src/dom/query/media.js +1 -1
- package/src/dom/query/sound.js +333 -0
- package/src/dom/rendering/chart.js +736 -663
- package/src/dom/rendering/component.js +25 -14
- package/src/dom/rendering/devtools.js +2 -2
- package/src/dom/rendering/parser.js +155 -12
- package/src/dom/rendering/render.js +14 -4
- package/src/dom/rendering/sanitize.js +11 -4
- package/src/dom/rendering/secPolicy.js +6 -4
- package/src/dom/rendering/styleSheet.js +217 -0
- package/src/dom/rendering/template.js +72 -13
- package/src/dom/rendering/themeTokens.js +542 -522
- package/src/dom/rendering/uiSession-core.js +51 -6
- package/src/dom/rendering/uiSession-direct.js +1 -1
- package/src/dom/rendering/uiSession-list.js +4 -4
- package/src/dom/rendering/uiSession.js +1 -1
- package/src/dom/rendering/virtualScroll.js +341 -341
- package/src/dom/sensors/battery.js +1 -1
- package/src/dom/sensors/geolocation.js +1 -1
- package/src/dom/sensors/networkInfo.js +1 -1
- package/src/dom/sensors/sensors.js +1 -1
- package/src/dom/sw/backgroundSync.js +1 -1
- package/src/dom/sw/cache.js +1 -1
- package/src/dom/sw/installPrompt.js +151 -0
- package/src/dom/sw/precache.js +257 -0
- package/src/dom/sw/push.js +1 -1
- package/src/dom/sw/sharedWorker.js +1 -1
- package/src/dom/sw/swUpdate.js +239 -0
- package/src/dom/utils/a11y.js +1 -1
- package/src/dom/utils/clipboard.js +56 -6
- package/src/dom/utils/entropyCollector.js +1 -1
- package/src/dom/utils/focus.js +1 -1
- package/src/dom/utils/form.js +1 -1
- package/src/dom/utils/keybindings.js +600 -574
- package/src/dom/utils/leaderElection.js +1 -1
- package/src/dom/utils/notifications.js +1 -1
- package/src/dom/utils/permissions.js +107 -107
- package/src/dom/utils/route.js +14 -2
- package/src/dom/utils/ua.js +42 -28
- package/src/dom/utils/webauthn.js +1 -1
- package/src/io/binary/reader.js +1 -1
- package/src/io/binary/writer.js +1 -1
- package/src/io/calc/bigint.js +1 -1
- package/src/io/calc/crc32.js +28 -2
- package/src/io/calc/easing.js +514 -514
- package/src/io/codec/b64.js +189 -52
- package/src/io/codec/base32.js +1 -1
- package/src/io/codec/base58.js +1 -1
- package/src/io/codec/buffer.js +1 -1
- package/src/io/codec/cbor.js +111 -18
- package/src/io/codec/csv.js +1 -1
- package/src/io/codec/hex.js +51 -6
- package/src/io/codec/mime.js +1 -1
- package/src/io/codec/msgpack.js +47 -6
- package/src/io/codec/url.js +24 -7
- package/src/io/codec/utf8.js +5 -3
- package/src/io/codec/xml.js +1 -1
- package/src/io/compress/bitstream.js +2 -2
- package/src/io/compress/brotli.js +663 -163
- package/src/io/compress/brotli_dict.js +1 -1
- package/src/io/compress/brotli_dict_words.js +1 -1
- package/src/io/compress/brotli_frame.js +1 -1
- package/src/io/compress/brotli_shared.js +7 -7
- package/src/io/compress/deflate.js +87 -53
- package/src/io/compress/gzip.js +187 -74
- package/src/io/compress/huffman.js +24 -1
- package/src/io/compress/lz4.js +45 -7
- package/src/io/compress/lz77.js +148 -63
- package/src/io/compress/lzw.js +35 -19
- package/src/io/compress/zip.js +862 -815
- package/src/io/compress/zlib.js +87 -7
- package/src/io/i18n/i18n.js +1 -1
- package/src/io/math/fixed-point.js +1 -1
- package/src/io/math/geom.js +1 -1
- package/src/io/math/interp.js +1 -1
- package/src/io/math/linalg.js +10 -4
- package/src/io/math/stats.js +1 -1
- package/src/io/structures/btree.js +1 -1
- package/src/io/structures/heap.js +1 -1
- package/src/io/structures/lruCache.js +1 -1
- package/src/io/structures/ringBuffer.js +1 -1
- package/src/io/structures/tree-walker.js +1 -1
- package/src/io/structures/trie.js +1 -1
- package/src/io/sync/abort.js +1 -1
- package/src/io/sync/atomics.js +1 -1
- package/src/io/sync/cancellable.js +1 -1
- package/src/io/sync/channel.js +1 -1
- package/src/io/sync/mutex.js +1 -1
- package/src/io/sync/semaphore.js +1 -1
- package/src/io/sync/tokenBucket.js +1 -1
- package/src/io/text/ansi.js +1 -1
- package/src/io/text/html-entities.js +1 -1
- package/src/io/time/date.js +1 -1
- package/src/io/timing/clock.js +1 -1
- package/src/io/timing/rateLimit.js +1 -1
- package/src/io/timing/scheduler.js +1 -1
- package/src/io/utils/errors.js +1 -1
- package/src/io/utils/eventBus.js +1 -1
- package/src/io/utils/signal.js +1 -1
- package/src/io/utils/valid.js +1 -1
- package/src/main.js +1 -1
- package/src/process/message.js +1 -1
- package/src/process/rpc.js +7 -3
- package/src/process/workerPool.js +11 -4
- package/src/sanity/base.js +85 -39
- package/src/sanity/lockdown-apply.js +3 -3
- package/src/sanity/lockdown.js +58 -32
- package/src/sanity/wasm-gate.js +2 -2
- package/src/typed.js +7 -3
- package/third-party/NOTICE-brotli-dictionary.txt +69 -0
- package/third-party/NOTICE-fw-wasm-crypto.txt +576 -0
- package/third-party/NOTICE-whatwg-entities.txt +44 -0
- package/types/registry.generated.d.ts +7 -1
- package/types/typed.d.ts +7 -3
- package/dist/types/crypto/utils/aes_ctr.d.ts +0 -84
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +0 -1
- package/docs/api/crypto/utils/aes_ctr.md +0 -71
- package/src/crypto/utils/aes_ctr.acvp.md +0 -67
- package/src/crypto/utils/aes_ctr.js +0 -134
package/src/crypto/mode/ctr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
2
|
// Author: Matthieu Bouilloux
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
@@ -31,7 +31,6 @@ import { bitArray } from '../utils/bitArray.js';
|
|
|
31
31
|
* @typedef {object} CtrAPI
|
|
32
32
|
* @property {(prf: {encrypt: Function}, plaintext: number[], iv: number[]) => (number[]|false)} encrypt Encrypt in CTR mode.
|
|
33
33
|
* @property {(prf: {encrypt: Function}, ciphertext: number[], iv: number[]) => (number[]|false)} decrypt Decrypt in CTR mode (identical to encrypt).
|
|
34
|
-
* @property {(prf: {encrypt: Function}, data: number[], iv: number[]) => (number[]|false)} _calculate Internal CTR core.
|
|
35
34
|
* @property {(ui8a: (Uint8Array|number[]), pos: number) => (Uint8Array|number[])} ui8_increase Advance a 16-byte counter by ⌊pos/16⌋ blocks.
|
|
36
35
|
* @property {(ui8a: (Uint8Array|number[]), pos: number) => (Uint8Array|number[])} ui8_increase_384 As `ui8_increase` over the last 16 bytes of a 48-byte buffer.
|
|
37
36
|
*/
|
|
@@ -166,7 +165,6 @@ export const ctr = {
|
|
|
166
165
|
return _calculate(prf, ciphertext, iv);
|
|
167
166
|
},
|
|
168
167
|
|
|
169
|
-
_calculate,
|
|
170
168
|
ui8_increase,
|
|
171
169
|
ui8_increase_384
|
|
172
170
|
};
|
|
@@ -23,7 +23,7 @@ or via GHASH for ivLen ≠ 96. PRF: 128-bit block cipher (`encrypt(block)`),
|
|
|
23
23
|
|
|
24
24
|
API: `encrypt(prf, pt, iv, aad, tlen)` → `{ ct, tag }`; `decrypt(prf,
|
|
25
25
|
ct, iv, aad, tag, tlen)` → `pt | false` (plaintext is never released on
|
|
26
|
-
an invalid tag; `console.
|
|
26
|
+
an invalid tag; `console.warn('CORRUPT:')`). GMAC: `gmac(prf, aad, iv,
|
|
27
27
|
tlen)` / `gmacVerify(prf, aad, iv, tag, tlen)`. Nonce safeguard:
|
|
28
28
|
`nonceTracker(prf)` (in-process Set of seen IVs, refuses duplicates).
|
|
29
29
|
|
|
@@ -35,8 +35,8 @@ tlen)` / `gmacVerify(prf, aad, iv, tag, tlen)`. Nonce safeguard:
|
|
|
35
35
|
|---|---|---|---|
|
|
36
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
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
|
|
39
|
-
| **McGrew-Viega §B
|
|
38
|
+
| **McGrew-Viega §B** | 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** | 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
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
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
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)` |
|
|
@@ -89,7 +89,7 @@ validate rejection of forged tags.
|
|
|
89
89
|
| Requirement | Status | Evidence |
|
|
90
90
|
|---|---|---|
|
|
91
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
|
|
92
|
+
| Validated parameter sizes | ✅ | **AES-128**: 60 ACVP-AES-GCM-1.0 + McGrew-Viega TC 1-6. **AES-192**: McGrew-Viega TC 7-12. **AES-256**: McGrew-Viega TC 13-18. 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
93
|
| KAT power-on / self-test | ✅ | McGrew-Viega + 120 ACVP executed on every `bun test` |
|
|
94
94
|
| CT comparisons (if secret) | ✅ | `bitArray.equal` (no early exit) |
|
|
95
95
|
| No `throw` / timing leak | ✅ | Reviewed: `console.warn`/`console.error` + `return false` |
|
|
@@ -97,7 +97,7 @@ validate rejection of forged tags.
|
|
|
97
97
|
|
|
98
98
|
## Known limitations
|
|
99
99
|
|
|
100
|
-
- ~~**AES-192 / AES-256 outside integrated ACVP**~~ ✅
|
|
100
|
+
- ~~**AES-192 / AES-256 outside integrated ACVP**~~ ✅
|
|
101
101
|
**McGrew-Viega TC 7-12 (AES-192) + TC 15-18 (AES-256 extended)** added.
|
|
102
102
|
The supplied ACVP-AES-GCM-1.0 suite still only covers `keyLen=128`
|
|
103
103
|
(60 tests), but McGrew-Viega §B is the historical **canonical source**
|
|
@@ -123,7 +123,7 @@ validate rejection of forged tags.
|
|
|
123
123
|
## Cross-references
|
|
124
124
|
|
|
125
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
|
|
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)
|
|
127
127
|
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
128
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
129
|
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
package/src/crypto/mode/gcm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
2
|
// Author: Matthieu Bouilloux
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
@@ -51,7 +51,6 @@ import { bitArray } from '../utils/bitArray.js';
|
|
|
51
51
|
* @property {(prf: {encrypt: Function}, adata: number[], iv: number[], tlen?: number) => (number[]|false)} gmac GMAC tag over AAD only.
|
|
52
52
|
* @property {(prf: {encrypt: Function}, adata: number[], iv: number[], tag: number[], tlen?: number) => boolean} gmacVerify Constant-time GMAC verification.
|
|
53
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
54
|
*/
|
|
56
55
|
|
|
57
56
|
export const gcm = {
|
|
@@ -251,7 +250,7 @@ export const gcm = {
|
|
|
251
250
|
const expected = _authTag(prf, H, J0, adata, ciphertext, tlen);
|
|
252
251
|
|
|
253
252
|
if (!bitArray.equal(bitArray.clamp(tag, tlen), expected)) {
|
|
254
|
-
console.
|
|
253
|
+
console.warn('[crypto] CORRUPT: gcm: authentication tag mismatch');
|
|
255
254
|
return false;
|
|
256
255
|
}
|
|
257
256
|
return _gctr(prf, _incCb(J0), ciphertext);
|
|
@@ -320,14 +319,15 @@ export const gcm = {
|
|
|
320
319
|
};
|
|
321
320
|
}
|
|
322
321
|
|
|
323
|
-
return /** @type {GcmAPI} */ (/** @type {any} */ ({
|
|
322
|
+
return /** @type {GcmAPI} */ (/** @type {any} */ (Object.defineProperty({
|
|
324
323
|
encrypt,
|
|
325
324
|
decrypt,
|
|
326
325
|
gmac,
|
|
327
326
|
gmacVerify,
|
|
328
|
-
nonceTracker
|
|
327
|
+
nonceTracker
|
|
328
|
+
}, Symbol.for('@awacloud/fw/internal'), {
|
|
329
329
|
// Internal primitives - exposed for KAT tests only. Not API.
|
|
330
|
-
|
|
331
|
-
}));
|
|
330
|
+
value: { ghash: _ghash, gctr: _gctr }
|
|
331
|
+
})));
|
|
332
332
|
}
|
|
333
333
|
};
|
|
@@ -92,13 +92,13 @@ the constant-time IV+length+padding check (KWP).
|
|
|
92
92
|
- [x] **Rejection of empty input in KWP** — `kwp: plaintext must not be empty`.
|
|
93
93
|
- [x] **Rejection of non-multiple-of-8 input in KW** — `kw: plaintext length
|
|
94
94
|
must be a positive multiple of 8 bytes`.
|
|
95
|
-
- [x] **`kwCipher=inverse` variant** ✅
|
|
95
|
+
- [x] **`kwCipher=inverse` variant** ✅ explicit reject.
|
|
96
96
|
Exports `wrapInverseCipher()` / `unwrapInverseCipher()` return
|
|
97
97
|
`false` + a typed `NOT-IMPLEMENTED` warning. Avoids any silent use
|
|
98
98
|
of the SP 800-38F §6.3 variant (`CIPH_K⁻¹` in the wrap direction,
|
|
99
99
|
rare outside embedded TPM). If documented need arises, the
|
|
100
100
|
implementation will need to be added and separately audited.
|
|
101
|
-
- [x] **Rejection of TDES (and other non-AES)** ✅
|
|
101
|
+
- [x] **Rejection of TDES (and other non-AES)** ✅ `_checkBlockSize`
|
|
102
102
|
rejects any PRF with `blockSize !== 16` (TDES = 8 bytes). SP 800-131A
|
|
103
103
|
§2.4 deprecates 3DES since 2024; SP 800-38F §6.2 mandates AES.
|
|
104
104
|
- [ ] **Side-channel on AES** — delegated to `aes.js`.
|
|
@@ -121,7 +121,7 @@ the constant-time IV+length+padding check (KWP).
|
|
|
121
121
|
Our `kw.js` only implements the `cipher` variant (forward `W`), which
|
|
122
122
|
is the dominant form in TLS/PKCS#8/JOSE. The ACVP provides 3600
|
|
123
123
|
`inverse` vectors per suite (50 % of the total) which are filtered
|
|
124
|
-
out.
|
|
124
|
+
out. `wrapInverseCipher()` / `unwrapInverseCipher()`
|
|
125
125
|
exports that return `false` + `console.warn('NOT-IMPLEMENTED')` to
|
|
126
126
|
prevent any silent use by a consumer that believes it has inverse KW-AE.
|
|
127
127
|
- **No asymmetric KW-AE/KW-AD**: the `wrap`/`unwrap`
|
|
@@ -139,7 +139,7 @@ the constant-time IV+length+padding check (KWP).
|
|
|
139
139
|
## Cross-references
|
|
140
140
|
|
|
141
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
|
|
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 more: KW-AE inverse explicit reject + TDES guards)
|
|
143
143
|
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-symmetric.adoc`
|
|
144
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
145
|
- Overall conformance: [`NIST_CONFORMANCE.md`](../NIST_CONFORMANCE.md)
|
package/src/crypto/mode/kw.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
2
|
// Author: Matthieu Bouilloux
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
@@ -115,7 +115,7 @@ export const kw = {
|
|
|
115
115
|
return { aHi, aLo, R };
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
//
|
|
118
|
+
// TDES rejection.
|
|
119
119
|
// SP 800-131A §2.4 marks Triple-DES as deprecated since 2024 and
|
|
120
120
|
// disallowed for cryptographic protection beyond 2023. SP 800-38F
|
|
121
121
|
// §6.2 explicitly requires a 128-bit block cipher (AES-128/192/256).
|
|
@@ -193,7 +193,7 @@ export const kw = {
|
|
|
193
193
|
// skip the second XOR depending on the first).
|
|
194
194
|
const diff = ((aHi ^ _IV_KW_HI) | (aLo ^ _IV_KW_LO)) >>> 0;
|
|
195
195
|
if (diff !== 0) {
|
|
196
|
-
console.
|
|
196
|
+
console.warn('[crypto] CORRUPT: kw: integrity check failed');
|
|
197
197
|
return false;
|
|
198
198
|
}
|
|
199
199
|
return R;
|
|
@@ -287,7 +287,7 @@ export const kw = {
|
|
|
287
287
|
bad |= padded[i] & (-inPad);
|
|
288
288
|
}
|
|
289
289
|
if (bad !== 0) {
|
|
290
|
-
console.
|
|
290
|
+
console.warn('[crypto] CORRUPT: kwp: integrity check failed');
|
|
291
291
|
return false;
|
|
292
292
|
}
|
|
293
293
|
return padded.subarray(0, mli);
|
|
@@ -297,7 +297,7 @@ export const kw = {
|
|
|
297
297
|
// applies CIPH_K⁻¹ (decrypt) in the wrap direction. ACVP includes
|
|
298
298
|
// about 50 % of its KW vectors with this variant for completeness,
|
|
299
299
|
// but it is rare in practice (legacy embedded TPM only). Iteration
|
|
300
|
-
//
|
|
300
|
+
// Explicit reject with a typed
|
|
301
301
|
// export to prevent any silent use. If a consumer has a
|
|
302
302
|
// documented need, the implementation must be added separately
|
|
303
303
|
// and audited.
|
|
@@ -51,10 +51,10 @@ the strict RFC 6979 contract (which requires H_K = H_msg).
|
|
|
51
51
|
|---|---|---|---|
|
|
52
52
|
| NIST CAVP / ACVP | `ECDSA-KeyGen-FIPS186-5/expectedResults.json` (24/72) | `ECDSA-KeyGen-FIPS186-5 (...validator-style, 24/72 vectors)` | `Q == d·G` byte-exact (4 NIST curves × 6 tcId) |
|
|
53
53
|
| NIST CAVP / ACVP | `ECDSA-KeyVer-FIPS186-5/expectedResults.json` (4 positive) | `ECDSA-KeyVer-FIPS186-5 (...4 vectors)` | `deserialize` accepts valid Q values (P-224/256/384/521) |
|
|
54
|
-
| **NIST CAVP / ACVP
|
|
55
|
-
| **
|
|
54
|
+
| **NIST CAVP / ACVP** | `ECDSA-KeyVer-FIPS186-5` 12/12 (4 pos + 8 neg) across 4 NIST P-curves | `ecc - ACVP ECDSA-KeyVer-FIPS186-5 (subgroup check)` | Full §A.4.2 validation: x/y range + on-curve + non-identity + n·Q == O. Covers the 8 negative cases (off-curve point, x/y out of field range — incl. P-521 tg=4 tc=11 where qx ≥ p). |
|
|
55
|
+
| **deserialize integration** | pos + neg smoke test | `deserialize integrates subgroup check` | `ecc.deserialize` returns `false` for an out-of-subgroup point |
|
|
56
56
|
| NIST CAVP / ACVP | `ECDSA-SigVer-FIPS186-5/expectedResults.json` (8 sub-sampled positives) | `ECDSA-SigVer-FIPS186-5 (...8 sub-sampled vectors)` | `verify(H, r||s)` byte-exact (P-{224,256,384,521} × {SHA-256, SHA-512}) |
|
|
57
|
-
| NIST CAVP / ACVP | `DetECDSA-SigGen-FIPS186-5/internalProjection.json` (16 vectors) | `DetECDSA-SigGen-FIPS186-5 (...RFC 6979 byte-exact)` | RFC 6979 §3.2 byte-exact on 4 (curve, hash) pairs: (P-224, SHA-256), (P-256, SHA-256), (P-384, SHA-384), **(P-521, SHA-512)
|
|
57
|
+
| NIST CAVP / ACVP | `DetECDSA-SigGen-FIPS186-5/internalProjection.json` (16 vectors) | `DetECDSA-SigGen-FIPS186-5 (...RFC 6979 byte-exact)` | RFC 6979 §3.2 byte-exact on 4 (curve, hash) pairs: (P-224, SHA-256), (P-256, SHA-256), (P-384, SHA-384), **(P-521, SHA-512)** × [first/mid/last] |
|
|
58
58
|
| FIPS 186-3 SigVer.rsp | P-256/SHA-256 vector + tampering | `NIST CAVP ECDSA verify` | historical KAT + tampering rejection |
|
|
59
59
|
| Pre-existing | round-trip | `ECDSA sign/verify` (P-256, P-384, P-521) | basic round-trip |
|
|
60
60
|
| Pre-existing | round-trip | `elGamal DH`, `kem` | commutative DH + KEM round-trip |
|
|
@@ -89,16 +89,16 @@ compare byte-exact against `(qx, qy)`. This simultaneously validates:
|
|
|
89
89
|
- [x] **Round-trip sign/verify** — P-256/P-384/P-521 (pre-existing +
|
|
90
90
|
implicit DetECDSA).
|
|
91
91
|
- [x] **Public validation §A.4.2 / SP 800-56A Rev.3 §5.6.2.3.3** ✅
|
|
92
|
-
|
|
92
|
+
implemented in `ecc.deserialize`:
|
|
93
93
|
(1) x, y coordinates in field range (< p), (2) point on curve via
|
|
94
94
|
`isValid()`, (3) non-identity, (4) subgroup membership via
|
|
95
|
-
`n·Q == O`. Exposed via `
|
|
95
|
+
`n·Q == O`. Exposed via `internalOf(ecc).{coordsInRange, isInSubgroup,
|
|
96
96
|
isValidPublicKey}`. **8 negative ACVP KeyVer vectors byte-exact**
|
|
97
97
|
(off-curve + out-of-range, incl. P-521 tg=4 tc=11 where qx ≥ p — a
|
|
98
98
|
typical oversize-encoding case not caught by the plain curve
|
|
99
99
|
equation modulo p).
|
|
100
100
|
- [x] **Strict ECDSA malleability (s > n/2 rejection)** ✅
|
|
101
|
-
|
|
101
|
+
implemented. `verify(rs, { strict: true })`
|
|
102
102
|
rejects signatures with `s > ⌊n/2⌋` (BIP62 / NIST strict mode).
|
|
103
103
|
`sign({ strict: true })` always produces a canonical low-s `s`
|
|
104
104
|
(replaces `s` with `n − s` if needed). Test: generate a
|
|
@@ -108,7 +108,7 @@ compare byte-exact against `(qx, qy)`. This simultaneously validates:
|
|
|
108
108
|
dedicated low-s vectors (negatives are *modify r/s*,
|
|
109
109
|
*zero r/s*, *modify message/key*) — covered by synthetic
|
|
110
110
|
counter-signature tests instead.
|
|
111
|
-
- [x] **RFC 6979 byte-exact P-521** ✅
|
|
111
|
+
- [x] **RFC 6979 byte-exact P-521** ✅ fixed.
|
|
112
112
|
Cause: SJCL `bn.bitLength()` returns 528 (rounded up to a multiple
|
|
113
113
|
of 16) instead of 521. Helper `_trueBitLength(R)` added, which
|
|
114
114
|
walks the byte representation to find the true MSB. The RFC 6979
|
|
@@ -116,7 +116,7 @@ compare byte-exact against `(qx, qy)`. This simultaneously validates:
|
|
|
116
116
|
(modulo the 65 vs 66-byte encoding — RFC uses minimal-length,
|
|
117
117
|
FIPS uses 66 fixed bytes), and 4 ACVP P-521+SHA-512 DetECDSA
|
|
118
118
|
sub-samples pass.
|
|
119
|
-
- [x] **K-hash decoupled from message-hash** ✅
|
|
119
|
+
- [x] **K-hash decoupled from message-hash** ✅
|
|
120
120
|
`sign({ hashForK: <hashMod> })` lets the caller make the K
|
|
121
121
|
derivation hash explicit (strict RFC 6979 requires H_K = H_msg).
|
|
122
122
|
The default remains `_hashForBits(curveBitLength)` so as not to
|
|
@@ -132,16 +132,16 @@ compare byte-exact against `(qx, qy)`. This simultaneously validates:
|
|
|
132
132
|
|---|---|---|
|
|
133
133
|
| Approved algorithm | ✅ | FIPS 186-5 §6 + ACVP folders |
|
|
134
134
|
| Approved curves | ✅ | P-{192,224,256,384,521} (FIPS 186-5 §3.1) |
|
|
135
|
-
| RFC 6979 deterministic generation | ✅ |
|
|
135
|
+
| RFC 6979 deterministic generation | ✅ | byte-exact OK for the 4 NIST P-curves (incl. P-521 now; `_trueBitLength` bug fixed) |
|
|
136
136
|
| ECDSA verification | ✅ | 8 ACVP vectors + tampering test |
|
|
137
137
|
| Q ∈ G validation (point on curve) | ✅ | `point.isValid()` in `curve.fromBits` |
|
|
138
|
-
| Q ∈ <G> validation (subgroup) | ✅ |
|
|
138
|
+
| Q ∈ <G> validation (subgroup) | ✅ | `n·Q == O` verified + range check x,y < p; 12 ACVP `KeyVer-FIPS186-5` vectors (4 pos + 8 neg) byte-exact |
|
|
139
139
|
| CT comparisons (if secret) | ⚠️ | `verify` is not constant-time (early return on r, s bounds; OK for pub-key path); `sign` uses non-CT `bn` (SJCL-derived, see docs/dev/provenance.md) |
|
|
140
140
|
| No `throw` / timing leak | ✅ | Review: `console.error/warn` + `return false`; no `throw` |
|
|
141
141
|
|
|
142
142
|
## Known limitations
|
|
143
143
|
|
|
144
|
-
- ~~**P-521 RFC 6979 byte-exact**~~ ✅
|
|
144
|
+
- ~~**P-521 RFC 6979 byte-exact**~~ ✅ fixed.
|
|
145
145
|
Root cause: SJCL `bn.bitLength()` rounds up to a multiple of 16 (528
|
|
146
146
|
for the 521-bit P-521 order value), which truncated
|
|
147
147
|
`_bitsToInt(T, 528)` instead of `_bitsToInt(T, 521)` — a 7-bit offset
|
|
@@ -150,12 +150,12 @@ compare byte-exact against `(qx, qy)`. This simultaneously validates:
|
|
|
150
150
|
P-521/SHA-512 sample vector is now reproduced byte-exact, and 3 ACVP
|
|
151
151
|
P-521+SHA-512 DetECDSA sub-samples pass (previously filtered out at
|
|
152
152
|
iteration 18).
|
|
153
|
-
- ~~**Missing subgroup check**~~ ✅
|
|
153
|
+
- ~~**Missing subgroup check**~~ ✅ implemented.
|
|
154
154
|
`deserialize` now performs the full §A.4.2 validation: x/y < p range +
|
|
155
155
|
on-curve + non-identity + n·Q == O. 12 ACVP KeyVer vectors (4 pos + 8
|
|
156
156
|
neg) byte-exact. Cost: ~1-3 ms/mult on P-256, acceptable for one-shot
|
|
157
157
|
deserialize.
|
|
158
|
-
- ~~**K-hash coupled to `curveBitLength`**~~ ✅
|
|
158
|
+
- ~~**K-hash coupled to `curveBitLength`**~~ ✅
|
|
159
159
|
the `sign({ hashForK })` option now lets H_K be set explicitly
|
|
160
160
|
(strict RFC 6979). The default (`_hashForBits(curveBitLength)`) is
|
|
161
161
|
unchanged to preserve existing ACVP DetECDSA coverage; callers who
|
package/src/crypto/pkc/ecc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
2
|
// Author: Matthieu Bouilloux
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
@@ -149,7 +149,6 @@
|
|
|
149
149
|
* @property {{ publicKey: EccPublicKeyCtor, secretKey: EccSecretKeyCtor, generateKeys: (cn: string) => Function }} basicKey
|
|
150
150
|
* @property {{ generateKeys: Function, publicKey: EccPublicKeyCtor, secretKey: EccSecretKeyCtor }} elGamal
|
|
151
151
|
* @property {{ generateKeys: Function, publicKey: EccPublicKeyCtor, secretKey: EccSecretKeyCtor }} ecdsa
|
|
152
|
-
* @property {object} _internal
|
|
153
152
|
*/
|
|
154
153
|
|
|
155
154
|
import { bitArray } from '../utils/bitArray.js';
|
|
@@ -217,8 +216,7 @@ export const ecc = {
|
|
|
217
216
|
// True (unrounded) bit-length of a positive integer encoded as a
|
|
218
217
|
// big-endian byte array. SJCL `bn.bitLength()` rounds up to the next
|
|
219
218
|
// multiple of 16 (storage radix), which breaks RFC 6979 for P-521
|
|
220
|
-
// where the curve order n has bit-length 521 (not 528).
|
|
221
|
-
// of the FIPS 140-3 upgrade plan - fixes the byte-exact divergence
|
|
219
|
+
// where the curve order n has bit-length 521 (not 528). This fixes the byte-exact divergence
|
|
222
220
|
// against RFC 6979 §A.2.7 P-521 sample.
|
|
223
221
|
function _trueBitLength(R) {
|
|
224
222
|
const bytes = bitArray.ba_to_ui8(R.toBits());
|
|
@@ -804,7 +802,7 @@ export const ecc = {
|
|
|
804
802
|
// - boolean `fakeLegacyVersion` (back-compat), OR
|
|
805
803
|
// - object `opts = { fakeLegacyVersion?, strict? }`.
|
|
806
804
|
//
|
|
807
|
-
//
|
|
805
|
+
// `opts.strict = true`
|
|
808
806
|
// enables ECDSA "low-s" rejection (BIP62 / NIST strict mode):
|
|
809
807
|
// a canonical signature has `s ∈ [1, ⌊n/2⌋]`. Any value of s
|
|
810
808
|
// in (n/2, n) - including the malleable signature `s' = n - s` -
|
|
@@ -834,7 +832,7 @@ export const ecc = {
|
|
|
834
832
|
const hA = r.mul(s).mod(R);
|
|
835
833
|
const r2 = this._curve.G.mult2(hG, hA, this._point).x;
|
|
836
834
|
if (r.equals(0) || ss.equals(0) || r.greaterEquals(R) || ss.greaterEquals(R) || !r2.equals(r)) {
|
|
837
|
-
console.
|
|
835
|
+
console.warn('[crypto] CORRUPT: ecdsa: signature did not verify');
|
|
838
836
|
return false;
|
|
839
837
|
}
|
|
840
838
|
if (strict) {
|
|
@@ -844,7 +842,7 @@ export const ecc = {
|
|
|
844
842
|
const halfR = R.copy().halveM();
|
|
845
843
|
const upperBoundExcl = halfR.add(new bn.bn(1));
|
|
846
844
|
if (ss.greaterEquals(upperBoundExcl)) {
|
|
847
|
-
console.
|
|
845
|
+
console.warn('[crypto] CORRUPT: ecdsa: signature is malleable (s > n/2) under strict mode');
|
|
848
846
|
return false;
|
|
849
847
|
}
|
|
850
848
|
}
|
|
@@ -861,7 +859,7 @@ export const ecc = {
|
|
|
861
859
|
ecc.ecdsa.secretKey.prototype = {
|
|
862
860
|
// Sign `hash` (already-digested message bits) with this private key.
|
|
863
861
|
//
|
|
864
|
-
//
|
|
862
|
+
// Options:
|
|
865
863
|
// - `opts.hashForK` : explicit hash module for RFC 6979 §3.2 K
|
|
866
864
|
// derivation (default: `_hashForBits(curveBitLength)`,
|
|
867
865
|
// which ties H_K to the curve size instead of H_msg -
|
|
@@ -918,10 +916,10 @@ export const ecc = {
|
|
|
918
916
|
};
|
|
919
917
|
|
|
920
918
|
// ── Internal escape hatch (test-only) ────────────────────────
|
|
921
|
-
//
|
|
919
|
+
// Exposes the subgroup
|
|
922
920
|
// membership test for direct testing against ACVP KeyVer-FIPS186-5
|
|
923
921
|
// negative vectors (where Q is on the curve but outside <G>).
|
|
924
|
-
ecc.
|
|
922
|
+
Object.defineProperty(ecc, Symbol.for('@awacloud/fw/internal'), { value: {
|
|
925
923
|
coordsInRange: _coordsInRange,
|
|
926
924
|
isInSubgroup: _isInSubgroup,
|
|
927
925
|
isValidPublicKey(curveName, pointHex) {
|
|
@@ -933,7 +931,7 @@ export const ecc = {
|
|
|
933
931
|
if (point === false) return false;
|
|
934
932
|
return _isInSubgroup(point, curve);
|
|
935
933
|
}
|
|
936
|
-
};
|
|
934
|
+
} });
|
|
937
935
|
|
|
938
936
|
// @ts-ignore -- basicKey.generateKeys is assigned dynamically after construction
|
|
939
937
|
return ecc;
|
|
@@ -20,7 +20,13 @@ Ed25519** variant (RFC 8032 §5.1): twisted Edwards curve
|
|
|
20
20
|
−x² + y² = 1 − (121665/121666)·x²·y² over GF(2²⁵⁵−19), an
|
|
21
21
|
implementation derived from TweetNaCl (16 limbs of 16-bit
|
|
22
22
|
Float64Array, extended projective coordinates `(X, Y, Z, T)` with
|
|
23
|
-
`x=X/Z, y=Y/Z, T=XY/Z`)
|
|
23
|
+
`x=X/Z, y=Y/Z, T=XY/Z`), with this project's field multiply and square
|
|
24
|
+
unrolled into locals, inversion and square root by addition chains, a
|
|
25
|
+
constant-time base-point table (`j · 256^i · B`, signed radix-16 digits)
|
|
26
|
+
for `keyPair` / `sign`, and a 4-bit window plus the RFC 8032 §5.1.4
|
|
27
|
+
doubling for `verify`'s public variable-base part. Outputs are
|
|
28
|
+
byte-identical to the TweetNaCl form (checked against it and against
|
|
29
|
+
`node:crypto`).
|
|
24
30
|
|
|
25
31
|
Public API (`Uint8Array` everywhere):
|
|
26
32
|
|
|
@@ -28,28 +34,26 @@ Public API (`Uint8Array` everywhere):
|
|
|
28
34
|
or `false` if seed ≠ 32 bytes.
|
|
29
35
|
- `sign(privateKey, message)` → 64-byte signature (R || S); rejects
|
|
30
36
|
privateKey ≠ 64 bytes.
|
|
31
|
-
- `verify(publicKey,
|
|
37
|
+
- `verify(publicKey, signature, message)` → `true | false`
|
|
32
38
|
(constant-time comparison: accumulated XOR over 32 bytes, line 348).
|
|
33
39
|
|
|
34
40
|
Internal API (test-only):
|
|
35
41
|
|
|
36
|
-
- `
|
|
42
|
+
- `internalOf(ed25519).isValidPublicKey(pk)` → `true` iff `pk` deserializes into
|
|
37
43
|
a valid point on edwards25519 (`_unpackneg() === 0`). Used
|
|
38
44
|
for the EDDSA-KeyVer-1.0 coverage. Outside the production contract.
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
Added the
|
|
41
47
|
**Ed25519ph** (preHash, RFC 8032 §5.1.1 / FIPS 186-5 §7.6.2) and
|
|
42
48
|
**Ed25519ctx** (context bytes, RFC 8032 §5.1) variants:
|
|
43
|
-
- `signPh(privateKey, message, ctx?)` / `verifyPh(publicKey,
|
|
49
|
+
- `signPh(privateKey, message, ctx?)` / `verifyPh(publicKey, signature, message, ctx?)`
|
|
44
50
|
— applies SHA-512 internally to the message + dom2(F=1, ctx) prefix.
|
|
45
|
-
- `signCtx(privateKey, message, ctx)` / `verifyCtx(publicKey,
|
|
51
|
+
- `signCtx(privateKey, message, ctx)` / `verifyCtx(publicKey, signature, message, ctx)`
|
|
46
52
|
— dom2(F=0, ctx) prefix; ctx required (1..255 bytes — for an empty
|
|
47
53
|
ctx, use the pure Ed25519 path via `sign/verify`).
|
|
48
54
|
|
|
49
55
|
Not implemented (see *Known limitations*): **Ed448** (distinct curve,
|
|
50
|
-
SHAKE-256)
|
|
51
|
-
signPh,verifyPh}` stubs that return `false + warn NOT-IMPLEMENTED` for
|
|
52
|
-
safety by default.
|
|
56
|
+
SHAKE-256).
|
|
53
57
|
|
|
54
58
|
## Test coverage
|
|
55
59
|
|
|
@@ -61,13 +65,13 @@ safety by default.
|
|
|
61
65
|
| RFC 8032 §7.1 TEST 2 | 1-byte message | `§7.1 TEST 2 (1-byte message)` | byte-exact KAT (sig) |
|
|
62
66
|
| RFC 8032 §7.1 TEST 3 | 2-byte message | `§7.1 TEST 3 (2-byte message)` | byte-exact KAT (sig) |
|
|
63
67
|
| NIST CAVP / ACVP | `EDDSA-KeyGen-1.0` (3/3 ED-25519) | `EDDSA-KeyGen-1.0 (...3/3 vectors)` | `keyPair(d).publicKey == q` byte-exact |
|
|
64
|
-
| NIST CAVP / ACVP | `EDDSA-KeyVer-1.0` (4/4 ED-25519) | `EDDSA-KeyVer-1.0 (...4/4 vectors)` | `
|
|
68
|
+
| NIST CAVP / ACVP | `EDDSA-KeyVer-1.0` (4/4 ED-25519) | `EDDSA-KeyVer-1.0 (...4/4 vectors)` | `internalOf(ed25519).isValidPublicKey(q)` ↔ `testPassed` |
|
|
65
69
|
| NIST CAVP / ACVP | `EDDSA-SigGen-1.0` (3 sub-samples ED-25519/AFT/preHash=False) | `EDDSA-SigGen-1.0 (...byte-exact 3 sub-samples)` | `sign(d, msg) == signature` byte-exact (RFC 8032 deterministic) |
|
|
66
70
|
| NIST CAVP / ACVP | `EDDSA-SigVer-1.0` (5/5 ED-25519/preHash=False) | `EDDSA-SigVer-1.0 (...5/5 vectors)` | `verify(q, msg, sig)` ↔ `testPassed` (mix pass/fail) |
|
|
67
|
-
| **NIST CAVP / ACVP
|
|
68
|
-
| **NIST CAVP / ACVP
|
|
69
|
-
| **
|
|
70
|
-
| **
|
|
71
|
+
| **NIST CAVP / ACVP** | `EDDSA-SigGen-1.0` 3 sub-samples ED-25519/preHash=True | `EDDSA-SigGen-1.0 preHash=True` | `signPh(d, msg, ctx) == signature` byte-exact, 96-byte ctx |
|
|
72
|
+
| **NIST CAVP / ACVP** | `EDDSA-SigVer-1.0` 5/5 ED-25519/preHash=True | `EDDSA-SigVer-1.0 preHash=True` | `verifyPh(q, msg, sig)` ↔ `testPassed` (mix valid/invalid) |
|
|
73
|
+
| **Ed25519ph round-trip** | Ed25519ph w/ + w/o context | `Ed25519ph cross-check` | round-trip sign+verify, domain separation vs pure |
|
|
74
|
+
| **Ed25519ctx round-trip** | Ed25519ctx w/ context | `Ed25519ctx (RFC 8032 §5.1)` | round-trip + wrong-context rejection + cross-mode rejection |
|
|
71
75
|
| Pre-existing | tampering message | `verify rejects modified message` | rejects altered message |
|
|
72
76
|
| Pre-existing | tampering signature | `verify rejects modified signature` | rejects altered signature |
|
|
73
77
|
| Pre-existing | bad seed | `rejects bad seed length` | rejects seed ≠ 32 bytes |
|
|
@@ -93,28 +97,23 @@ safety by default.
|
|
|
93
97
|
- [x] **Scalar clamping RFC 8032 §5.1.5** — `d[0] &= 248; d[31]
|
|
94
98
|
&= 127; d[31] |= 64` line 274; indirect proof via byte-exact
|
|
95
99
|
keyPair on 4 different seeds (3 RFC + 1 ACVP).
|
|
96
|
-
- [x] **Ed25519ph (preHash)** ✅
|
|
100
|
+
- [x] **Ed25519ph (preHash)** ✅ implemented.
|
|
97
101
|
`signPh(privateKey, message, ctx?)` / `verifyPh` apply SHA-512
|
|
98
102
|
to the message + dom2(F=1, ctx) prefix per RFC 8032 §5.1.1. 3
|
|
99
103
|
ACVP SigGen vectors + 5 SigVer preHash=True byte-exact + 5
|
|
100
104
|
round-trip tests (incl. domain separation vs pure Ed25519).
|
|
101
|
-
- [x] **Ed25519ctx (context bytes)** ✅
|
|
105
|
+
- [x] **Ed25519ctx (context bytes)** ✅ implemented.
|
|
102
106
|
`signCtx(privateKey, message, ctx)` / `verifyCtx` apply
|
|
103
107
|
dom2(F=0, ctx) prefix per RFC 8032 §5.1. ctx required (1..255 bytes;
|
|
104
108
|
empty ctx → use pure `sign/verify`). 5 round-trip tests
|
|
105
109
|
(round-trip + wrong-ctx rejection + cross-mode pure rejection + 0/256 bounds).
|
|
106
|
-
- [x] **Ed448 — documented decision** ✅
|
|
110
|
+
- [x] **Ed448 — documented decision** ✅ Ed448
|
|
107
111
|
(FIPS 186-5 §7.7, edwards448 curve + SHAKE-256, 57-byte pk,
|
|
108
112
|
114-byte sig) **not implemented by design**. ACVP covers:
|
|
109
113
|
KeyGen 3, KeyVer 4, SigGen 84 (preHash + ctx), SigVer 10 = 101
|
|
110
114
|
total ED-448 vectors. Rather than partially implementing it,
|
|
111
|
-
the module
|
|
112
|
-
|
|
113
|
-
`console.warn('NOT-IMPLEMENTED')` pointing to FIPS 186-5 §7.7 +
|
|
114
|
-
RFC 8032 §5.2 + a recommendation to create a separate `ed448.js`
|
|
115
|
-
(to be derived directly from RFC 8032 §5.2).
|
|
116
|
-
**Avoids any silent use** by a consumer that would have
|
|
117
|
-
confused the Ed25519/Ed448 variants.
|
|
115
|
+
the module offers none: an Ed448 module would be a separate
|
|
116
|
+
`ed448.js`, derived directly from RFC 8032 §5.2.
|
|
118
117
|
- [ ] **Strict subgroup check (low-order Q rejection)** — `_unpackneg`
|
|
119
118
|
accepts points of order 8 (cofactor). RFC 8032 §5.1.7 v2
|
|
120
119
|
(May 2017) optionally recommends rejecting them but does not
|
|
@@ -129,7 +128,7 @@ safety by default.
|
|
|
129
128
|
| Approved curve | ✅ | edwards25519 (FIPS 186-5 §7.2.1) |
|
|
130
129
|
| RFC 8032 deterministic generation | ✅ | byte-exact on 6 pure vectors + 3 ph (RFC + ACVP) |
|
|
131
130
|
| EdDSA verification | ✅ | 5 ACVP pure vectors + 5 ph + 2 tampering |
|
|
132
|
-
| preHash + context variants (FIPS 186-5 §7.6.1/2) | ✅ |
|
|
131
|
+
| preHash + context variants (FIPS 186-5 §7.6.1/2) | ✅ | `signPh/verifyPh/signCtx/verifyCtx` + 13 dedicated tests |
|
|
133
132
|
| pk validation (point on curve) | ✅ | `_unpackneg` + 4 ACVP KeyVer vectors |
|
|
134
133
|
| CT tag comparison | ✅ | accumulated XOR line 347-349 |
|
|
135
134
|
| Power-on KAT / self-test | N/A | permanent KAT via 6 deterministic vectors |
|
|
@@ -139,16 +138,14 @@ safety by default.
|
|
|
139
138
|
## Known limitations
|
|
140
139
|
|
|
141
140
|
- **No Ed448**: edwards448 curve + SHAKE-256 not implemented.
|
|
142
|
-
**Iteration E2**: `ed25519.ed448.*` guards that return
|
|
143
|
-
`false + warn NOT-IMPLEMENTED` added to prevent any silent use.
|
|
144
141
|
To enable Ed448: create a separate `ed448.js` (the compression
|
|
145
142
|
function differs; no sharing with ed25519.js). Output 57 bytes
|
|
146
143
|
pk + 114 bytes sig. To be implemented directly from RFC 8032 §5.2.
|
|
147
|
-
- ~~**No prehash variant (Ed25519ph)**~~ ✅
|
|
144
|
+
- ~~**No prehash variant (Ed25519ph)**~~ ✅
|
|
148
145
|
`signPh(sk, message, ctx?)` / `verifyPh` exposed. The module applies
|
|
149
146
|
SHA-512 internally to the message + dom2(F=1, ctx) prefix per RFC 8032
|
|
150
147
|
§5.1.1.
|
|
151
|
-
- ~~**No `context` (Ed25519ctx)**~~ ✅
|
|
148
|
+
- ~~**No `context` (Ed25519ctx)**~~ ✅
|
|
152
149
|
`signCtx(sk, message, ctx)` / `verifyCtx` exposed. ctx required (1..255
|
|
153
150
|
bytes); empty ctx → use `sign/verify` (pure Ed25519 path).
|
|
154
151
|
- **Cofactored verification**: `_unpackneg` accepts points
|
|
@@ -157,15 +154,14 @@ safety by default.
|
|
|
157
154
|
(cf. ed25519-dalek strict mode) reject it. Acceptable for
|
|
158
155
|
standard usage, worth noting for cryptanalytically
|
|
159
156
|
sensitive protocols.
|
|
160
|
-
- **
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
fixed addition chain).
|
|
157
|
+
- **Timing**: secret data never selects a branch, a loop bound or a table index: the base table is read by a full scan merged by mask, the signed digits are recoded with arithmetic only, swaps and negations go through masks. What JavaScript cannot promise — that the engine executes the same arithmetic in the same time for every value — no JS implementation can. `verify` handles public data only and
|
|
158
|
+
uses a variable-time window. A structural test
|
|
159
|
+
(`ed25519-fast.test.js`) pins the base table's scan.
|
|
164
160
|
|
|
165
161
|
## Cross-references
|
|
166
162
|
|
|
167
163
|
- Module: [`pkc/ed25519.js`](./ed25519.js)
|
|
168
|
-
- Tests: [`pkc/ed25519.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/pkc/ed25519.test.js) — 46 tests (22 baseline + 18
|
|
164
|
+
- Tests: [`pkc/ed25519.test.js`](https://github.com/awacloud/awa/blob/main/packages/front/fw/src/crypto/pkc/ed25519.test.js) — 46 tests (22 baseline + 24 more: 18 for Ed25519ph / Ed25519ctx, 6 for the Ed448 NOT-IMPLEMENTED stubs)
|
|
169
165
|
- ACVP draft: `references/NIST/ACVP/src/draft-celi-acvp-eddsa.adoc`
|
|
170
166
|
- Vectors: `references/NIST/ACVP-Server-1.1.0.42/gen-val/json-files/EDDSA-*-1.0/`
|
|
171
167
|
- Equivalent ECDSA module: [`./ecc.acvp.md`](./ecc.acvp.md)
|