@suveren/gateway 0.40.0 → 0.41.1

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.
Files changed (301) hide show
  1. package/content/guides/6-risks.md +1 -0
  2. package/dist/control-plane/index.mjs +182 -37
  3. package/dist/mcp-server/http.mjs +357 -71
  4. package/dist/ui/assets/{index-C-lA_7Lt.js → index-CO-dj98E.js} +27 -27
  5. package/dist/ui/index.html +1 -1
  6. package/node_modules/@hap/core/README.md +3 -3
  7. package/node_modules/@hap/core/dist/index.d.mts +567 -123
  8. package/node_modules/@hap/core/dist/index.d.ts +567 -123
  9. package/node_modules/@hap/core/dist/index.js +869 -23
  10. package/node_modules/@hap/core/dist/index.mjs +829 -22
  11. package/node_modules/@hap/core/node_modules/@hpke/core/LICENSE +21 -0
  12. package/node_modules/@hap/core/node_modules/@hpke/core/README.md +263 -0
  13. package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.d.ts +11 -0
  14. package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.d.ts.map +1 -0
  15. package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.js +6 -0
  16. package/node_modules/@hap/core/node_modules/@hpke/core/esm/package.json +3 -0
  17. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.d.ts +80 -0
  18. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.d.ts.map +1 -0
  19. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.js +167 -0
  20. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.d.ts +34 -0
  21. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.d.ts.map +1 -0
  22. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.js +56 -0
  23. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.d.ts +145 -0
  24. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.d.ts.map +1 -0
  25. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.js +326 -0
  26. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.d.ts +15 -0
  27. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.d.ts.map +1 -0
  28. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.js +68 -0
  29. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.d.ts +19 -0
  30. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.d.ts.map +1 -0
  31. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.js +62 -0
  32. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.d.ts +17 -0
  33. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.d.ts.map +1 -0
  34. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.js +1 -0
  35. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.d.ts +13 -0
  36. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.d.ts.map +1 -0
  37. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.js +1 -0
  38. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.d.ts +8 -0
  39. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.d.ts.map +1 -0
  40. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.js +1 -0
  41. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.d.ts +40 -0
  42. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.d.ts.map +1 -0
  43. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.js +1 -0
  44. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.d.ts +17 -0
  45. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.d.ts.map +1 -0
  46. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.js +1 -0
  47. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.d.ts +7 -0
  48. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.d.ts.map +1 -0
  49. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.js +1 -0
  50. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.d.ts +10 -0
  51. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.d.ts.map +1 -0
  52. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.js +1 -0
  53. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.d.ts +26 -0
  54. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.d.ts.map +1 -0
  55. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.js +112 -0
  56. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts +24 -0
  57. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -0
  58. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.js +214 -0
  59. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts +24 -0
  60. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts.map +1 -0
  61. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.js +214 -0
  62. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.d.ts +38 -0
  63. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.d.ts.map +1 -0
  64. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.js +66 -0
  65. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.d.ts +38 -0
  66. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.d.ts.map +1 -0
  67. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.js +66 -0
  68. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.d.ts +5 -0
  69. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.d.ts.map +1 -0
  70. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.js +28 -0
  71. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.d.ts +236 -0
  72. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.d.ts.map +1 -0
  73. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.js +235 -0
  74. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.d.ts +6 -0
  75. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.d.ts.map +1 -0
  76. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.js +38 -0
  77. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.d.ts +11 -0
  78. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.d.ts.map +1 -0
  79. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.js +45 -0
  80. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.d.ts +2 -0
  81. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.d.ts.map +1 -0
  82. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.js +6 -0
  83. package/node_modules/@hap/core/node_modules/@hpke/core/package.json +46 -0
  84. package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.d.ts +11 -0
  85. package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.d.ts.map +1 -0
  86. package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.js +47 -0
  87. package/node_modules/@hap/core/node_modules/@hpke/core/script/package.json +3 -0
  88. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.d.ts +80 -0
  89. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.d.ts.map +1 -0
  90. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.js +183 -0
  91. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.d.ts +34 -0
  92. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.d.ts.map +1 -0
  93. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.js +70 -0
  94. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.d.ts +145 -0
  95. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.d.ts.map +1 -0
  96. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.js +340 -0
  97. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.d.ts +15 -0
  98. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.d.ts.map +1 -0
  99. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.js +82 -0
  100. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.d.ts +19 -0
  101. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.d.ts.map +1 -0
  102. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.js +78 -0
  103. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.d.ts +17 -0
  104. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.d.ts.map +1 -0
  105. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.js +12 -0
  106. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.d.ts +13 -0
  107. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.d.ts.map +1 -0
  108. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.js +12 -0
  109. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.d.ts +8 -0
  110. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.d.ts.map +1 -0
  111. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.js +12 -0
  112. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.d.ts +40 -0
  113. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.d.ts.map +1 -0
  114. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.js +12 -0
  115. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.d.ts +17 -0
  116. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.d.ts.map +1 -0
  117. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.js +12 -0
  118. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.d.ts +7 -0
  119. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.d.ts.map +1 -0
  120. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.js +12 -0
  121. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.d.ts +10 -0
  122. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.d.ts.map +1 -0
  123. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.js +12 -0
  124. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.d.ts +26 -0
  125. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.d.ts.map +1 -0
  126. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.js +128 -0
  127. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts +24 -0
  128. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -0
  129. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.js +228 -0
  130. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts +24 -0
  131. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts.map +1 -0
  132. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.js +228 -0
  133. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.d.ts +38 -0
  134. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.d.ts.map +1 -0
  135. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.js +80 -0
  136. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.d.ts +38 -0
  137. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.d.ts.map +1 -0
  138. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.js +80 -0
  139. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.d.ts +5 -0
  140. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.d.ts.map +1 -0
  141. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.js +42 -0
  142. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.d.ts +236 -0
  143. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.d.ts.map +1 -0
  144. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.js +255 -0
  145. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.d.ts +6 -0
  146. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.d.ts.map +1 -0
  147. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.js +52 -0
  148. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.d.ts +11 -0
  149. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.d.ts.map +1 -0
  150. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.js +59 -0
  151. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.d.ts +2 -0
  152. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.d.ts.map +1 -0
  153. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.js +19 -0
  154. package/node_modules/@hap/core/package.json +2 -1
  155. package/node_modules/@hap/core/src/canonicalize.ts +9 -0
  156. package/node_modules/@hap/core/src/commitment-modes.ts +21 -9
  157. package/node_modules/@hap/core/src/errors.ts +24 -8
  158. package/node_modules/@hap/core/src/gatekeeper.ts +52 -8
  159. package/node_modules/@hap/core/src/index.ts +5 -1
  160. package/node_modules/@hap/core/src/issuance.ts +250 -0
  161. package/node_modules/@hap/core/src/mandate.ts +52 -14
  162. package/node_modules/@hap/core/src/owner-signature.ts +86 -39
  163. package/node_modules/@hap/core/src/profile.ts +45 -0
  164. package/node_modules/@hap/core/src/proposal-content.ts +219 -0
  165. package/node_modules/@hap/core/src/ticket-projection.ts +167 -0
  166. package/node_modules/@hap/core/src/ticket.ts +254 -20
  167. package/node_modules/@hap/core/src/types.ts +33 -5
  168. package/node_modules/@hap/core/src/verifier-policy.ts +178 -0
  169. package/node_modules/@hap/core/src/versions.ts +50 -19
  170. package/node_modules/@hono/node-server/dist/index.cjs +31 -6
  171. package/node_modules/@hono/node-server/dist/index.mjs +31 -6
  172. package/node_modules/@hono/node-server/package.json +1 -1
  173. package/node_modules/@hpke/common/esm/package.json +5 -1
  174. package/node_modules/@hpke/common/esm/src/curve/montgomery.d.ts +2 -2
  175. package/node_modules/@hpke/common/esm/src/curve/montgomery.d.ts.map +1 -1
  176. package/node_modules/@hpke/common/esm/src/curve/montgomery.js +41 -26
  177. package/node_modules/@hpke/common/esm/src/hash/sha3.d.ts.map +1 -1
  178. package/node_modules/@hpke/common/esm/src/hash/sha3.js +0 -15
  179. package/node_modules/@hpke/common/esm/src/kdfs/hkdf.d.ts +2 -1
  180. package/node_modules/@hpke/common/esm/src/kdfs/hkdf.d.ts.map +1 -1
  181. package/node_modules/@hpke/common/esm/src/kdfs/hkdf.js +12 -2
  182. package/node_modules/@hpke/common/esm/src/kems/dhkemPrimitives/xCurve.d.ts.map +1 -1
  183. package/node_modules/@hpke/common/esm/src/kems/dhkemPrimitives/xCurve.js +14 -3
  184. package/node_modules/@hpke/common/esm/src/utils/misc.d.ts +6 -0
  185. package/node_modules/@hpke/common/esm/src/utils/misc.d.ts.map +1 -1
  186. package/node_modules/@hpke/common/esm/src/utils/misc.js +43 -10
  187. package/node_modules/@hpke/common/esm/src/utils/noble.d.ts +1 -1
  188. package/node_modules/@hpke/common/esm/src/utils/noble.d.ts.map +1 -1
  189. package/node_modules/@hpke/common/esm/src/utils/noble.js +21 -10
  190. package/node_modules/@hpke/common/package.json +5 -1
  191. package/node_modules/@hpke/common/script/src/curve/montgomery.d.ts +2 -2
  192. package/node_modules/@hpke/common/script/src/curve/montgomery.d.ts.map +1 -1
  193. package/node_modules/@hpke/common/script/src/curve/montgomery.js +40 -25
  194. package/node_modules/@hpke/common/script/src/hash/sha3.d.ts.map +1 -1
  195. package/node_modules/@hpke/common/script/src/hash/sha3.js +0 -15
  196. package/node_modules/@hpke/common/script/src/kdfs/hkdf.d.ts +2 -1
  197. package/node_modules/@hpke/common/script/src/kdfs/hkdf.d.ts.map +1 -1
  198. package/node_modules/@hpke/common/script/src/kdfs/hkdf.js +12 -2
  199. package/node_modules/@hpke/common/script/src/kems/dhkemPrimitives/xCurve.d.ts.map +1 -1
  200. package/node_modules/@hpke/common/script/src/kems/dhkemPrimitives/xCurve.js +13 -2
  201. package/node_modules/@hpke/common/script/src/utils/misc.d.ts +6 -0
  202. package/node_modules/@hpke/common/script/src/utils/misc.d.ts.map +1 -1
  203. package/node_modules/@hpke/common/script/src/utils/misc.js +43 -9
  204. package/node_modules/@hpke/common/script/src/utils/noble.d.ts +1 -1
  205. package/node_modules/@hpke/common/script/src/utils/noble.d.ts.map +1 -1
  206. package/node_modules/@hpke/common/script/src/utils/noble.js +22 -11
  207. package/node_modules/@hpke/core/README.md +56 -56
  208. package/node_modules/@hpke/core/esm/package.json +2 -1
  209. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts +3 -21
  210. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -1
  211. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.js +3 -201
  212. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts +3 -21
  213. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts.map +1 -1
  214. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.js +3 -201
  215. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.d.ts +26 -0
  216. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.d.ts.map +1 -0
  217. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.js +216 -0
  218. package/node_modules/@hpke/core/package.json +6 -2
  219. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts +3 -21
  220. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -1
  221. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.js +4 -202
  222. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts +3 -21
  223. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts.map +1 -1
  224. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.js +4 -202
  225. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.d.ts +26 -0
  226. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.d.ts.map +1 -0
  227. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.js +230 -0
  228. package/node_modules/@types/node/README.md +1 -1
  229. package/node_modules/@types/node/package.json +2 -2
  230. package/node_modules/@types/node/zlib.d.ts +752 -0
  231. package/node_modules/encodeurl/README.md +14 -0
  232. package/node_modules/encodeurl/index.js +5 -10
  233. package/node_modules/encodeurl/package.json +10 -6
  234. package/node_modules/express-rate-limit/dist/index.cjs +7 -3
  235. package/node_modules/express-rate-limit/dist/index.mjs +7 -3
  236. package/node_modules/express-rate-limit/package.json +10 -10
  237. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  238. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  239. package/node_modules/hono/dist/cjs/context.js +1 -1
  240. package/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
  241. package/node_modules/hono/dist/cjs/hono-base.js +4 -10
  242. package/node_modules/hono/dist/cjs/hono.js +0 -1
  243. package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
  244. package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
  245. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
  246. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
  247. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
  248. package/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
  249. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
  250. package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
  251. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
  252. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
  253. package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
  254. package/node_modules/hono/dist/cjs/utils/mount.js +35 -0
  255. package/node_modules/hono/dist/cjs/utils/url.js +10 -0
  256. package/node_modules/hono/dist/cjs/validator/validator.js +1 -1
  257. package/node_modules/hono/dist/context.js +1 -1
  258. package/node_modules/hono/dist/helper/css/common.js +3 -5
  259. package/node_modules/hono/dist/hono-base.js +4 -10
  260. package/node_modules/hono/dist/hono.js +0 -1
  261. package/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
  262. package/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
  263. package/node_modules/hono/dist/middleware/csrf/index.js +2 -2
  264. package/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
  265. package/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
  266. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  267. package/node_modules/hono/dist/middleware/mount/index.js +4 -4
  268. package/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
  269. package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
  270. package/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
  271. package/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
  272. package/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
  273. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
  274. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
  275. package/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
  276. package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
  277. package/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
  278. package/node_modules/hono/dist/utils/mount.js +34 -0
  279. package/node_modules/hono/dist/utils/url.js +10 -1
  280. package/node_modules/hono/dist/validator/validator.js +1 -1
  281. package/node_modules/hono/package.json +1 -1
  282. package/node_modules/ip-address/README.md +39 -39
  283. package/node_modules/ip-address/dist/ipv6.js +1 -1
  284. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  285. package/node_modules/ip-address/package.json +1 -1
  286. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +3 -0
  287. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -0
  288. package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -0
  289. package/node_modules/jose/dist/types/types.d.ts +8 -0
  290. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -0
  291. package/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
  292. package/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
  293. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
  294. package/node_modules/jose/package.json +1 -1
  295. package/node_modules/qs/CHANGELOG.md +29 -22
  296. package/node_modules/qs/dist/qs.js +14 -14
  297. package/node_modules/qs/eslint.config.mjs +6 -0
  298. package/node_modules/qs/lib/stringify.js +1 -1
  299. package/node_modules/qs/package.json +5 -5
  300. package/node_modules/qs/test/stringify.js +74 -0
  301. package/package.json +2 -2
