@suveren/gateway 0.40.0 → 0.41.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/dist/control-plane/index.mjs +182 -37
- package/dist/mcp-server/http.mjs +355 -71
- package/dist/ui/assets/{index-C-lA_7Lt.js → index-CO-dj98E.js} +27 -27
- package/dist/ui/index.html +1 -1
- package/node_modules/@hap/core/README.md +3 -3
- package/node_modules/@hap/core/dist/index.d.mts +567 -123
- package/node_modules/@hap/core/dist/index.d.ts +567 -123
- package/node_modules/@hap/core/dist/index.js +869 -23
- package/node_modules/@hap/core/dist/index.mjs +829 -22
- package/node_modules/@hap/core/node_modules/@hpke/core/LICENSE +21 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/README.md +263 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.d.ts +11 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.js +6 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/package.json +3 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.d.ts +80 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.js +167 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.d.ts +34 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.js +56 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.d.ts +145 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.js +326 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.d.ts +15 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.js +68 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.d.ts +19 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.js +62 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.d.ts +17 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.js +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.d.ts +13 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.js +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.d.ts +8 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.js +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.d.ts +40 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.js +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.d.ts +17 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.js +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.d.ts +7 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.js +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.d.ts +10 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.js +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.d.ts +26 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.js +112 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts +24 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.js +214 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts +24 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.js +214 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.d.ts +38 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.js +66 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.d.ts +38 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.js +66 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.d.ts +5 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.js +28 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.d.ts +236 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.js +235 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.d.ts +6 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.js +38 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.d.ts +11 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.js +45 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.d.ts +2 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.js +6 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/package.json +46 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.d.ts +11 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.js +47 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/package.json +3 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.d.ts +80 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.js +183 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.d.ts +34 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.js +70 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.d.ts +145 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.js +340 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.d.ts +15 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.js +82 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.d.ts +19 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.js +78 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.d.ts +17 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.js +12 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.d.ts +13 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.js +12 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.d.ts +8 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.js +12 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.d.ts +40 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.js +12 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.d.ts +17 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.js +12 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.d.ts +7 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.js +12 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.d.ts +10 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.js +12 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.d.ts +26 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.js +128 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts +24 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.js +228 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts +24 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.js +228 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.d.ts +38 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.js +80 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.d.ts +38 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.js +80 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.d.ts +5 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.js +42 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.d.ts +236 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.js +255 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.d.ts +6 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.js +52 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.d.ts +11 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.js +59 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.d.ts +2 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.d.ts.map +1 -0
- package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.js +19 -0
- package/node_modules/@hap/core/package.json +2 -1
- package/node_modules/@hap/core/src/canonicalize.ts +9 -0
- package/node_modules/@hap/core/src/commitment-modes.ts +21 -9
- package/node_modules/@hap/core/src/errors.ts +24 -8
- package/node_modules/@hap/core/src/gatekeeper.ts +52 -8
- package/node_modules/@hap/core/src/index.ts +5 -1
- package/node_modules/@hap/core/src/issuance.ts +250 -0
- package/node_modules/@hap/core/src/mandate.ts +52 -14
- package/node_modules/@hap/core/src/owner-signature.ts +86 -39
- package/node_modules/@hap/core/src/profile.ts +45 -0
- package/node_modules/@hap/core/src/proposal-content.ts +219 -0
- package/node_modules/@hap/core/src/ticket-projection.ts +167 -0
- package/node_modules/@hap/core/src/ticket.ts +254 -20
- package/node_modules/@hap/core/src/types.ts +33 -5
- package/node_modules/@hap/core/src/verifier-policy.ts +178 -0
- package/node_modules/@hap/core/src/versions.ts +50 -19
- package/node_modules/@hono/node-server/dist/index.cjs +31 -6
- package/node_modules/@hono/node-server/dist/index.mjs +31 -6
- package/node_modules/@hono/node-server/package.json +1 -1
- package/node_modules/@hpke/common/esm/package.json +5 -1
- package/node_modules/@hpke/common/esm/src/curve/montgomery.d.ts +2 -2
- package/node_modules/@hpke/common/esm/src/curve/montgomery.d.ts.map +1 -1
- package/node_modules/@hpke/common/esm/src/curve/montgomery.js +41 -26
- package/node_modules/@hpke/common/esm/src/hash/sha3.d.ts.map +1 -1
- package/node_modules/@hpke/common/esm/src/hash/sha3.js +0 -15
- package/node_modules/@hpke/common/esm/src/kdfs/hkdf.d.ts +2 -1
- package/node_modules/@hpke/common/esm/src/kdfs/hkdf.d.ts.map +1 -1
- package/node_modules/@hpke/common/esm/src/kdfs/hkdf.js +12 -2
- package/node_modules/@hpke/common/esm/src/kems/dhkemPrimitives/xCurve.d.ts.map +1 -1
- package/node_modules/@hpke/common/esm/src/kems/dhkemPrimitives/xCurve.js +14 -3
- package/node_modules/@hpke/common/esm/src/utils/misc.d.ts +6 -0
- package/node_modules/@hpke/common/esm/src/utils/misc.d.ts.map +1 -1
- package/node_modules/@hpke/common/esm/src/utils/misc.js +43 -10
- package/node_modules/@hpke/common/esm/src/utils/noble.d.ts +1 -1
- package/node_modules/@hpke/common/esm/src/utils/noble.d.ts.map +1 -1
- package/node_modules/@hpke/common/esm/src/utils/noble.js +21 -10
- package/node_modules/@hpke/common/package.json +5 -1
- package/node_modules/@hpke/common/script/src/curve/montgomery.d.ts +2 -2
- package/node_modules/@hpke/common/script/src/curve/montgomery.d.ts.map +1 -1
- package/node_modules/@hpke/common/script/src/curve/montgomery.js +40 -25
- package/node_modules/@hpke/common/script/src/hash/sha3.d.ts.map +1 -1
- package/node_modules/@hpke/common/script/src/hash/sha3.js +0 -15
- package/node_modules/@hpke/common/script/src/kdfs/hkdf.d.ts +2 -1
- package/node_modules/@hpke/common/script/src/kdfs/hkdf.d.ts.map +1 -1
- package/node_modules/@hpke/common/script/src/kdfs/hkdf.js +12 -2
- package/node_modules/@hpke/common/script/src/kems/dhkemPrimitives/xCurve.d.ts.map +1 -1
- package/node_modules/@hpke/common/script/src/kems/dhkemPrimitives/xCurve.js +13 -2
- package/node_modules/@hpke/common/script/src/utils/misc.d.ts +6 -0
- package/node_modules/@hpke/common/script/src/utils/misc.d.ts.map +1 -1
- package/node_modules/@hpke/common/script/src/utils/misc.js +43 -9
- package/node_modules/@hpke/common/script/src/utils/noble.d.ts +1 -1
- package/node_modules/@hpke/common/script/src/utils/noble.d.ts.map +1 -1
- package/node_modules/@hpke/common/script/src/utils/noble.js +22 -11
- package/node_modules/@hpke/core/README.md +56 -56
- package/node_modules/@hpke/core/esm/package.json +2 -1
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts +3 -21
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -1
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.js +3 -201
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts +3 -21
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts.map +1 -1
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.js +3 -201
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.d.ts +26 -0
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.d.ts.map +1 -0
- package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.js +216 -0
- package/node_modules/@hpke/core/package.json +6 -2
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts +3 -21
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -1
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.js +4 -202
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts +3 -21
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts.map +1 -1
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.js +4 -202
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.d.ts +26 -0
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.d.ts.map +1 -0
- package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.js +230 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/encodeurl/README.md +14 -0
- package/node_modules/encodeurl/index.js +5 -10
- package/node_modules/encodeurl/package.json +10 -6
- package/node_modules/express-rate-limit/dist/index.cjs +7 -3
- package/node_modules/express-rate-limit/dist/index.mjs +7 -3
- package/node_modules/express-rate-limit/package.json +10 -10
- package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
- package/node_modules/hono/dist/cjs/context.js +1 -1
- package/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
- package/node_modules/hono/dist/cjs/hono-base.js +4 -10
- package/node_modules/hono/dist/cjs/hono.js +0 -1
- package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
- package/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
- package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
- package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
- package/node_modules/hono/dist/cjs/utils/mount.js +35 -0
- package/node_modules/hono/dist/cjs/utils/url.js +10 -0
- package/node_modules/hono/dist/cjs/validator/validator.js +1 -1
- package/node_modules/hono/dist/context.js +1 -1
- package/node_modules/hono/dist/helper/css/common.js +3 -5
- package/node_modules/hono/dist/hono-base.js +4 -10
- package/node_modules/hono/dist/hono.js +0 -1
- package/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
- package/node_modules/hono/dist/middleware/csrf/index.js +2 -2
- package/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
- package/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
- package/node_modules/hono/dist/middleware/language/language.js +1 -1
- package/node_modules/hono/dist/middleware/mount/index.js +4 -4
- package/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
- package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
- package/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
- package/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
- package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
- package/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
- package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
- package/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
- package/node_modules/hono/dist/utils/mount.js +34 -0
- package/node_modules/hono/dist/utils/url.js +10 -1
- package/node_modules/hono/dist/validator/validator.js +1 -1
- package/node_modules/hono/package.json +1 -1
- package/node_modules/ip-address/README.md +39 -39
- package/node_modules/ip-address/dist/ipv6.js +1 -1
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +3 -0
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -0
- package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -0
- package/node_modules/jose/dist/types/types.d.ts +8 -0
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -0
- package/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
- package/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
- package/node_modules/jose/package.json +1 -1
- package/node_modules/qs/CHANGELOG.md +29 -22
- package/node_modules/qs/dist/qs.js +14 -14
- package/node_modules/qs/eslint.config.mjs +6 -0
- package/node_modules/qs/lib/stringify.js +1 -1
- package/node_modules/qs/package.json +5 -5
- package/node_modules/qs/test/stringify.js +74 -0
- package/package.json +2 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "@hpke/common", "./src/aeads/aesGcm.js", "./src/aeads/exportOnly.js", "./src/native.js", "./src/kems/dhkemX25519.js", "./src/kems/dhkemX448.js"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DhkemX448HkdfSha512 = exports.DhkemX25519HkdfSha256 = exports.HkdfSha512 = exports.HkdfSha384 = exports.HkdfSha256 = exports.DhkemP521HkdfSha512 = exports.DhkemP384HkdfSha384 = exports.DhkemP256HkdfSha256 = exports.CipherSuite = exports.ExportOnly = exports.Aes256Gcm = exports.Aes128Gcm = exports.ValidationError = exports.SerializeError = exports.SealError = exports.OpenError = exports.NotSupportedError = exports.MessageLimitReachedError = exports.KemId = exports.KdfId = exports.InvalidParamError = exports.HpkeError = exports.ExportError = exports.EncapError = exports.DeserializeError = exports.DeriveKeyPairError = exports.DecapError = exports.AeadId = void 0;
|
|
13
|
+
var common_1 = require("@hpke/common");
|
|
14
|
+
Object.defineProperty(exports, "AeadId", { enumerable: true, get: function () { return common_1.AeadId; } });
|
|
15
|
+
Object.defineProperty(exports, "DecapError", { enumerable: true, get: function () { return common_1.DecapError; } });
|
|
16
|
+
Object.defineProperty(exports, "DeriveKeyPairError", { enumerable: true, get: function () { return common_1.DeriveKeyPairError; } });
|
|
17
|
+
Object.defineProperty(exports, "DeserializeError", { enumerable: true, get: function () { return common_1.DeserializeError; } });
|
|
18
|
+
Object.defineProperty(exports, "EncapError", { enumerable: true, get: function () { return common_1.EncapError; } });
|
|
19
|
+
Object.defineProperty(exports, "ExportError", { enumerable: true, get: function () { return common_1.ExportError; } });
|
|
20
|
+
Object.defineProperty(exports, "HpkeError", { enumerable: true, get: function () { return common_1.HpkeError; } });
|
|
21
|
+
Object.defineProperty(exports, "InvalidParamError", { enumerable: true, get: function () { return common_1.InvalidParamError; } });
|
|
22
|
+
Object.defineProperty(exports, "KdfId", { enumerable: true, get: function () { return common_1.KdfId; } });
|
|
23
|
+
Object.defineProperty(exports, "KemId", { enumerable: true, get: function () { return common_1.KemId; } });
|
|
24
|
+
Object.defineProperty(exports, "MessageLimitReachedError", { enumerable: true, get: function () { return common_1.MessageLimitReachedError; } });
|
|
25
|
+
Object.defineProperty(exports, "NotSupportedError", { enumerable: true, get: function () { return common_1.NotSupportedError; } });
|
|
26
|
+
Object.defineProperty(exports, "OpenError", { enumerable: true, get: function () { return common_1.OpenError; } });
|
|
27
|
+
Object.defineProperty(exports, "SealError", { enumerable: true, get: function () { return common_1.SealError; } });
|
|
28
|
+
Object.defineProperty(exports, "SerializeError", { enumerable: true, get: function () { return common_1.SerializeError; } });
|
|
29
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return common_1.ValidationError; } });
|
|
30
|
+
var aesGcm_js_1 = require("./src/aeads/aesGcm.js");
|
|
31
|
+
Object.defineProperty(exports, "Aes128Gcm", { enumerable: true, get: function () { return aesGcm_js_1.Aes128Gcm; } });
|
|
32
|
+
Object.defineProperty(exports, "Aes256Gcm", { enumerable: true, get: function () { return aesGcm_js_1.Aes256Gcm; } });
|
|
33
|
+
var exportOnly_js_1 = require("./src/aeads/exportOnly.js");
|
|
34
|
+
Object.defineProperty(exports, "ExportOnly", { enumerable: true, get: function () { return exportOnly_js_1.ExportOnly; } });
|
|
35
|
+
var native_js_1 = require("./src/native.js");
|
|
36
|
+
Object.defineProperty(exports, "CipherSuite", { enumerable: true, get: function () { return native_js_1.CipherSuite; } });
|
|
37
|
+
Object.defineProperty(exports, "DhkemP256HkdfSha256", { enumerable: true, get: function () { return native_js_1.DhkemP256HkdfSha256; } });
|
|
38
|
+
Object.defineProperty(exports, "DhkemP384HkdfSha384", { enumerable: true, get: function () { return native_js_1.DhkemP384HkdfSha384; } });
|
|
39
|
+
Object.defineProperty(exports, "DhkemP521HkdfSha512", { enumerable: true, get: function () { return native_js_1.DhkemP521HkdfSha512; } });
|
|
40
|
+
Object.defineProperty(exports, "HkdfSha256", { enumerable: true, get: function () { return native_js_1.HkdfSha256; } });
|
|
41
|
+
Object.defineProperty(exports, "HkdfSha384", { enumerable: true, get: function () { return native_js_1.HkdfSha384; } });
|
|
42
|
+
Object.defineProperty(exports, "HkdfSha512", { enumerable: true, get: function () { return native_js_1.HkdfSha512; } });
|
|
43
|
+
var dhkemX25519_js_1 = require("./src/kems/dhkemX25519.js");
|
|
44
|
+
Object.defineProperty(exports, "DhkemX25519HkdfSha256", { enumerable: true, get: function () { return dhkemX25519_js_1.DhkemX25519HkdfSha256; } });
|
|
45
|
+
var dhkemX448_js_1 = require("./src/kems/dhkemX448.js");
|
|
46
|
+
Object.defineProperty(exports, "DhkemX448HkdfSha512", { enumerable: true, get: function () { return dhkemX448_js_1.DhkemX448HkdfSha512; } });
|
|
47
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { AeadEncryptionContext, AeadInterface } from "@hpke/common";
|
|
2
|
+
import { AeadId, NativeAlgorithm } from "@hpke/common";
|
|
3
|
+
export declare class AesGcmContext extends NativeAlgorithm implements AeadEncryptionContext {
|
|
4
|
+
private _rawKey;
|
|
5
|
+
private _key;
|
|
6
|
+
constructor(key: ArrayBufferLike | ArrayBufferView);
|
|
7
|
+
seal(iv: ArrayBufferLike | ArrayBufferView, data: ArrayBufferLike | ArrayBufferView, aad: ArrayBufferLike | ArrayBufferView): Promise<ArrayBuffer>;
|
|
8
|
+
open(iv: ArrayBufferLike | ArrayBufferView, data: ArrayBufferLike | ArrayBufferView, aad: ArrayBufferLike | ArrayBufferView): Promise<ArrayBuffer>;
|
|
9
|
+
protected _setupKey(): Promise<void>;
|
|
10
|
+
private _importKey;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The AES-128-GCM for HPKE AEAD implementing {@link AeadInterface}.
|
|
14
|
+
*
|
|
15
|
+
* When using `@hpke/core`, the instance of this class must be specified
|
|
16
|
+
* to the `aead` parameter of {@link CipherSuiteParams} instead of `AeadId.Aes128Gcm`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* import {
|
|
22
|
+
* Aes128Gcm,
|
|
23
|
+
* CipherSuite,
|
|
24
|
+
* DhkemP256HkdfSha256,
|
|
25
|
+
* HkdfSha256,
|
|
26
|
+
* } from "@hpke/core";
|
|
27
|
+
*
|
|
28
|
+
* const suite = new CipherSuite({
|
|
29
|
+
* kem: new DhkemP256HkdfSha256(),
|
|
30
|
+
* kdf: new HkdfSha256(),
|
|
31
|
+
* aead: new Aes128Gcm(),
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare class Aes128Gcm implements AeadInterface {
|
|
36
|
+
/** AeadId.Aes128Gcm (0x0001) */
|
|
37
|
+
readonly id: AeadId;
|
|
38
|
+
/** 16 */
|
|
39
|
+
readonly keySize: number;
|
|
40
|
+
/** 12 */
|
|
41
|
+
readonly nonceSize: number;
|
|
42
|
+
/** 16 */
|
|
43
|
+
readonly tagSize: number;
|
|
44
|
+
createEncryptionContext(key: ArrayBufferLike | ArrayBufferView): AeadEncryptionContext;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The AES-256-GCM for HPKE AEAD implementing {@link AeadInterface}.
|
|
48
|
+
*
|
|
49
|
+
* When using `@hpke/core`, the instance of this class must be specified
|
|
50
|
+
* to the `aead` parameter of {@link CipherSuiteParams} instead of `AeadId.Aes256Gcm`
|
|
51
|
+
* as follows:
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* import {
|
|
57
|
+
* Aes256Gcm,
|
|
58
|
+
* CipherSuite,
|
|
59
|
+
* DhkemP256HkdfSha256,
|
|
60
|
+
* HkdfSha256,
|
|
61
|
+
* } from "@hpke/core";
|
|
62
|
+
*
|
|
63
|
+
* const suite = new CipherSuite({
|
|
64
|
+
* kem: new DhkemP256HkdfSha256(),
|
|
65
|
+
* kdf: new HkdfSha256(),
|
|
66
|
+
* aead: new Aes256Gcm(),
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare class Aes256Gcm extends Aes128Gcm {
|
|
71
|
+
/** AeadId.Aes256Gcm (0x0002) */
|
|
72
|
+
id: AeadId;
|
|
73
|
+
/** 32 */
|
|
74
|
+
keySize: number;
|
|
75
|
+
/** 12 */
|
|
76
|
+
nonceSize: number;
|
|
77
|
+
/** 16 */
|
|
78
|
+
tagSize: number;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=aesGcm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aesGcm.d.ts","sourceRoot":"","sources":["../../../src/src/aeads/aesGcm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAEL,MAAM,EACN,eAAe,EAEhB,MAAM,cAAc,CAAC;AAEtB,qBAAa,aAAc,SAAQ,eACjC,YAAW,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,IAAI,CAAoC;gBAE7B,GAAG,EAAE,eAAe,GAAG,eAAe;IAK5C,IAAI,CACf,EAAE,EAAE,eAAe,GAAG,eAAe,EACrC,IAAI,EAAE,eAAe,GAAG,eAAe,EACvC,GAAG,EAAE,eAAe,GAAG,eAAe,GACrC,OAAO,CAAC,WAAW,CAAC;IAeV,IAAI,CACf,EAAE,EAAE,eAAe,GAAG,eAAe,EACrC,IAAI,EAAE,eAAe,GAAG,eAAe,EACvC,GAAG,EAAE,eAAe,GAAG,eAAe,GACrC,OAAO,CAAC,WAAW,CAAC;cAeP,SAAS;YAWX,UAAU;CASzB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,SAAU,YAAW,aAAa;IAC7C,gCAAgC;IAChC,SAAgB,EAAE,EAAE,MAAM,CAAoB;IAC9C,SAAS;IACT,SAAgB,OAAO,EAAE,MAAM,CAAM;IACrC,SAAS;IACT,SAAgB,SAAS,EAAE,MAAM,CAAM;IACvC,SAAS;IACT,SAAgB,OAAO,EAAE,MAAM,CAAM;IAE9B,uBAAuB,CAC5B,GAAG,EAAE,eAAe,GAAG,eAAe,GACrC,qBAAqB;CAGzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,gCAAgC;IACvB,EAAE,EAAE,MAAM,CAAoB;IACvC,SAAS;IACA,OAAO,EAAE,MAAM,CAAM;IAC9B,SAAS;IACA,SAAS,EAAE,MAAM,CAAM;IAChC,SAAS;IACA,OAAO,EAAE,MAAM,CAAM;CAC/B"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "@hpke/common"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Aes256Gcm = exports.Aes128Gcm = exports.AesGcmContext = void 0;
|
|
13
|
+
const common_1 = require("@hpke/common");
|
|
14
|
+
class AesGcmContext extends common_1.NativeAlgorithm {
|
|
15
|
+
constructor(key) {
|
|
16
|
+
super();
|
|
17
|
+
Object.defineProperty(this, "_rawKey", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(this, "_key", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: undefined
|
|
28
|
+
});
|
|
29
|
+
this._rawKey = (0, common_1.toArrayBuffer)(key);
|
|
30
|
+
}
|
|
31
|
+
async seal(iv, data, aad) {
|
|
32
|
+
await this._setupKey();
|
|
33
|
+
const alg = {
|
|
34
|
+
name: "AES-GCM",
|
|
35
|
+
iv: (0, common_1.toArrayBuffer)(iv),
|
|
36
|
+
additionalData: (0, common_1.toArrayBuffer)(aad),
|
|
37
|
+
};
|
|
38
|
+
const ct = await this._api.encrypt(alg, this._key, (0, common_1.toArrayBuffer)(data));
|
|
39
|
+
return ct;
|
|
40
|
+
}
|
|
41
|
+
async open(iv, data, aad) {
|
|
42
|
+
await this._setupKey();
|
|
43
|
+
const alg = {
|
|
44
|
+
name: "AES-GCM",
|
|
45
|
+
iv: (0, common_1.toArrayBuffer)(iv),
|
|
46
|
+
additionalData: (0, common_1.toArrayBuffer)(aad),
|
|
47
|
+
};
|
|
48
|
+
const pt = await this._api.decrypt(alg, this._key, (0, common_1.toArrayBuffer)(data));
|
|
49
|
+
return pt;
|
|
50
|
+
}
|
|
51
|
+
async _setupKey() {
|
|
52
|
+
if (this._key !== undefined) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
await this._setup();
|
|
56
|
+
const key = await this._importKey(this._rawKey);
|
|
57
|
+
(new Uint8Array(this._rawKey)).fill(0);
|
|
58
|
+
this._key = key;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
async _importKey(key) {
|
|
62
|
+
return await this._api.importKey("raw", key, { name: "AES-GCM" }, true, common_1.AEAD_USAGES);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.AesGcmContext = AesGcmContext;
|
|
66
|
+
/**
|
|
67
|
+
* The AES-128-GCM for HPKE AEAD implementing {@link AeadInterface}.
|
|
68
|
+
*
|
|
69
|
+
* When using `@hpke/core`, the instance of this class must be specified
|
|
70
|
+
* to the `aead` parameter of {@link CipherSuiteParams} instead of `AeadId.Aes128Gcm`.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
*
|
|
74
|
+
* ```ts
|
|
75
|
+
* import {
|
|
76
|
+
* Aes128Gcm,
|
|
77
|
+
* CipherSuite,
|
|
78
|
+
* DhkemP256HkdfSha256,
|
|
79
|
+
* HkdfSha256,
|
|
80
|
+
* } from "@hpke/core";
|
|
81
|
+
*
|
|
82
|
+
* const suite = new CipherSuite({
|
|
83
|
+
* kem: new DhkemP256HkdfSha256(),
|
|
84
|
+
* kdf: new HkdfSha256(),
|
|
85
|
+
* aead: new Aes128Gcm(),
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
class Aes128Gcm {
|
|
90
|
+
constructor() {
|
|
91
|
+
/** AeadId.Aes128Gcm (0x0001) */
|
|
92
|
+
Object.defineProperty(this, "id", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
configurable: true,
|
|
95
|
+
writable: true,
|
|
96
|
+
value: common_1.AeadId.Aes128Gcm
|
|
97
|
+
});
|
|
98
|
+
/** 16 */
|
|
99
|
+
Object.defineProperty(this, "keySize", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
configurable: true,
|
|
102
|
+
writable: true,
|
|
103
|
+
value: 16
|
|
104
|
+
});
|
|
105
|
+
/** 12 */
|
|
106
|
+
Object.defineProperty(this, "nonceSize", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
configurable: true,
|
|
109
|
+
writable: true,
|
|
110
|
+
value: 12
|
|
111
|
+
});
|
|
112
|
+
/** 16 */
|
|
113
|
+
Object.defineProperty(this, "tagSize", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true,
|
|
116
|
+
writable: true,
|
|
117
|
+
value: 16
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
createEncryptionContext(key) {
|
|
121
|
+
return new AesGcmContext(key);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.Aes128Gcm = Aes128Gcm;
|
|
125
|
+
/**
|
|
126
|
+
* The AES-256-GCM for HPKE AEAD implementing {@link AeadInterface}.
|
|
127
|
+
*
|
|
128
|
+
* When using `@hpke/core`, the instance of this class must be specified
|
|
129
|
+
* to the `aead` parameter of {@link CipherSuiteParams} instead of `AeadId.Aes256Gcm`
|
|
130
|
+
* as follows:
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
*
|
|
134
|
+
* ```ts
|
|
135
|
+
* import {
|
|
136
|
+
* Aes256Gcm,
|
|
137
|
+
* CipherSuite,
|
|
138
|
+
* DhkemP256HkdfSha256,
|
|
139
|
+
* HkdfSha256,
|
|
140
|
+
* } from "@hpke/core";
|
|
141
|
+
*
|
|
142
|
+
* const suite = new CipherSuite({
|
|
143
|
+
* kem: new DhkemP256HkdfSha256(),
|
|
144
|
+
* kdf: new HkdfSha256(),
|
|
145
|
+
* aead: new Aes256Gcm(),
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
class Aes256Gcm extends Aes128Gcm {
|
|
150
|
+
constructor() {
|
|
151
|
+
super(...arguments);
|
|
152
|
+
/** AeadId.Aes256Gcm (0x0002) */
|
|
153
|
+
Object.defineProperty(this, "id", {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
configurable: true,
|
|
156
|
+
writable: true,
|
|
157
|
+
value: common_1.AeadId.Aes256Gcm
|
|
158
|
+
});
|
|
159
|
+
/** 32 */
|
|
160
|
+
Object.defineProperty(this, "keySize", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
configurable: true,
|
|
163
|
+
writable: true,
|
|
164
|
+
value: 32
|
|
165
|
+
});
|
|
166
|
+
/** 12 */
|
|
167
|
+
Object.defineProperty(this, "nonceSize", {
|
|
168
|
+
enumerable: true,
|
|
169
|
+
configurable: true,
|
|
170
|
+
writable: true,
|
|
171
|
+
value: 12
|
|
172
|
+
});
|
|
173
|
+
/** 16 */
|
|
174
|
+
Object.defineProperty(this, "tagSize", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
configurable: true,
|
|
177
|
+
writable: true,
|
|
178
|
+
value: 16
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
exports.Aes256Gcm = Aes256Gcm;
|
|
183
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AeadEncryptionContext, AeadInterface } from "@hpke/common";
|
|
2
|
+
import { AeadId } from "@hpke/common";
|
|
3
|
+
/**
|
|
4
|
+
* The ExportOnly mode for HPKE AEAD implementing {@link AeadInterface}.
|
|
5
|
+
*
|
|
6
|
+
* When using `@hpke/core`, the instance of this class must be specified
|
|
7
|
+
* to the `aead` parameter of {@link CipherSuiteParams} instead of `AeadId.ExportOnly`
|
|
8
|
+
* as follows:
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import {
|
|
14
|
+
* CipherSuite,
|
|
15
|
+
* DhkemP256HkdfSha256,
|
|
16
|
+
* ExportOnly,
|
|
17
|
+
* HkdfSha256,
|
|
18
|
+
* } from "@hpke/core";
|
|
19
|
+
*
|
|
20
|
+
* const suite = new CipherSuite({
|
|
21
|
+
* kem: new DhkemP256HkdfSha256(),
|
|
22
|
+
* kdf: new HkdfSha256(),
|
|
23
|
+
* aead: new ExportOnly(),
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class ExportOnly implements AeadInterface {
|
|
28
|
+
readonly id: AeadId;
|
|
29
|
+
readonly keySize: number;
|
|
30
|
+
readonly nonceSize: number;
|
|
31
|
+
readonly tagSize: number;
|
|
32
|
+
createEncryptionContext(_key: ArrayBufferLike | ArrayBufferView): AeadEncryptionContext;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=exportOnly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportOnly.d.ts","sourceRoot":"","sources":["../../../src/src/aeads/exportOnly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,MAAM,EAAqB,MAAM,cAAc,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,UAAW,YAAW,aAAa;IAC9C,SAAgB,EAAE,EAAE,MAAM,CAAqB;IAC/C,SAAgB,OAAO,EAAE,MAAM,CAAK;IACpC,SAAgB,SAAS,EAAE,MAAM,CAAK;IACtC,SAAgB,OAAO,EAAE,MAAM,CAAK;IAE7B,uBAAuB,CAC5B,IAAI,EAAE,eAAe,GAAG,eAAe,GACtC,qBAAqB;CAGzB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "@hpke/common"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ExportOnly = void 0;
|
|
13
|
+
const common_1 = require("@hpke/common");
|
|
14
|
+
/**
|
|
15
|
+
* The ExportOnly mode for HPKE AEAD implementing {@link AeadInterface}.
|
|
16
|
+
*
|
|
17
|
+
* When using `@hpke/core`, the instance of this class must be specified
|
|
18
|
+
* to the `aead` parameter of {@link CipherSuiteParams} instead of `AeadId.ExportOnly`
|
|
19
|
+
* as follows:
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import {
|
|
25
|
+
* CipherSuite,
|
|
26
|
+
* DhkemP256HkdfSha256,
|
|
27
|
+
* ExportOnly,
|
|
28
|
+
* HkdfSha256,
|
|
29
|
+
* } from "@hpke/core";
|
|
30
|
+
*
|
|
31
|
+
* const suite = new CipherSuite({
|
|
32
|
+
* kem: new DhkemP256HkdfSha256(),
|
|
33
|
+
* kdf: new HkdfSha256(),
|
|
34
|
+
* aead: new ExportOnly(),
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
class ExportOnly {
|
|
39
|
+
constructor() {
|
|
40
|
+
Object.defineProperty(this, "id", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: common_1.AeadId.ExportOnly
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(this, "keySize", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true,
|
|
49
|
+
writable: true,
|
|
50
|
+
value: 0
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(this, "nonceSize", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: 0
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(this, "tagSize", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
value: 0
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
createEncryptionContext(_key) {
|
|
66
|
+
throw new common_1.NotSupportedError("Export only");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.ExportOnly = ExportOnly;
|
|
70
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { AeadInterface, KdfInterface, KemInterface, RecipientContextParams, SenderContextParams } from "@hpke/common";
|
|
2
|
+
import { NativeAlgorithm } from "@hpke/common";
|
|
3
|
+
import type { CipherSuiteParams } from "./interfaces/cipherSuiteParams.js";
|
|
4
|
+
import type { RecipientContext, SenderContext } from "./interfaces/encryptionContext.js";
|
|
5
|
+
import type { CipherSuiteSealResponse } from "./interfaces/responses.js";
|
|
6
|
+
/**
|
|
7
|
+
* The Hybrid Public Key Encryption (HPKE) ciphersuite,
|
|
8
|
+
* which is implemented using only
|
|
9
|
+
* {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}.
|
|
10
|
+
*
|
|
11
|
+
* This is the super class of {@link CipherSuite} and the same as
|
|
12
|
+
* {@link https://jsr.io/@hpke/core/doc/~/CipherSuite | @hpke/core#CipherSuite} as follows:
|
|
13
|
+
* which supports only the ciphersuites that can be implemented on the native
|
|
14
|
+
* {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}.
|
|
15
|
+
* Therefore, the following cryptographic algorithms are not supported for now:
|
|
16
|
+
* - DHKEM(X25519, HKDF-SHA256)
|
|
17
|
+
* - DHKEM(X448, HKDF-SHA512)
|
|
18
|
+
* - ChaCha20Poly1305
|
|
19
|
+
*
|
|
20
|
+
* In addtion, the HKDF functions contained in this class can only derive
|
|
21
|
+
* keys of the same length as the `hashSize`.
|
|
22
|
+
*
|
|
23
|
+
* If you want to use the unsupported cryptographic algorithms
|
|
24
|
+
* above or derive keys longer than the `hashSize`,
|
|
25
|
+
* please use {@link CipherSuite}.
|
|
26
|
+
*
|
|
27
|
+
* This class provides following functions:
|
|
28
|
+
*
|
|
29
|
+
* - Creates encryption contexts both for senders and recipients.
|
|
30
|
+
* - {@link createSenderContext}
|
|
31
|
+
* - {@link createRecipientContext}
|
|
32
|
+
* - Provides single-shot encryption API.
|
|
33
|
+
* - {@link seal}
|
|
34
|
+
* - {@link open}
|
|
35
|
+
*
|
|
36
|
+
* The calling of the constructor of this class is the starting
|
|
37
|
+
* point for HPKE operations for both senders and recipients.
|
|
38
|
+
*
|
|
39
|
+
* @example Use only ciphersuites supported by Web Cryptography API.
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* import {
|
|
43
|
+
* Aes128Gcm,
|
|
44
|
+
* DhkemP256HkdfSha256,
|
|
45
|
+
* HkdfSha256,
|
|
46
|
+
* CipherSuite,
|
|
47
|
+
* } from "@hpke/core";
|
|
48
|
+
*
|
|
49
|
+
* const suite = new CipherSuite({
|
|
50
|
+
* kem: new DhkemP256HkdfSha256(),
|
|
51
|
+
* kdf: new HkdfSha256(),
|
|
52
|
+
* aead: new Aes128Gcm(),
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @example Use a ciphersuite which is currently not supported by Web Cryptography API.
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { Aes128Gcm, HkdfSha256, CipherSuite } from "@hpke/core";
|
|
60
|
+
* // Use an extension module.
|
|
61
|
+
* import { DhkemX25519HkdfSha256 } from "@hpke/dhkem-x25519";
|
|
62
|
+
*
|
|
63
|
+
* const suite = new CipherSuite({
|
|
64
|
+
* kem: new DhkemX25519HkdfSha256(),
|
|
65
|
+
* kdf: new HkdfSha256(),
|
|
66
|
+
* aead: new Aes128Gcm(),
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare class CipherSuiteNative extends NativeAlgorithm {
|
|
71
|
+
protected _kem: KemInterface;
|
|
72
|
+
private _kdf;
|
|
73
|
+
private _aead;
|
|
74
|
+
private _suiteId;
|
|
75
|
+
/**
|
|
76
|
+
* @param params A set of parameters for building a cipher suite.
|
|
77
|
+
*
|
|
78
|
+
* If the error occurred, throws {@link InvalidParamError}.
|
|
79
|
+
*
|
|
80
|
+
* @throws {@link InvalidParamError}
|
|
81
|
+
*/
|
|
82
|
+
constructor(params: CipherSuiteParams);
|
|
83
|
+
/**
|
|
84
|
+
* Gets the KEM context of the ciphersuite.
|
|
85
|
+
*/
|
|
86
|
+
get kem(): KemInterface;
|
|
87
|
+
/**
|
|
88
|
+
* Gets the KDF context of the ciphersuite.
|
|
89
|
+
*/
|
|
90
|
+
get kdf(): KdfInterface;
|
|
91
|
+
/**
|
|
92
|
+
* Gets the AEAD context of the ciphersuite.
|
|
93
|
+
*/
|
|
94
|
+
get aead(): AeadInterface;
|
|
95
|
+
/**
|
|
96
|
+
* Creates an encryption context for a sender.
|
|
97
|
+
*
|
|
98
|
+
* If the error occurred, throws {@link DecapError} | {@link ValidationError}.
|
|
99
|
+
*
|
|
100
|
+
* @param params A set of parameters for the sender encryption context.
|
|
101
|
+
* @returns A sender encryption context.
|
|
102
|
+
* @throws {@link EncapError}, {@link ValidationError}
|
|
103
|
+
*/
|
|
104
|
+
createSenderContext(params: SenderContextParams): Promise<SenderContext>;
|
|
105
|
+
/**
|
|
106
|
+
* Creates an encryption context for a recipient.
|
|
107
|
+
*
|
|
108
|
+
* If the error occurred, throws {@link DecapError}
|
|
109
|
+
* | {@link DeserializeError} | {@link ValidationError}.
|
|
110
|
+
*
|
|
111
|
+
* @param params A set of parameters for the recipient encryption context.
|
|
112
|
+
* @returns A recipient encryption context.
|
|
113
|
+
* @throws {@link DecapError}, {@link DeserializeError}, {@link ValidationError}
|
|
114
|
+
*/
|
|
115
|
+
createRecipientContext(params: RecipientContextParams): Promise<RecipientContext>;
|
|
116
|
+
/**
|
|
117
|
+
* Encrypts a message to a recipient.
|
|
118
|
+
*
|
|
119
|
+
* If the error occurred, throws `EncapError` | `MessageLimitReachedError` | `SealError` | `ValidationError`.
|
|
120
|
+
*
|
|
121
|
+
* @param params A set of parameters for building a sender encryption context.
|
|
122
|
+
* @param pt A plain text as bytes to be encrypted.
|
|
123
|
+
* @param aad Additional authenticated data as bytes fed by an application.
|
|
124
|
+
* @returns A cipher text and an encapsulated key as bytes.
|
|
125
|
+
* @throws {@link EncapError}, {@link MessageLimitReachedError}, {@link SealError}, {@link ValidationError}
|
|
126
|
+
*/
|
|
127
|
+
seal(params: SenderContextParams, pt: ArrayBufferLike | ArrayBufferView, aad?: ArrayBufferLike | ArrayBufferView): Promise<CipherSuiteSealResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Decrypts a message from a sender.
|
|
130
|
+
*
|
|
131
|
+
* If the error occurred, throws `DecapError` | `DeserializeError` | `OpenError` | `ValidationError`.
|
|
132
|
+
*
|
|
133
|
+
* @param params A set of parameters for building a recipient encryption context.
|
|
134
|
+
* @param ct An encrypted text as bytes to be decrypted.
|
|
135
|
+
* @param aad Additional authenticated data as bytes fed by an application.
|
|
136
|
+
* @returns A decrypted plain text as bytes.
|
|
137
|
+
* @throws {@link DecapError}, {@link DeserializeError}, {@link OpenError}, {@link ValidationError}
|
|
138
|
+
*/
|
|
139
|
+
open(params: RecipientContextParams, ct: ArrayBufferLike | ArrayBufferView, aad?: ArrayBufferLike | ArrayBufferView): Promise<ArrayBuffer>;
|
|
140
|
+
private _keySchedule;
|
|
141
|
+
private _keyScheduleS;
|
|
142
|
+
private _keyScheduleR;
|
|
143
|
+
private _validateInputLength;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=cipherSuiteNative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cipherSuiteNative.d.ts","sourceRoot":"","sources":["../../src/src/cipherSuiteNative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EAEZ,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EASL,eAAe,EAEhB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAoCzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;IACpD,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,QAAQ,CAAa;IAE7B;;;;;;OAMG;gBACS,MAAM,EAAE,iBAAiB;IA4BrC;;OAEG;IACH,IAAW,GAAG,IAAI,YAAY,CAE7B;IAED;;OAEG;IACH,IAAW,GAAG,IAAI,YAAY,CAE7B;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,aAAa,CAE/B;IAED;;;;;;;;OAQG;IACU,mBAAmB,CAC9B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,aAAa,CAAC;IAgBzB;;;;;;;;;OASG;IACU,sBAAsB,CACjC,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,gBAAgB,CAAC;IAgB5B;;;;;;;;;;OAUG;IACU,IAAI,CACf,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE,eAAe,GAAG,eAAe,EACrC,GAAG,GAAE,eAAe,GAAG,eAA6C,GACnE,OAAO,CAAC,uBAAuB,CAAC;IAQnC;;;;;;;;;;OAUG;IACU,IAAI,CACf,MAAM,EAAE,sBAAsB,EAC9B,EAAE,EAAE,eAAe,GAAG,eAAe,EACrC,GAAG,GAAE,eAAe,GAAG,eAA6C,GACnE,OAAO,CAAC,WAAW,CAAC;YAoBT,YAAY;YAqFZ,aAAa;YAuBb,aAAa;IAgB3B,OAAO,CAAC,oBAAoB;CAsB7B"}
|