@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,228 @@
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.X448 = void 0;
13
+ const common_1 = require("@hpke/common");
14
+ const ALG_NAME = "X448";
15
+ // deno-fmt-ignore
16
+ const PKCS8_ALG_ID_X448 = new Uint8Array([
17
+ 0x30, 0x46, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06,
18
+ 0x03, 0x2b, 0x65, 0x6f, 0x04, 0x3a, 0x04, 0x38,
19
+ ]);
20
+ const BASE_POINT_X448 = /* @__PURE__ */ (() => {
21
+ const p = new Uint8Array(56);
22
+ p[0] = 5;
23
+ return p;
24
+ })();
25
+ class X448 extends common_1.NativeAlgorithm {
26
+ constructor(hkdf) {
27
+ super();
28
+ Object.defineProperty(this, "_hkdf", {
29
+ enumerable: true,
30
+ configurable: true,
31
+ writable: true,
32
+ value: void 0
33
+ });
34
+ Object.defineProperty(this, "_alg", {
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true,
38
+ value: void 0
39
+ });
40
+ Object.defineProperty(this, "_nPk", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: void 0
45
+ });
46
+ Object.defineProperty(this, "_nSk", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: void 0
51
+ });
52
+ Object.defineProperty(this, "_nDh", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: void 0
57
+ });
58
+ Object.defineProperty(this, "_pkcs8AlgId", {
59
+ enumerable: true,
60
+ configurable: true,
61
+ writable: true,
62
+ value: void 0
63
+ });
64
+ this._alg = { name: ALG_NAME };
65
+ this._hkdf = hkdf;
66
+ this._nPk = 56;
67
+ this._nSk = 56;
68
+ this._nDh = 56;
69
+ this._pkcs8AlgId = PKCS8_ALG_ID_X448;
70
+ }
71
+ async serializePublicKey(key) {
72
+ await this._setup();
73
+ try {
74
+ return await this._api.exportKey("raw", key);
75
+ }
76
+ catch (e) {
77
+ throw new common_1.SerializeError(e);
78
+ }
79
+ }
80
+ async deserializePublicKey(key) {
81
+ await this._setup();
82
+ try {
83
+ return await this._importRawKey((0, common_1.toArrayBuffer)(key), true);
84
+ }
85
+ catch (e) {
86
+ throw new common_1.DeserializeError(e);
87
+ }
88
+ }
89
+ async serializePrivateKey(key) {
90
+ await this._setup();
91
+ try {
92
+ const jwk = await this._api.exportKey("jwk", key);
93
+ if (!("d" in jwk)) {
94
+ throw new Error("Not private key");
95
+ }
96
+ return (0, common_1.base64UrlToBytes)(jwk["d"]).buffer;
97
+ }
98
+ catch (e) {
99
+ throw new common_1.SerializeError(e);
100
+ }
101
+ }
102
+ async deserializePrivateKey(key) {
103
+ await this._setup();
104
+ try {
105
+ return await this._importRawKey((0, common_1.toArrayBuffer)(key), false);
106
+ }
107
+ catch (e) {
108
+ throw new common_1.DeserializeError(e);
109
+ }
110
+ }
111
+ async importKey(format, key, isPublic) {
112
+ await this._setup();
113
+ try {
114
+ if (format === "raw") {
115
+ return await this._importRawKey(key, isPublic);
116
+ }
117
+ // jwk
118
+ if (key instanceof ArrayBuffer) {
119
+ throw new Error("Invalid jwk key format");
120
+ }
121
+ return await this._importJWK(key, isPublic);
122
+ }
123
+ catch (e) {
124
+ throw new common_1.DeserializeError(e);
125
+ }
126
+ }
127
+ async generateKeyPair() {
128
+ await this._setup();
129
+ try {
130
+ return await this._api.generateKey(ALG_NAME, true, common_1.KEM_USAGES);
131
+ }
132
+ catch (e) {
133
+ throw new common_1.NotSupportedError(e);
134
+ }
135
+ }
136
+ async deriveKeyPair(ikm) {
137
+ await this._setup();
138
+ try {
139
+ const rawIkm = (0, common_1.toArrayBuffer)(ikm);
140
+ const dkpPrk = await this._hkdf.labeledExtract(common_1.EMPTY, common_1.LABEL_DKP_PRK, new Uint8Array(rawIkm));
141
+ const rawSk = await this._hkdf.labeledExpand(dkpPrk, common_1.LABEL_SK, common_1.EMPTY, this._nSk);
142
+ const rawSkBytes = new Uint8Array(rawSk);
143
+ const sk = await this._deserializePkcs8Key(rawSkBytes);
144
+ rawSkBytes.fill(0);
145
+ return {
146
+ privateKey: sk,
147
+ publicKey: await this.derivePublicKey(sk),
148
+ };
149
+ }
150
+ catch (e) {
151
+ throw new common_1.DeriveKeyPairError(e);
152
+ }
153
+ }
154
+ async derivePublicKey(key) {
155
+ await this._setup();
156
+ try {
157
+ const jwk = await this._api.exportKey("jwk", key);
158
+ delete jwk["d"];
159
+ delete jwk["key_ops"];
160
+ return await this._api.importKey("jwk", jwk, this._alg, true, []);
161
+ }
162
+ catch {
163
+ try {
164
+ // Some runtimes cannot export JWK from imported X448 private keys.
165
+ const bp = await this._api.importKey("raw", BASE_POINT_X448.buffer, this._alg, true, []);
166
+ const bits = await this._api.deriveBits({
167
+ name: ALG_NAME,
168
+ public: bp,
169
+ }, key, this._nPk * 8);
170
+ return await this._api.importKey("raw", bits, this._alg, true, []);
171
+ }
172
+ catch (e) {
173
+ throw new common_1.DeserializeError(e);
174
+ }
175
+ }
176
+ }
177
+ async dh(sk, pk) {
178
+ await this._setup();
179
+ try {
180
+ const bits = await this._api.deriveBits({
181
+ name: ALG_NAME,
182
+ public: pk,
183
+ }, sk, this._nDh * 8);
184
+ return bits;
185
+ }
186
+ catch (e) {
187
+ throw new common_1.SerializeError(e);
188
+ }
189
+ }
190
+ async _importRawKey(key, isPublic) {
191
+ if (isPublic && key.byteLength !== this._nPk) {
192
+ throw new Error("Invalid public key for the ciphersuite");
193
+ }
194
+ if (!isPublic && key.byteLength !== this._nSk) {
195
+ throw new Error("Invalid private key for the ciphersuite");
196
+ }
197
+ if (isPublic) {
198
+ return await this._api.importKey("raw", key, this._alg, true, []);
199
+ }
200
+ return await this._deserializePkcs8Key(new Uint8Array(key));
201
+ }
202
+ async _importJWK(key, isPublic) {
203
+ if (typeof key.kty === "undefined" || key.kty !== "OKP") {
204
+ throw new Error(`Invalid kty: ${key.crv}`);
205
+ }
206
+ if (typeof key.crv === "undefined" || key.crv !== ALG_NAME) {
207
+ throw new Error(`Invalid crv: ${key.crv}`);
208
+ }
209
+ if (isPublic) {
210
+ if (typeof key.d !== "undefined") {
211
+ throw new Error("Invalid key: `d` should not be set");
212
+ }
213
+ return await this._api.importKey("jwk", key, this._alg, true, []);
214
+ }
215
+ if (typeof key.d === "undefined") {
216
+ throw new Error("Invalid key: `d` not found");
217
+ }
218
+ return await this._api.importKey("jwk", key, this._alg, true, common_1.KEM_USAGES);
219
+ }
220
+ async _deserializePkcs8Key(k) {
221
+ const pkcs8Key = new Uint8Array(this._pkcs8AlgId.length + k.length);
222
+ pkcs8Key.set(this._pkcs8AlgId, 0);
223
+ pkcs8Key.set(k, this._pkcs8AlgId.length);
224
+ return await this._api.importKey("pkcs8", pkcs8Key, this._alg, true, common_1.KEM_USAGES);
225
+ }
226
+ }
227
+ exports.X448 = X448;
228
+ });
@@ -0,0 +1,38 @@
1
+ import { Dhkem, KemId } from "@hpke/common";
2
+ /**
3
+ * The DHKEM(X25519, HKDF-SHA256) for HPKE KEM implementing {@link KemInterface}.
4
+ *
5
+ * The instance of this class can be specified to the
6
+ * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows:
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * import {
12
+ * Aes128Gcm,
13
+ * CipherSuite,
14
+ * HkdfSha256,
15
+ * DhkemX25519HkdfSha256,
16
+ * } from "@hpke/core";
17
+ *
18
+ * const suite = new CipherSuite({
19
+ * kem: new DhkemX25519HkdfSha256(),
20
+ * kdf: new HkdfSha256(),
21
+ * aead: new Aes128Gcm(),
22
+ * });
23
+ * ```
24
+ */
25
+ export declare class DhkemX25519HkdfSha256 extends Dhkem {
26
+ /** KemId.DhkemX25519HkdfSha256 (0x0020) */
27
+ id: KemId;
28
+ /** 32 */
29
+ secretSize: number;
30
+ /** 32 */
31
+ encSize: number;
32
+ /** 32 */
33
+ publicKeySize: number;
34
+ /** 32 */
35
+ privateKeySize: number;
36
+ constructor();
37
+ }
38
+ //# sourceMappingURL=dhkemX25519.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dhkemX25519.d.ts","sourceRoot":"","sources":["../../../src/src/kems/dhkemX25519.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,KAAK,EAAE,MAAM,cAAc,CAAC;AAI9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,2CAA2C;IAClC,EAAE,EAAE,KAAK,CAA+B;IACjD,SAAS;IACA,UAAU,EAAE,MAAM,CAAM;IACjC,SAAS;IACA,OAAO,EAAE,MAAM,CAAM;IAC9B,SAAS;IACA,aAAa,EAAE,MAAM,CAAM;IACpC,SAAS;IACA,cAAc,EAAE,MAAM,CAAM;;CAMtC"}
@@ -0,0 +1,80 @@
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", "./dhkemPrimitives/x25519.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DhkemX25519HkdfSha256 = void 0;
13
+ const common_1 = require("@hpke/common");
14
+ const x25519_js_1 = require("./dhkemPrimitives/x25519.js");
15
+ /**
16
+ * The DHKEM(X25519, HKDF-SHA256) for HPKE KEM implementing {@link KemInterface}.
17
+ *
18
+ * The instance of this class can be specified to the
19
+ * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows:
20
+ *
21
+ * @example
22
+ *
23
+ * ```ts
24
+ * import {
25
+ * Aes128Gcm,
26
+ * CipherSuite,
27
+ * HkdfSha256,
28
+ * DhkemX25519HkdfSha256,
29
+ * } from "@hpke/core";
30
+ *
31
+ * const suite = new CipherSuite({
32
+ * kem: new DhkemX25519HkdfSha256(),
33
+ * kdf: new HkdfSha256(),
34
+ * aead: new Aes128Gcm(),
35
+ * });
36
+ * ```
37
+ */
38
+ class DhkemX25519HkdfSha256 extends common_1.Dhkem {
39
+ constructor() {
40
+ const kdf = new common_1.HkdfSha256Native();
41
+ super(common_1.KemId.DhkemX25519HkdfSha256, new x25519_js_1.X25519(kdf), kdf);
42
+ /** KemId.DhkemX25519HkdfSha256 (0x0020) */
43
+ Object.defineProperty(this, "id", {
44
+ enumerable: true,
45
+ configurable: true,
46
+ writable: true,
47
+ value: common_1.KemId.DhkemX25519HkdfSha256
48
+ });
49
+ /** 32 */
50
+ Object.defineProperty(this, "secretSize", {
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true,
54
+ value: 32
55
+ });
56
+ /** 32 */
57
+ Object.defineProperty(this, "encSize", {
58
+ enumerable: true,
59
+ configurable: true,
60
+ writable: true,
61
+ value: 32
62
+ });
63
+ /** 32 */
64
+ Object.defineProperty(this, "publicKeySize", {
65
+ enumerable: true,
66
+ configurable: true,
67
+ writable: true,
68
+ value: 32
69
+ });
70
+ /** 32 */
71
+ Object.defineProperty(this, "privateKeySize", {
72
+ enumerable: true,
73
+ configurable: true,
74
+ writable: true,
75
+ value: 32
76
+ });
77
+ }
78
+ }
79
+ exports.DhkemX25519HkdfSha256 = DhkemX25519HkdfSha256;
80
+ });
@@ -0,0 +1,38 @@
1
+ import { Dhkem, KemId } from "@hpke/common";
2
+ /**
3
+ * The DHKEM(X448, HKDF-SHA512) for HPKE KEM implementing {@link KemInterface}.
4
+ *
5
+ * The instance of this class can be specified to the
6
+ * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows:
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * import {
12
+ * Aes256Gcm,
13
+ * CipherSuite,
14
+ * HkdfSha512,
15
+ * DhkemX448HkdfSha512,
16
+ * } from "@hpke/core";
17
+ *
18
+ * const suite = new CipherSuite({
19
+ * kem: new DhkemX448HkdfSha512(),
20
+ * kdf: new HkdfSha512(),
21
+ * aead: new Aes256Gcm(),
22
+ * });
23
+ * ```
24
+ */
25
+ export declare class DhkemX448HkdfSha512 extends Dhkem {
26
+ /** KemId.DhkemX448HkdfSha512 (0x0021) */
27
+ id: KemId;
28
+ /** 64 */
29
+ secretSize: number;
30
+ /** 56 */
31
+ encSize: number;
32
+ /** 56 */
33
+ publicKeySize: number;
34
+ /** 56 */
35
+ privateKeySize: number;
36
+ constructor();
37
+ }
38
+ //# sourceMappingURL=dhkemX448.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dhkemX448.d.ts","sourceRoot":"","sources":["../../../src/src/kems/dhkemX448.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,KAAK,EAAE,MAAM,cAAc,CAAC;AAI9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,yCAAyC;IAChC,EAAE,EAAE,KAAK,CAA6B;IAC/C,SAAS;IACA,UAAU,EAAE,MAAM,CAAM;IACjC,SAAS;IACA,OAAO,EAAE,MAAM,CAAM;IAC9B,SAAS;IACA,aAAa,EAAE,MAAM,CAAM;IACpC,SAAS;IACA,cAAc,EAAE,MAAM,CAAM;;CAMtC"}
@@ -0,0 +1,80 @@
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", "./dhkemPrimitives/x448.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DhkemX448HkdfSha512 = void 0;
13
+ const common_1 = require("@hpke/common");
14
+ const x448_js_1 = require("./dhkemPrimitives/x448.js");
15
+ /**
16
+ * The DHKEM(X448, HKDF-SHA512) for HPKE KEM implementing {@link KemInterface}.
17
+ *
18
+ * The instance of this class can be specified to the
19
+ * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows:
20
+ *
21
+ * @example
22
+ *
23
+ * ```ts
24
+ * import {
25
+ * Aes256Gcm,
26
+ * CipherSuite,
27
+ * HkdfSha512,
28
+ * DhkemX448HkdfSha512,
29
+ * } from "@hpke/core";
30
+ *
31
+ * const suite = new CipherSuite({
32
+ * kem: new DhkemX448HkdfSha512(),
33
+ * kdf: new HkdfSha512(),
34
+ * aead: new Aes256Gcm(),
35
+ * });
36
+ * ```
37
+ */
38
+ class DhkemX448HkdfSha512 extends common_1.Dhkem {
39
+ constructor() {
40
+ const kdf = new common_1.HkdfSha512Native();
41
+ super(common_1.KemId.DhkemX448HkdfSha512, new x448_js_1.X448(kdf), kdf);
42
+ /** KemId.DhkemX448HkdfSha512 (0x0021) */
43
+ Object.defineProperty(this, "id", {
44
+ enumerable: true,
45
+ configurable: true,
46
+ writable: true,
47
+ value: common_1.KemId.DhkemX448HkdfSha512
48
+ });
49
+ /** 64 */
50
+ Object.defineProperty(this, "secretSize", {
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true,
54
+ value: 64
55
+ });
56
+ /** 56 */
57
+ Object.defineProperty(this, "encSize", {
58
+ enumerable: true,
59
+ configurable: true,
60
+ writable: true,
61
+ value: 56
62
+ });
63
+ /** 56 */
64
+ Object.defineProperty(this, "publicKeySize", {
65
+ enumerable: true,
66
+ configurable: true,
67
+ writable: true,
68
+ value: 56
69
+ });
70
+ /** 56 */
71
+ Object.defineProperty(this, "privateKeySize", {
72
+ enumerable: true,
73
+ configurable: true,
74
+ writable: true,
75
+ value: 56
76
+ });
77
+ }
78
+ }
79
+ exports.DhkemX448HkdfSha512 = DhkemX448HkdfSha512;
80
+ });
@@ -0,0 +1,5 @@
1
+ export declare class Mutex {
2
+ #private;
3
+ lock(): Promise<() => void>;
4
+ }
5
+ //# sourceMappingURL=mutex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutex.d.ts","sourceRoot":"","sources":["../../src/src/mutex.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;;IAGV,IAAI,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC;CAUlC"}
@@ -0,0 +1,42 @@
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"], factory);
19
+ }
20
+ })(function (require, exports) {
21
+ "use strict";
22
+ var _Mutex_locked;
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.Mutex = void 0;
25
+ class Mutex {
26
+ constructor() {
27
+ _Mutex_locked.set(this, Promise.resolve());
28
+ }
29
+ async lock() {
30
+ let releaseLock;
31
+ const nextLock = new Promise((resolve) => {
32
+ releaseLock = resolve;
33
+ });
34
+ const previousLock = __classPrivateFieldGet(this, _Mutex_locked, "f");
35
+ __classPrivateFieldSet(this, _Mutex_locked, nextLock, "f");
36
+ await previousLock;
37
+ return releaseLock;
38
+ }
39
+ }
40
+ exports.Mutex = Mutex;
41
+ _Mutex_locked = new WeakMap();
42
+ });