@@ -0,0 +1,236 @@
1
+ import { HkdfSha256Native, HkdfSha384Native, HkdfSha512Native } from "@hpke/common";
2
+ import { CipherSuiteNative } from "./cipherSuiteNative.js";
3
+ import { DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native } from "./kems/dhkemNative.js";
4
+ /**
5
+ * The Hybrid Public Key Encryption (HPKE) ciphersuite,
6
+ * which is implemented using only
7
+ * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}.
8
+ *
9
+ * This class is the same as
10
+ * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteNative | @hpke/core#CipherSuiteNative} as follows:
11
+ * which supports only the ciphersuites that can be implemented on the native
12
+ * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}.
13
+ * Therefore, the following cryptographic algorithms are not supported for now:
14
+ * - `DHKEM(X448, HKDF-SHA512)`
15
+ * - `ChaCha20Poly1305`
16
+ *
17
+ * In addtion, the HKDF functions contained in this `CipherSuiteNative`
18
+ * class can only derive keys of the same length as the `hashSize`.
19
+ *
20
+ * If you want to use the unsupported cryptographic algorithms
21
+ * above or derive keys longer than the `hashSize`,
22
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
23
+ *
24
+ * This class provides following functions:
25
+ *
26
+ * - Creates encryption contexts both for senders and recipients.
27
+ * - {@link createSenderContext}
28
+ * - {@link createRecipientContext}
29
+ * - Provides single-shot encryption API.
30
+ * - {@link seal}
31
+ * - {@link open}
32
+ *
33
+ * The calling of the constructor of this class is the starting
34
+ * point for HPKE operations for both senders and recipients.
35
+ *
36
+ * @example Use only ciphersuites supported by Web Cryptography API.
37
+ *
38
+ * ```ts
39
+ * import {
40
+ * Aes128Gcm,
41
+ * DhkemP256HkdfSha256,
42
+ * HkdfSha256,
43
+ * CipherSuite,
44
+ * } from "@hpke/core";
45
+ *
46
+ * const suite = new CipherSuite({
47
+ * kem: new DhkemP256HkdfSha256(),
48
+ * kdf: new HkdfSha256(),
49
+ * aead: new Aes128Gcm(),
50
+ * });
51
+ * ```
52
+ *
53
+ * @example Use DHKEM(X25519, HKDF-SHA256).
54
+ *
55
+ * ```ts
56
+ * import {
57
+ * Aes128Gcm,
58
+ * CipherSuite,
59
+ * DhkemX25519HkdfSha256,
60
+ * HkdfSha256,
61
+ * } from "@hpke/core";
62
+ * const suite = new CipherSuite({
63
+ * kem: new DhkemX25519HkdfSha256(),
64
+ * kdf: new HkdfSha256(),
65
+ * aead: new Aes128Gcm(),
66
+ * });
67
+ * ```
68
+ */
69
+ export declare class CipherSuite extends CipherSuiteNative {
70
+ }
71
+ /**
72
+ * The DHKEM(P-256, HKDF-SHA256) for HPKE KEM implementing {@link KemInterface}.
73
+ *
74
+ * When using `@hpke/core`, the instance of this class must be specified
75
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KemId.DhkemP256HkdfSha256`
76
+ * as follows:
77
+ *
78
+ * @example
79
+ *
80
+ * ```ts
81
+ * import {
82
+ * Aes128Gcm,
83
+ * CipherSuite,
84
+ * DhkemP256HkdfSha256,
85
+ * HkdfSha256,
86
+ * } from "@hpke/core";
87
+ *
88
+ * const suite = new CipherSuite({
89
+ * kem: new DhkemP256HkdfSha256(),
90
+ * kdf: new HkdfSha256(),
91
+ * aead: new Aes128Gcm(),
92
+ * });
93
+ * ```
94
+ */
95
+ export declare class DhkemP256HkdfSha256 extends DhkemP256HkdfSha256Native {
96
+ }
97
+ /**
98
+ * The DHKEM(P-384, HKDF-SHA384) for HPKE KEM implementing {@link KemInterface}.
99
+ *
100
+ * When using `@hpke/core`, the instance of this class must be specified
101
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KemId.DhkemP384HkdfSha384`
102
+ * as follows:
103
+ *
104
+ * @example
105
+ *
106
+ * ```ts
107
+ * import {
108
+ * Aes128Gcm,
109
+ * CipherSuite,
110
+ * DhkemP384HkdfSha384,
111
+ * HkdfSha384,
112
+ * } from "@hpke/core";
113
+ *
114
+ * const suite = new CipherSuite({
115
+ * kem: new DhkemP384HkdfSha384(),
116
+ * kdf: new HkdfSha384(),
117
+ * aead: new Aes128Gcm(),
118
+ * });
119
+ * ```
120
+ */
121
+ export declare class DhkemP384HkdfSha384 extends DhkemP384HkdfSha384Native {
122
+ }
123
+ /**
124
+ * The DHKEM(P-521, HKDF-SHA512) for HPKE KEM implementing {@link KemInterface}.
125
+ *
126
+ * When using `@hpke/core`, the instance of this class must be specified
127
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KemId.DhkemP521HkdfSha512`
128
+ * as follows:
129
+ *
130
+ * @example
131
+ *
132
+ * ```ts
133
+ * import {
134
+ * Aes256Gcm,
135
+ * CipherSuite,
136
+ * DhkemP521HkdfSha512,
137
+ * HkdfSha512,
138
+ * } from "@hpke/core";
139
+ *
140
+ * const suite = new CipherSuite({
141
+ * kem: new DhkemP521HkdfSha512(),
142
+ * kdf: new HkdfSha512(),
143
+ * aead: new Aes256Gcm(),
144
+ * });
145
+ * ```
146
+ */
147
+ export declare class DhkemP521HkdfSha512 extends DhkemP521HkdfSha512Native {
148
+ }
149
+ /**
150
+ * The HKDF-SHA256 for HPKE KDF implementing {@link KdfInterface}.
151
+ *
152
+ * When using `@hpke/core`, the instance of this class must be specified
153
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KdfId.HkdfSha256`.
154
+ *
155
+ * The KDF class can only derive keys of the same length as the `hashSize`.
156
+ * If you want to derive keys longer than the `hashSize`,
157
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
158
+ *
159
+ * @example
160
+ *
161
+ * ```ts
162
+ * import {
163
+ * Aes128Gcm,
164
+ * CipherSuite,
165
+ * DhkemP256HkdfSha256,
166
+ * HkdfSha256,
167
+ * } from "@hpke/core";
168
+ *
169
+ * const suite = new CipherSuite({
170
+ * kem: new DhkemP256HkdfSha256(),
171
+ * kdf: new HkdfSha256(),
172
+ * aead: new Aes128Gcm(),
173
+ * });
174
+ * ```
175
+ */
176
+ export declare class HkdfSha256 extends HkdfSha256Native {
177
+ }
178
+ /**
179
+ * The HKDF-SHA384 for HPKE KDF implementing {@link KdfInterface}.
180
+ *
181
+ * When using `@hpke/core`, the instance of this class must be specified
182
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KdfId.HkdfSha384`.
183
+ *
184
+ * The KDF class can only derive keys of the same length as the `hashSize`.
185
+ * If you want to derive keys longer than the `hashSize`,
186
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
187
+ *
188
+ * @example
189
+ *
190
+ * ```ts
191
+ * import {
192
+ * Aes128Gcm,
193
+ * CipherSuite,
194
+ * DhkemP384HkdfSha384,
195
+ * HkdfSha384,
196
+ * } from "@hpke/core";
197
+ *
198
+ * const suite = new CipherSuite({
199
+ * kem: new DhkemP384HkdfSha384(),
200
+ * kdf: new HkdfSha384(),
201
+ * aead: new Aes128Gcm(),
202
+ * });
203
+ * ```
204
+ */
205
+ export declare class HkdfSha384 extends HkdfSha384Native {
206
+ }
207
+ /**
208
+ * The HKDF-SHA512 for HPKE KDF implementing {@link KdfInterface}.
209
+ *
210
+ * When using `@hpke/core`, the instance of this class must be specified
211
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KdfId.HkdfSha512`.
212
+ *
213
+ * The KDF class can only derive keys of the same length as the `hashSize`.
214
+ * If you want to derive keys longer than the `hashSize`,
215
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
216
+ *
217
+ * @example
218
+ *
219
+ * ```ts
220
+ * import {
221
+ * Aes256Gcm,
222
+ * CipherSuite,
223
+ * DhkemP521HkdfSha512,
224
+ * HkdfSha512,
225
+ * } from "@hpke/core";
226
+ *
227
+ * const suite = new CipherSuite({
228
+ * kem: new DhkemP521HkdfSha512(),
229
+ * kdf: new HkdfSha512(),
230
+ * aead: new Aes256Gcm(),
231
+ * });
232
+ * ```
233
+ */
234
+ export declare class HkdfSha512 extends HkdfSha512Native {
235
+ }
236
+ //# sourceMappingURL=native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../src/src/native.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;CAAG;AAErD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,mBAAoB,SAAQ,yBAAyB;CAAG;AAErE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,mBAAoB,SAAQ,yBAAyB;CAAG;AAErE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,mBAAoB,SAAQ,yBAAyB;CAAG;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,UAAW,SAAQ,gBAAgB;CAAG;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,UAAW,SAAQ,gBAAgB;CAAG;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,UAAW,SAAQ,gBAAgB;CAAG"}
@@ -0,0 +1,255 @@
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", "./cipherSuiteNative.js", "./kems/dhkemNative.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HkdfSha512 = exports.HkdfSha384 = exports.HkdfSha256 = exports.DhkemP521HkdfSha512 = exports.DhkemP384HkdfSha384 = exports.DhkemP256HkdfSha256 = exports.CipherSuite = void 0;
13
+ const common_1 = require("@hpke/common");
14
+ const cipherSuiteNative_js_1 = require("./cipherSuiteNative.js");
15
+ const dhkemNative_js_1 = require("./kems/dhkemNative.js");
16
+ /**
17
+ * The Hybrid Public Key Encryption (HPKE) ciphersuite,
18
+ * which is implemented using only
19
+ * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}.
20
+ *
21
+ * This class is the same as
22
+ * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteNative | @hpke/core#CipherSuiteNative} as follows:
23
+ * which supports only the ciphersuites that can be implemented on the native
24
+ * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}.
25
+ * Therefore, the following cryptographic algorithms are not supported for now:
26
+ * - `DHKEM(X448, HKDF-SHA512)`
27
+ * - `ChaCha20Poly1305`
28
+ *
29
+ * In addtion, the HKDF functions contained in this `CipherSuiteNative`
30
+ * class can only derive keys of the same length as the `hashSize`.
31
+ *
32
+ * If you want to use the unsupported cryptographic algorithms
33
+ * above or derive keys longer than the `hashSize`,
34
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
35
+ *
36
+ * This class provides following functions:
37
+ *
38
+ * - Creates encryption contexts both for senders and recipients.
39
+ * - {@link createSenderContext}
40
+ * - {@link createRecipientContext}
41
+ * - Provides single-shot encryption API.
42
+ * - {@link seal}
43
+ * - {@link open}
44
+ *
45
+ * The calling of the constructor of this class is the starting
46
+ * point for HPKE operations for both senders and recipients.
47
+ *
48
+ * @example Use only ciphersuites supported by Web Cryptography API.
49
+ *
50
+ * ```ts
51
+ * import {
52
+ * Aes128Gcm,
53
+ * DhkemP256HkdfSha256,
54
+ * HkdfSha256,
55
+ * CipherSuite,
56
+ * } from "@hpke/core";
57
+ *
58
+ * const suite = new CipherSuite({
59
+ * kem: new DhkemP256HkdfSha256(),
60
+ * kdf: new HkdfSha256(),
61
+ * aead: new Aes128Gcm(),
62
+ * });
63
+ * ```
64
+ *
65
+ * @example Use DHKEM(X25519, HKDF-SHA256).
66
+ *
67
+ * ```ts
68
+ * import {
69
+ * Aes128Gcm,
70
+ * CipherSuite,
71
+ * DhkemX25519HkdfSha256,
72
+ * HkdfSha256,
73
+ * } from "@hpke/core";
74
+ * const suite = new CipherSuite({
75
+ * kem: new DhkemX25519HkdfSha256(),
76
+ * kdf: new HkdfSha256(),
77
+ * aead: new Aes128Gcm(),
78
+ * });
79
+ * ```
80
+ */
81
+ class CipherSuite extends cipherSuiteNative_js_1.CipherSuiteNative {
82
+ }
83
+ exports.CipherSuite = CipherSuite;
84
+ /**
85
+ * The DHKEM(P-256, HKDF-SHA256) for HPKE KEM implementing {@link KemInterface}.
86
+ *
87
+ * When using `@hpke/core`, the instance of this class must be specified
88
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KemId.DhkemP256HkdfSha256`
89
+ * as follows:
90
+ *
91
+ * @example
92
+ *
93
+ * ```ts
94
+ * import {
95
+ * Aes128Gcm,
96
+ * CipherSuite,
97
+ * DhkemP256HkdfSha256,
98
+ * HkdfSha256,
99
+ * } from "@hpke/core";
100
+ *
101
+ * const suite = new CipherSuite({
102
+ * kem: new DhkemP256HkdfSha256(),
103
+ * kdf: new HkdfSha256(),
104
+ * aead: new Aes128Gcm(),
105
+ * });
106
+ * ```
107
+ */
108
+ class DhkemP256HkdfSha256 extends dhkemNative_js_1.DhkemP256HkdfSha256Native {
109
+ }
110
+ exports.DhkemP256HkdfSha256 = DhkemP256HkdfSha256;
111
+ /**
112
+ * The DHKEM(P-384, HKDF-SHA384) for HPKE KEM implementing {@link KemInterface}.
113
+ *
114
+ * When using `@hpke/core`, the instance of this class must be specified
115
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KemId.DhkemP384HkdfSha384`
116
+ * as follows:
117
+ *
118
+ * @example
119
+ *
120
+ * ```ts
121
+ * import {
122
+ * Aes128Gcm,
123
+ * CipherSuite,
124
+ * DhkemP384HkdfSha384,
125
+ * HkdfSha384,
126
+ * } from "@hpke/core";
127
+ *
128
+ * const suite = new CipherSuite({
129
+ * kem: new DhkemP384HkdfSha384(),
130
+ * kdf: new HkdfSha384(),
131
+ * aead: new Aes128Gcm(),
132
+ * });
133
+ * ```
134
+ */
135
+ class DhkemP384HkdfSha384 extends dhkemNative_js_1.DhkemP384HkdfSha384Native {
136
+ }
137
+ exports.DhkemP384HkdfSha384 = DhkemP384HkdfSha384;
138
+ /**
139
+ * The DHKEM(P-521, HKDF-SHA512) for HPKE KEM implementing {@link KemInterface}.
140
+ *
141
+ * When using `@hpke/core`, the instance of this class must be specified
142
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KemId.DhkemP521HkdfSha512`
143
+ * as follows:
144
+ *
145
+ * @example
146
+ *
147
+ * ```ts
148
+ * import {
149
+ * Aes256Gcm,
150
+ * CipherSuite,
151
+ * DhkemP521HkdfSha512,
152
+ * HkdfSha512,
153
+ * } from "@hpke/core";
154
+ *
155
+ * const suite = new CipherSuite({
156
+ * kem: new DhkemP521HkdfSha512(),
157
+ * kdf: new HkdfSha512(),
158
+ * aead: new Aes256Gcm(),
159
+ * });
160
+ * ```
161
+ */
162
+ class DhkemP521HkdfSha512 extends dhkemNative_js_1.DhkemP521HkdfSha512Native {
163
+ }
164
+ exports.DhkemP521HkdfSha512 = DhkemP521HkdfSha512;
165
+ /**
166
+ * The HKDF-SHA256 for HPKE KDF implementing {@link KdfInterface}.
167
+ *
168
+ * When using `@hpke/core`, the instance of this class must be specified
169
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KdfId.HkdfSha256`.
170
+ *
171
+ * The KDF class can only derive keys of the same length as the `hashSize`.
172
+ * If you want to derive keys longer than the `hashSize`,
173
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
174
+ *
175
+ * @example
176
+ *
177
+ * ```ts
178
+ * import {
179
+ * Aes128Gcm,
180
+ * CipherSuite,
181
+ * DhkemP256HkdfSha256,
182
+ * HkdfSha256,
183
+ * } from "@hpke/core";
184
+ *
185
+ * const suite = new CipherSuite({
186
+ * kem: new DhkemP256HkdfSha256(),
187
+ * kdf: new HkdfSha256(),
188
+ * aead: new Aes128Gcm(),
189
+ * });
190
+ * ```
191
+ */
192
+ class HkdfSha256 extends common_1.HkdfSha256Native {
193
+ }
194
+ exports.HkdfSha256 = HkdfSha256;
195
+ /**
196
+ * The HKDF-SHA384 for HPKE KDF implementing {@link KdfInterface}.
197
+ *
198
+ * When using `@hpke/core`, the instance of this class must be specified
199
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KdfId.HkdfSha384`.
200
+ *
201
+ * The KDF class can only derive keys of the same length as the `hashSize`.
202
+ * If you want to derive keys longer than the `hashSize`,
203
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
204
+ *
205
+ * @example
206
+ *
207
+ * ```ts
208
+ * import {
209
+ * Aes128Gcm,
210
+ * CipherSuite,
211
+ * DhkemP384HkdfSha384,
212
+ * HkdfSha384,
213
+ * } from "@hpke/core";
214
+ *
215
+ * const suite = new CipherSuite({
216
+ * kem: new DhkemP384HkdfSha384(),
217
+ * kdf: new HkdfSha384(),
218
+ * aead: new Aes128Gcm(),
219
+ * });
220
+ * ```
221
+ */
222
+ class HkdfSha384 extends common_1.HkdfSha384Native {
223
+ }
224
+ exports.HkdfSha384 = HkdfSha384;
225
+ /**
226
+ * The HKDF-SHA512 for HPKE KDF implementing {@link KdfInterface}.
227
+ *
228
+ * When using `@hpke/core`, the instance of this class must be specified
229
+ * to the `kem` parameter of {@link CipherSuiteParams} instead of `KdfId.HkdfSha512`.
230
+ *
231
+ * The KDF class can only derive keys of the same length as the `hashSize`.
232
+ * If you want to derive keys longer than the `hashSize`,
233
+ * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}.
234
+ *
235
+ * @example
236
+ *
237
+ * ```ts
238
+ * import {
239
+ * Aes256Gcm,
240
+ * CipherSuite,
241
+ * DhkemP521HkdfSha512,
242
+ * HkdfSha512,
243
+ * } from "@hpke/core";
244
+ *
245
+ * const suite = new CipherSuite({
246
+ * kem: new DhkemP521HkdfSha512(),
247
+ * kdf: new HkdfSha512(),
248
+ * aead: new Aes256Gcm(),
249
+ * });
250
+ * ```
251
+ */
252
+ class HkdfSha512 extends common_1.HkdfSha512Native {
253
+ }
254
+ exports.HkdfSha512 = HkdfSha512;
255
+ });
@@ -0,0 +1,6 @@
1
+ import { EncryptionContextImpl } from "./encryptionContext.js";
2
+ export declare class RecipientContextImpl extends EncryptionContextImpl {
3
+ #private;
4
+ open(data: ArrayBufferLike | ArrayBufferView, aad?: ArrayBufferLike | ArrayBufferView): Promise<ArrayBuffer>;
5
+ }
6
+ //# sourceMappingURL=recipientContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipientContext.d.ts","sourceRoot":"","sources":["../../src/src/recipientContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,qBAAa,oBAAqB,SAAQ,qBAAqB;;IAG9C,IAAI,CACjB,IAAI,EAAE,eAAe,GAAG,eAAe,EACvC,GAAG,GAAE,eAAe,GAAG,eAA6C,GACnE,OAAO,CAAC,WAAW,CAAC;CAkBxB"}
@@ -0,0 +1,52 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
+ if (kind === "m") throw new TypeError("Private method is not writable");
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
+ };
12
+ (function (factory) {
13
+ if (typeof module === "object" && typeof module.exports === "object") {
14
+ var v = factory(require, exports);
15
+ if (v !== undefined) module.exports = v;
16
+ }
17
+ else if (typeof define === "function" && define.amd) {
18
+ define(["require", "exports", "@hpke/common", "./encryptionContext.js", "./mutex.js"], factory);
19
+ }
20
+ })(function (require, exports) {
21
+ "use strict";
22
+ var _RecipientContextImpl_mutex;
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.RecipientContextImpl = void 0;
25
+ const common_1 = require("@hpke/common");
26
+ const encryptionContext_js_1 = require("./encryptionContext.js");
27
+ const mutex_js_1 = require("./mutex.js");
28
+ class RecipientContextImpl extends encryptionContext_js_1.EncryptionContextImpl {
29
+ constructor() {
30
+ super(...arguments);
31
+ _RecipientContextImpl_mutex.set(this, void 0);
32
+ }
33
+ async open(data, aad = common_1.EMPTY.buffer) {
34
+ __classPrivateFieldSet(this, _RecipientContextImpl_mutex, __classPrivateFieldGet(this, _RecipientContextImpl_mutex, "f") ?? new mutex_js_1.Mutex(), "f");
35
+ const release = await __classPrivateFieldGet(this, _RecipientContextImpl_mutex, "f").lock();
36
+ let pt;
37
+ try {
38
+ pt = await this._ctx.key.open(this.computeNonce(this._ctx), (0, common_1.toArrayBuffer)(data), (0, common_1.toArrayBuffer)(aad));
39
+ }
40
+ catch (e) {
41
+ throw new common_1.OpenError(e);
42
+ }
43
+ finally {
44
+ release();
45
+ }
46
+ this.incrementSeq(this._ctx);
47
+ return pt;
48
+ }
49
+ }
50
+ exports.RecipientContextImpl = RecipientContextImpl;
51
+ _RecipientContextImpl_mutex = new WeakMap();
52
+ });
@@ -0,0 +1,11 @@
1
+ import type { KdfInterface } from "@hpke/common";
2
+ import type { AeadParams } from "./interfaces/aeadParams.js";
3
+ import type { Encapsulator } from "./interfaces/encapsulator.js";
4
+ import { EncryptionContextImpl } from "./encryptionContext.js";
5
+ export declare class SenderContextImpl extends EncryptionContextImpl implements Encapsulator {
6
+ #private;
7
+ readonly enc: ArrayBuffer;
8
+ constructor(api: SubtleCrypto, kdf: KdfInterface, params: AeadParams, enc: ArrayBuffer);
9
+ seal(data: ArrayBufferLike | ArrayBufferView, aad?: ArrayBufferLike | ArrayBufferView): Promise<ArrayBuffer>;
10
+ }
11
+ //# sourceMappingURL=senderContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"senderContext.d.ts","sourceRoot":"","sources":["../../src/src/senderContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,qBAAa,iBAAkB,SAAQ,qBACrC,YAAW,YAAY;;IACvB,SAAgB,GAAG,EAAE,WAAW,CAAC;gBAI/B,GAAG,EAAE,YAAY,EACjB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,WAAW;IAMH,IAAI,CACjB,IAAI,EAAE,eAAe,GAAG,eAAe,EACvC,GAAG,GAAE,eAAe,GAAG,eAA6C,GACnE,OAAO,CAAC,WAAW,CAAC;CAkBxB"}
@@ -0,0 +1,59 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
+ if (kind === "m") throw new TypeError("Private method is not writable");
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
+ };
12
+ (function (factory) {
13
+ if (typeof module === "object" && typeof module.exports === "object") {
14
+ var v = factory(require, exports);
15
+ if (v !== undefined) module.exports = v;
16
+ }
17
+ else if (typeof define === "function" && define.amd) {
18
+ define(["require", "exports", "@hpke/common", "./encryptionContext.js", "./mutex.js"], factory);
19
+ }
20
+ })(function (require, exports) {
21
+ "use strict";
22
+ var _SenderContextImpl_mutex;
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.SenderContextImpl = void 0;
25
+ const common_1 = require("@hpke/common");
26
+ const encryptionContext_js_1 = require("./encryptionContext.js");
27
+ const mutex_js_1 = require("./mutex.js");
28
+ class SenderContextImpl extends encryptionContext_js_1.EncryptionContextImpl {
29
+ constructor(api, kdf, params, enc) {
30
+ super(api, kdf, params);
31
+ Object.defineProperty(this, "enc", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ _SenderContextImpl_mutex.set(this, void 0);
38
+ this.enc = enc;
39
+ }
40
+ async seal(data, aad = common_1.EMPTY.buffer) {
41
+ __classPrivateFieldSet(this, _SenderContextImpl_mutex, __classPrivateFieldGet(this, _SenderContextImpl_mutex, "f") ?? new mutex_js_1.Mutex(), "f");
42
+ const release = await __classPrivateFieldGet(this, _SenderContextImpl_mutex, "f").lock();
43
+ let ct;
44
+ try {
45
+ ct = await this._ctx.key.seal(this.computeNonce(this._ctx), (0, common_1.toArrayBuffer)(data), (0, common_1.toArrayBuffer)(aad));
46
+ }
47
+ catch (e) {
48
+ throw new common_1.SealError(e);
49
+ }
50
+ finally {
51
+ release();
52
+ }
53
+ this.incrementSeq(this._ctx);
54
+ return ct;
55
+ }
56
+ }
57
+ exports.SenderContextImpl = SenderContextImpl;
58
+ _SenderContextImpl_mutex = new WeakMap();
59
+ });
@@ -0,0 +1,2 @@
1
+ export declare function emitNotSupported<T>(): Promise<T>;
2
+ //# sourceMappingURL=emitNotSupported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitNotSupported.d.ts","sourceRoot":"","sources":["../../../src/src/utils/emitNotSupported.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAIhD"}
@@ -0,0 +1,19 @@
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.emitNotSupported = emitNotSupported;
13
+ const common_1 = require("@hpke/common");
14
+ function emitNotSupported() {
15
+ return new Promise((_resolve, reject) => {
16
+ reject(new common_1.NotSupportedError("Not supported"));
17
+ });
18
+ }
19
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanagencyp/hap-core",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "Core types, cryptographic primitives, and verification logic for the Human Agency Protocol",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,6 +33,7 @@
33
33
  "release:major": "pnpm version major && git push --follow-tags"
34
34
  },
35
35
  "dependencies": {
36
+ "@hpke/core": "1.9.0",
36
37
  "@noble/ed25519": "^2.1.0"
37
38
  },
38
39
  "devDependencies": {