@open-e2ee/signal-protocol-sdk 8.2.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/ADAPTERS.md +13 -31
  2. package/ARCHITECTURE.md +5 -7
  3. package/CHANGELOG.md +105 -0
  4. package/README.md +36 -48
  5. package/SECURITY.md +2 -2
  6. package/client/README.md +9 -0
  7. package/dist/client/client.d.ts +21 -14
  8. package/dist/client/client.d.ts.map +1 -1
  9. package/dist/client/client.js +93 -78
  10. package/dist/client/client.js.map +1 -1
  11. package/dist/client/config.d.ts +10 -17
  12. package/dist/client/config.d.ts.map +1 -1
  13. package/dist/client/config.js.map +1 -1
  14. package/dist/client/event-hooks.js +27 -0
  15. package/dist/client/event-hooks.js.map +1 -1
  16. package/dist/client/group-receive-authorization.d.ts +5 -0
  17. package/dist/client/group-receive-authorization.d.ts.map +1 -0
  18. package/dist/client/group-receive-authorization.js +32 -0
  19. package/dist/client/group-receive-authorization.js.map +1 -0
  20. package/dist/client/group-sender-key-operations.d.ts +15 -0
  21. package/dist/client/group-sender-key-operations.d.ts.map +1 -0
  22. package/dist/client/group-sender-key-operations.js +31 -0
  23. package/dist/client/group-sender-key-operations.js.map +1 -0
  24. package/dist/client/groups.d.ts +3 -1
  25. package/dist/client/groups.d.ts.map +1 -1
  26. package/dist/client/groups.js +5 -2
  27. package/dist/client/groups.js.map +1 -1
  28. package/dist/client/relay-subscription.d.ts +2 -0
  29. package/dist/client/relay-subscription.d.ts.map +1 -1
  30. package/dist/client/relay-subscription.js +3 -1
  31. package/dist/client/relay-subscription.js.map +1 -1
  32. package/dist/client/sender-key-distribution.d.ts.map +1 -1
  33. package/dist/client/sender-key-distribution.js +4 -1
  34. package/dist/client/sender-key-distribution.js.map +1 -1
  35. package/dist/client/signal-service-cipher.d.ts +4 -2
  36. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  37. package/dist/client/signal-service-cipher.js +61 -51
  38. package/dist/client/signal-service-cipher.js.map +1 -1
  39. package/dist/index.d.ts +27 -21
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +8 -17
  42. package/dist/index.js.map +1 -1
  43. package/dist/internal/crypto/pq/kyber.d.ts +1 -1
  44. package/dist/internal/crypto/pq/kyber.js +1 -1
  45. package/dist/internal/encoding/proto/sender-key-message.d.ts +2 -2
  46. package/dist/internal/encoding/proto/sender-key-message.d.ts.map +1 -1
  47. package/dist/internal/encoding/proto/sender-key-message.js +5 -2
  48. package/dist/internal/encoding/proto/sender-key-message.js.map +1 -1
  49. package/dist/internal/groups/manager.d.ts.map +1 -1
  50. package/dist/internal/groups/manager.js +5 -2
  51. package/dist/internal/groups/manager.js.map +1 -1
  52. package/dist/internal/groups/wire.d.ts +0 -2
  53. package/dist/internal/groups/wire.d.ts.map +1 -1
  54. package/dist/internal/groups/wire.js +0 -6
  55. package/dist/internal/groups/wire.js.map +1 -1
  56. package/dist/internal/manager/manager.d.ts.map +1 -1
  57. package/dist/internal/manager/manager.js +0 -1
  58. package/dist/internal/manager/manager.js.map +1 -1
  59. package/dist/internal/protocol/double-ratchet/ratchet.d.ts +0 -17
  60. package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
  61. package/dist/internal/protocol/double-ratchet/ratchet.js +0 -4
  62. package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
  63. package/dist/internal/protocol/sealed-sender/certificate.d.ts +2 -32
  64. package/dist/internal/protocol/sealed-sender/certificate.d.ts.map +1 -1
  65. package/dist/internal/protocol/sealed-sender/certificate.js +4 -85
  66. package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -1
  67. package/dist/internal/protocol/sealed-sender/index.d.ts +2 -2
  68. package/dist/internal/protocol/sealed-sender/index.d.ts.map +1 -1
  69. package/dist/internal/protocol/sealed-sender/index.js +2 -6
  70. package/dist/internal/protocol/sealed-sender/index.js.map +1 -1
  71. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +0 -19
  72. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  73. package/dist/internal/protocol/sealed-sender/proto/index.js +1 -48
  74. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  75. package/dist/internal/protocol/sender-keys/manager.d.ts +9 -13
  76. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  77. package/dist/internal/protocol/sender-keys/manager.js +90 -95
  78. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  79. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts +0 -2
  80. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts.map +1 -1
  81. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js +4 -12
  82. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js.map +1 -1
  83. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +1 -0
  84. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
  85. package/dist/internal/protocol/spqr/spqr.d.ts +1 -1
  86. package/dist/internal/protocol/spqr/spqr.js +1 -1
  87. package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
  88. package/dist/internal/protocol/x3dh/x3dh.js +1 -1
  89. package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
  90. package/dist/internal/protocol/zk/credentials/credentials.d.ts +3 -54
  91. package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -1
  92. package/dist/internal/protocol/zk/credentials/credentials.js +4 -91
  93. package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -1
  94. package/dist/internal/protocol/zk/credentials/endorsements.d.ts +3 -64
  95. package/dist/internal/protocol/zk/credentials/endorsements.d.ts.map +1 -1
  96. package/dist/internal/protocol/zk/credentials/endorsements.js +4 -134
  97. package/dist/internal/protocol/zk/credentials/endorsements.js.map +1 -1
  98. package/dist/internal/protocol/zk/credentials/index.d.ts +3 -3
  99. package/dist/internal/protocol/zk/credentials/index.d.ts.map +1 -1
  100. package/dist/internal/protocol/zk/credentials/index.js +3 -3
  101. package/dist/internal/protocol/zk/credentials/index.js.map +1 -1
  102. package/dist/internal/protocol/zk/credentials/issuance.d.ts +3 -26
  103. package/dist/internal/protocol/zk/credentials/issuance.d.ts.map +1 -1
  104. package/dist/internal/protocol/zk/credentials/issuance.js +3 -80
  105. package/dist/internal/protocol/zk/credentials/issuance.js.map +1 -1
  106. package/dist/internal/protocol/zk/credentials/presentation.d.ts +4 -73
  107. package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
  108. package/dist/internal/protocol/zk/credentials/presentation.js +4 -152
  109. package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
  110. package/dist/internal/protocol/zk/groups/auth-credential.d.ts +1 -61
  111. package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -1
  112. package/dist/internal/protocol/zk/groups/auth-credential.js +2 -196
  113. package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -1
  114. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts +1 -86
  115. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts.map +1 -1
  116. package/dist/internal/protocol/zk/groups/group-send-endorsement.js +1 -152
  117. package/dist/internal/protocol/zk/groups/group-send-endorsement.js.map +1 -1
  118. package/dist/internal/protocol/zk/groups/index.d.ts +4 -4
  119. package/dist/internal/protocol/zk/groups/index.d.ts.map +1 -1
  120. package/dist/internal/protocol/zk/groups/index.js +4 -4
  121. package/dist/internal/protocol/zk/groups/index.js.map +1 -1
  122. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +2 -57
  123. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts.map +1 -1
  124. package/dist/internal/protocol/zk/groups/profile-key-credential.js +2 -174
  125. package/dist/internal/protocol/zk/groups/profile-key-credential.js.map +1 -1
  126. package/dist/internal/protocol/zk/groups/server-params.d.ts +8 -72
  127. package/dist/internal/protocol/zk/groups/server-params.d.ts.map +1 -1
  128. package/dist/internal/protocol/zk/groups/server-params.js +8 -108
  129. package/dist/internal/protocol/zk/groups/server-params.js.map +1 -1
  130. package/dist/internal/protocol/zk/proofs/sign.d.ts +1 -2
  131. package/dist/internal/protocol/zk/proofs/sign.d.ts.map +1 -1
  132. package/dist/internal/protocol/zk/proofs/sign.js +2 -11
  133. package/dist/internal/protocol/zk/proofs/sign.js.map +1 -1
  134. package/dist/internal/session/ratchet.d.ts.map +1 -1
  135. package/dist/internal/session/ratchet.js +0 -2
  136. package/dist/internal/session/ratchet.js.map +1 -1
  137. package/dist/local/store/key-value/adapter.d.ts +3 -3
  138. package/dist/local/store/key-value/adapter.d.ts.map +1 -1
  139. package/dist/local/store/key-value/adapter.js +30 -15
  140. package/dist/local/store/key-value/adapter.js.map +1 -1
  141. package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -1
  142. package/dist/local/store/key-value/backend-conformance.js +25 -0
  143. package/dist/local/store/key-value/backend-conformance.js.map +1 -1
  144. package/dist/local/store/key-value/batch.d.ts +3 -1
  145. package/dist/local/store/key-value/batch.d.ts.map +1 -1
  146. package/dist/local/store/key-value/batch.js +9 -1
  147. package/dist/local/store/key-value/batch.js.map +1 -1
  148. package/dist/local/store/key-value/storage.d.ts +6 -0
  149. package/dist/local/store/key-value/storage.d.ts.map +1 -1
  150. package/dist/local/store/key-value/transactional-backend.d.ts +1 -1
  151. package/dist/local/store/key-value/transactional-backend.js +1 -1
  152. package/dist/local/store/memory/adapter.d.ts +3 -3
  153. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  154. package/dist/local/store/memory/adapter.js +43 -18
  155. package/dist/local/store/memory/adapter.js.map +1 -1
  156. package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
  157. package/dist/local/store/sqlite/migrations.js +18 -0
  158. package/dist/local/store/sqlite/migrations.js.map +1 -1
  159. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts +3 -3
  160. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts.map +1 -1
  161. package/dist/local/store/sqlite/models/skipped-sender-key.js +13 -17
  162. package/dist/local/store/sqlite/models/skipped-sender-key.js.map +1 -1
  163. package/dist/local/store/sqlite/store.d.ts +3 -3
  164. package/dist/local/store/sqlite/store.d.ts.map +1 -1
  165. package/dist/local/store/sqlite/store.js +17 -9
  166. package/dist/local/store/sqlite/store.js.map +1 -1
  167. package/dist/local/store/web/adapter.d.ts +3 -3
  168. package/dist/local/store/web/adapter.d.ts.map +1 -1
  169. package/dist/local/store/web/adapter.js +59 -20
  170. package/dist/local/store/web/adapter.js.map +1 -1
  171. package/dist/remote/relay/index.d.ts +4 -7
  172. package/dist/remote/relay/index.d.ts.map +1 -1
  173. package/dist/remote/relay/index.js +5 -7
  174. package/dist/remote/relay/index.js.map +1 -1
  175. package/dist/remote/relay/types.d.ts +3 -3
  176. package/dist/types/api.d.ts +29 -8
  177. package/dist/types/api.d.ts.map +1 -1
  178. package/dist/versions.d.ts +3 -3
  179. package/dist/versions.js +3 -3
  180. package/dist/zk/credentials.d.ts +2 -2
  181. package/dist/zk/credentials.js +2 -2
  182. package/dist/zk/groups.d.ts +3 -3
  183. package/dist/zk/groups.d.ts.map +1 -1
  184. package/dist/zk/groups.js +3 -3
  185. package/dist/zk/groups.js.map +1 -1
  186. package/docs/ASSURANCE.md +12 -14
  187. package/docs/CLIENT_COMPOSITION.md +9 -3
  188. package/docs/DEVIATIONS.md +24 -25
  189. package/docs/GETTING_STARTED.md +42 -320
  190. package/docs/INTERFACES.md +7 -7
  191. package/docs/PACKAGE_SURFACE.md +14 -16
  192. package/docs/RECIPES.md +6 -112
  193. package/groups/README.md +9 -1
  194. package/local/store/README.md +26 -6
  195. package/package.json +1 -30
  196. package/remote/README.md +12 -78
  197. package/remote/object-store/convex-r2/README.md +17 -49
  198. package/remote/relay/README.md +21 -18
  199. package/zk/README.md +6 -7
  200. package/dist/client/dual-store.d.ts +0 -70
  201. package/dist/client/dual-store.d.ts.map +0 -1
  202. package/dist/client/dual-store.js +0 -123
  203. package/dist/client/dual-store.js.map +0 -1
  204. package/dist/client/multi-device.d.ts +0 -74
  205. package/dist/client/multi-device.d.ts.map +0 -1
  206. package/dist/client/multi-device.js +0 -105
  207. package/dist/client/multi-device.js.map +0 -1
  208. package/dist/groups/server.d.ts +0 -10
  209. package/dist/groups/server.d.ts.map +0 -1
  210. package/dist/groups/server.js +0 -6
  211. package/dist/groups/server.js.map +0 -1
  212. package/dist/internal/encoding/index.d.ts +0 -2
  213. package/dist/internal/encoding/index.d.ts.map +0 -1
  214. package/dist/internal/encoding/index.js +0 -2
  215. package/dist/internal/encoding/index.js.map +0 -1
  216. package/dist/internal/groups/server-engine.d.ts +0 -118
  217. package/dist/internal/groups/server-engine.d.ts.map +0 -1
  218. package/dist/internal/groups/server-engine.js +0 -1268
  219. package/dist/internal/groups/server-engine.js.map +0 -1
  220. package/dist/internal/protocol/index.d.ts +0 -24
  221. package/dist/internal/protocol/index.d.ts.map +0 -1
  222. package/dist/internal/protocol/index.js +0 -9
  223. package/dist/internal/protocol/index.js.map +0 -1
  224. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +0 -56
  225. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +0 -1
  226. package/dist/internal/protocol/sealed-sender/trust-root.js +0 -90
  227. package/dist/internal/protocol/sealed-sender/trust-root.js.map +0 -1
  228. package/dist/internal/protocol/triple-ratchet/index.d.ts +0 -21
  229. package/dist/internal/protocol/triple-ratchet/index.d.ts.map +0 -1
  230. package/dist/internal/protocol/triple-ratchet/index.js +0 -19
  231. package/dist/internal/protocol/triple-ratchet/index.js.map +0 -1
  232. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +0 -233
  233. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +0 -1
  234. package/dist/internal/protocol/triple-ratchet/ratchet.js +0 -254
  235. package/dist/internal/protocol/triple-ratchet/ratchet.js.map +0 -1
  236. package/dist/internal/protocol/zk/proofs/index.d.ts +0 -13
  237. package/dist/internal/protocol/zk/proofs/index.d.ts.map +0 -1
  238. package/dist/internal/protocol/zk/proofs/index.js +0 -7
  239. package/dist/internal/protocol/zk/proofs/index.js.map +0 -1
  240. package/dist/local/store/sqlite/index.d.ts +0 -20
  241. package/dist/local/store/sqlite/index.d.ts.map +0 -1
  242. package/dist/local/store/sqlite/index.js +0 -18
  243. package/dist/local/store/sqlite/index.js.map +0 -1
  244. package/dist/remote/object-store/convex-r2/server/index.d.ts +0 -2
  245. package/dist/remote/object-store/convex-r2/server/index.d.ts.map +0 -1
  246. package/dist/remote/object-store/convex-r2/server/index.js +0 -2
  247. package/dist/remote/object-store/convex-r2/server/index.js.map +0 -1
  248. package/dist/remote/object-store/convex-r2/server.d.ts +0 -129
  249. package/dist/remote/object-store/convex-r2/server.d.ts.map +0 -1
  250. package/dist/remote/object-store/convex-r2/server.js +0 -244
  251. package/dist/remote/object-store/convex-r2/server.js.map +0 -1
  252. package/dist/remote/relay/memory/adapter.d.ts +0 -252
  253. package/dist/remote/relay/memory/adapter.d.ts.map +0 -1
  254. package/dist/remote/relay/memory/adapter.js +0 -1057
  255. package/dist/remote/relay/memory/adapter.js.map +0 -1
  256. package/dist/remote/relay/memory/failures.d.ts +0 -58
  257. package/dist/remote/relay/memory/failures.d.ts.map +0 -1
  258. package/dist/remote/relay/memory/failures.js +0 -124
  259. package/dist/remote/relay/memory/failures.js.map +0 -1
  260. package/dist/remote/relay/memory/group-server.d.ts +0 -13
  261. package/dist/remote/relay/memory/group-server.d.ts.map +0 -1
  262. package/dist/remote/relay/memory/group-server.js +0 -19
  263. package/dist/remote/relay/memory/group-server.js.map +0 -1
  264. package/dist/remote/relay/memory/index.d.ts +0 -11
  265. package/dist/remote/relay/memory/index.d.ts.map +0 -1
  266. package/dist/remote/relay/memory/index.js +0 -7
  267. package/dist/remote/relay/memory/index.js.map +0 -1
  268. package/examples/browser/README.md +0 -35
  269. package/examples/browser/index.html +0 -27
  270. package/examples/browser/src/exchange.ts +0 -69
  271. package/examples/browser/src/main.ts +0 -63
  272. package/examples/browser/src/style.css +0 -9
  273. package/examples/browser/src/worker.ts +0 -10
  274. package/examples/browser/vite.config.ts +0 -9
  275. package/remote/relay/memory/README.md +0 -72
  276. package/scripts/oe-groups.mjs +0 -166
@@ -5,8 +5,8 @@ export { ProfileKeyEncryptionDomain, deriveProfileKeyEncKeyPair, encryptProfileK
5
5
  export { groupMasterKey, deriveGroupSecretParams, generateGroupSecretParams, getGroupPublicParams, encryptServiceId, decryptServiceId, encryptProfileKey, decryptProfileKey, encryptBlob, encryptBlobWithPadding, decryptBlob, decryptBlobWithPadding, GROUP_MASTER_KEY_LEN, GROUP_IDENTIFIER_LEN, RANDOMNESS_LEN, SECONDS_PER_DAY, } from './group-params.js';
6
6
  export { lizardEncode, lizardDecode, fromUniformBytesSingleElligator, decode253Bits, } from './lizard.js';
7
7
  export { encryptUuid, decryptUuid, encryptProfileKeyCiphertext, decryptProfileKeyCiphertext, } from './client-zk-group-cipher.js';
8
- export { generateServerSecretParams, getServerPublicParams, serverSign, serverVerifySignature, SIGNATURE_LEN, } from './server-params.js';
9
- export { issueAuthCredential, receiveAuthCredential, presentAuthCredential, verifyAuthCredentialPresentation, } from './auth-credential.js';
10
- export { createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest, deserializeProfileKeyCredentialRequest, issueProfileKeyCredential, receiveProfileKeyCredential, presentProfileKeyCredential, verifyProfileKeyCredentialPresentation, serializeProfileKeyCredentialResponse, deserializeProfileKeyCredentialResponse, serializeProfileKeyCredentialPresentation, deserializeProfileKeyCredentialPresentation, } from './profile-key-credential.js';
11
- export { deriveForExpiration, defaultExpiration, issueEndorsements, receiveEndorsements, combineEndorsements, removeEndorsement, createFullToken, verifyFullToken, serializeEndorsementsResponse, deserializeEndorsementsResponse, serializeFullToken, deserializeFullToken, } from './group-send-endorsement.js';
8
+ export { serverVerifySignature, SIGNATURE_LEN } from './server-params.js';
9
+ export { receiveAuthCredential, presentAuthCredential } from './auth-credential.js';
10
+ export { createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest, receiveProfileKeyCredential, presentProfileKeyCredential, deserializeProfileKeyCredentialResponse, serializeProfileKeyCredentialPresentation } from './profile-key-credential.js';
11
+ export { receiveEndorsements, combineEndorsements, removeEndorsement, createFullToken, deserializeEndorsementsResponse, serializeFullToken } from './group-send-endorsement.js';
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,cAAc,EACd,cAAc,EACd,eAAe,EAEf,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAyB,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,mBAAmB,EAGnB,mBAAmB,EACnB,gBAAgB,IAAI,mBAAmB,EACvC,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,wBAAwB,GAC/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B,EAG1B,0BAA0B,EAC1B,iBAAiB,IAAI,mBAAmB,EACxC,iBAAiB,IAAI,mBAAmB,EACxC,kBAAkB,IAAI,+BAA+B,GACtD,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAIL,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,+BAA+B,EAC/B,aAAa,GACd,MAAM,UAAU,CAAC;AAElB,OAAO,EAGL,WAAW,EACX,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAGL,0BAA0B,EAC1B,qBAAqB,EACrB,UAAU,EACV,qBAAqB,EACrB,aAAa,GACd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAIL,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAML,iCAAiC,EACjC,oCAAoC,EACpC,sCAAsC,EACtC,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,sCAAsC,EACtC,qCAAqC,EACrC,uCAAuC,EACvC,yCAAyC,EACzC,2CAA2C,GAC5C,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAML,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,6BAA6B,EAC7B,+BAA+B,EAC/B,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,cAAc,EACd,cAAc,EACd,eAAe,EAEf,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAyB,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,mBAAmB,EAGnB,mBAAmB,EACnB,gBAAgB,IAAI,mBAAmB,EACvC,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,wBAAwB,GAC/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B,EAG1B,0BAA0B,EAC1B,iBAAiB,IAAI,mBAAmB,EACxC,iBAAiB,IAAI,mBAAmB,EACxC,kBAAkB,IAAI,+BAA+B,GACtD,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAIL,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,+BAA+B,EAC/B,aAAa,GACd,MAAM,UAAU,CAAC;AAElB,OAAO,EAGL,WAAW,EACX,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAA2B,qBAAqB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhG,OAAO,EAAmG,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGlL,OAAO,EAAkM,iCAAiC,EAAE,oCAAoC,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,uCAAuC,EAAE,yCAAyC,EAAE,MAAM,0BAA0B,CAAC;AAGjc,OAAO,EAA8G,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -22,12 +22,12 @@
22
22
  */
23
23
  import { BlindingKeyPair, type BlindedAttribute, type BlindedIssuanceProof, type BlindingPublicKey } from '../credentials/issuance.js';
24
24
  import { type PresentationProof } from '../credentials/presentation.js';
25
- import type { Credential, CredentialKeyPair, CredentialPublicKey } from '../credentials/credentials.js';
25
+ import type { Credential, CredentialPublicKey } from '../credentials/credentials.js';
26
26
  import { type UidStruct, type ServiceId } from './uid-struct.js';
27
27
  import { type ProfileKeyStruct } from './profile-key-struct.js';
28
28
  import { type UidEncCiphertext } from './uid-encryption.js';
29
29
  import { type ProfileKeyEncCiphertext } from './profile-key-encryption.js';
30
- import type { GroupSecretParams, GroupPublicParams } from './group-params.js';
30
+ import type { GroupSecretParams } from './group-params.js';
31
31
  export {};
32
32
  /** Public request sent to the authenticated credential issuer. */
33
33
  export interface ProfileKeyCredentialRequest {
@@ -98,27 +98,6 @@ export interface ProfileKeyCredentialPresentation {
98
98
  /** Day-aligned epoch timestamp matching the credential. */
99
99
  readonly redemptionTime: number;
100
100
  }
101
- /**
102
- * Issue an ExpiringProfileKeyCredential for an authenticated ACI, blinded
103
- * ProfileKey request, and redemption time.
104
- *
105
- * Called by the server. Produces an issuance proof that the client can verify
106
- * to extract the credential.
107
- *
108
- * The issuer sees the authenticated ACI and redemption time. It never receives
109
- * the raw profile key or the client's blinding secret.
110
- *
111
- * CRITICAL: Use different randomness for each issuance. Reusing randomness
112
- * effectively reveals the server's private key.
113
- *
114
- * @param credentialKeyPair - The server's profile key credential signing key pair
115
- * @param aci - The user's ACI ServiceId
116
- * @param request - Client-created blinded profile-key request
117
- * @param redemptionTime - Day-aligned epoch timestamp (seconds)
118
- * @param randomness - At least 32 bytes of cryptographically secure randomness
119
- * @returns The issuance response to send to the client
120
- */
121
- export declare function issueProfileKeyCredential(credentialKeyPair: CredentialKeyPair, aci: ServiceId, request: ProfileKeyCredentialRequest, redemptionTime: number, randomness: Uint8Array): ExpiringProfileKeyCredentialResponse;
122
101
  /**
123
102
  * Receive and verify an ExpiringProfileKeyCredential issuance response.
124
103
  *
@@ -165,38 +144,8 @@ export declare function receiveProfileKeyCredential(publicKey: CredentialPublicK
165
144
  * @returns The presentation to send to the server
166
145
  */
167
146
  export declare function presentProfileKeyCredential(publicKey: CredentialPublicKey, credential: ExpiringProfileKeyCredential, groupSecretParams: GroupSecretParams, randomness: Uint8Array): ProfileKeyCredentialPresentation;
168
- /**
169
- * Verify a ProfileKeyCredentialPresentation against the server's key pair and
170
- * the group's public parameters.
171
- *
172
- * Called by the server. Checks that:
173
- * 1. The presentation proof is valid (ZK verification)
174
- * 2. The credential has not expired (redemptionTime >= currentTime)
175
- *
176
- * @param credentialKeyPair - The server's profile key credential signing key pair
177
- * @param groupPublicParams - The group's public parameters
178
- * @param presentation - The client's presentation proof
179
- * @param currentTime - Current time in epoch seconds for expiry check
180
- * @returns true if the presentation is valid
181
- * @throws {VerificationFailure} If the presentation proof is invalid or expired
182
- */
183
- export declare function verifyProfileKeyCredentialPresentation(credentialKeyPair: CredentialKeyPair, groupPublicParams: GroupPublicParams, presentation: ProfileKeyCredentialPresentation, currentTime: number): boolean;
184
147
  /** Serialize the fixed-width blinded request. */
185
148
  export declare function serializeProfileKeyCredentialRequest(request: ProfileKeyCredentialRequest): Uint8Array;
186
- /** Deserialize and validate the fixed-width blinded request. */
187
- export declare function deserializeProfileKeyCredentialRequest(bytes: Uint8Array): ProfileKeyCredentialRequest;
188
- /**
189
- * Serialize an ExpiringProfileKeyCredentialResponse to bytes.
190
- *
191
- * Format:
192
- * [redemptionTime: 8 bytes BE u64]
193
- * [credential.t: 32 bytes scalar LE]
194
- * [credential.U: 32 bytes point]
195
- * [credential.S1: 32 bytes point]
196
- * [credential.S2: 32 bytes point]
197
- * [pokshoProof: remaining bytes]
198
- */
199
- export declare function serializeProfileKeyCredentialResponse(response: ExpiringProfileKeyCredentialResponse): Uint8Array;
200
149
  /**
201
150
  * Deserialize an ExpiringProfileKeyCredentialResponse from bytes.
202
151
  */
@@ -213,8 +162,4 @@ export declare function deserializeProfileKeyCredentialResponse(bytes: Uint8Arra
213
162
  * [profileKey.E_A1: 32] [profileKey.E_A2: 32]
214
163
  */
215
164
  export declare function serializeProfileKeyCredentialPresentation(presentation: ProfileKeyCredentialPresentation): Uint8Array;
216
- /**
217
- * Deserialize a ProfileKeyCredentialPresentation from bytes.
218
- */
219
- export declare function deserializeProfileKeyCredentialPresentation(bytes: Uint8Array): ProfileKeyCredentialPresentation;
220
165
  //# sourceMappingURL=profile-key-credential.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile-key-credential.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/profile-key-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;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BAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,GACrB,gCAAgC,CAoBlC;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sCAAsC,CACpD,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,gCAAgC,EAC9C,WAAW,EAAE,MAAM,GAClB,OAAO,CAkBT;AAWD,iDAAiD;AACjD,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,2BAA2B,GACnC,UAAU,CAWZ;AAED,gEAAgE;AAChE,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,UAAU,GAChB,2BAA2B,CAe7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,oCAAoC,GAC7C,UAAU,CAoBZ;AAED;;GAEG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,UAAU,GAChB,oCAAoC,CAsBtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yCAAyC,CACvD,YAAY,EAAE,gCAAgC,GAC7C,UAAU,CAwCZ;AAED;;GAEG;AACH,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,UAAU,GAChB,gCAAgC,CA2DlC"}
1
+ {"version":3,"file":"profile-key-credential.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/profile-key-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAEL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE/F,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAA0B,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,K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ACjC;AAMD;;;;;;;;GAQG;AACH,MAAM,WAAW,gCAAgC;IAC/C,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,0DAA0D;IAC1D,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,yEAAyE;IACzE,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAC1D,2DAA2D;IAC3D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,EAAE,oCAAoC,EAC9C,cAAc,EAAE,kCAAkC,EAClD,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,4BAA4B,CAyB9B;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,4BAA4B,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,GACrB,gCAAgC,CAoBlC;AAWD,iDAAiD;AACjD,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,2BAA2B,GACnC,UAAU,CAWZ;AAED;;GAEG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,UAAU,GAChB,oCAAoC,CAsBtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yCAAyC,CACvD,YAAY,EAAE,gCAAgC,GAC7C,UAAU,CAwCZ"}
@@ -22,14 +22,11 @@
22
22
  */
23
23
  import { ShoHmacSha256, RistrettoPoint } from '../proofs/sho.js';
24
24
  import { IssuanceProofBuilder, BlindingKeyPair, VerificationFailure, } from '../credentials/issuance.js';
25
- import { PresentationProofBuilder, PresentationProofVerifier, } from '../credentials/presentation.js';
25
+ import { PresentationProofBuilder } from '../credentials/presentation.js';
26
26
  import { uidStructFromServiceId } from './uid-struct.js';
27
27
  import { profileKeyStructNew } from './profile-key-struct.js';
28
- import { UidEncryptionDomain } from './uid-encryption.js';
29
- import { ProfileKeyEncryptionDomain } from './profile-key-encryption.js';
30
28
  import { SECONDS_PER_DAY } from './group-params.js';
31
- import { scalarToBytes, bytesToScalarCanonical } from '../proofs/sho.js';
32
- import { Ciphertext } from '../credentials/attributes.js';
29
+ import { bytesToScalarCanonical } from '../proofs/sho.js';
33
30
  const enc = new TextEncoder();
34
31
  // ---------------------------------------------------------------------------
35
32
  // Constants
@@ -92,39 +89,6 @@ export function createProfileKeyCredentialRequest(aci, profileKeyBytes, randomne
92
89
  };
93
90
  }
94
91
  // ---------------------------------------------------------------------------
95
- // Issuance (server side)
96
- // ---------------------------------------------------------------------------
97
- /**
98
- * Issue an ExpiringProfileKeyCredential for an authenticated ACI, blinded
99
- * ProfileKey request, and redemption time.
100
- *
101
- * Called by the server. Produces an issuance proof that the client can verify
102
- * to extract the credential.
103
- *
104
- * The issuer sees the authenticated ACI and redemption time. It never receives
105
- * the raw profile key or the client's blinding secret.
106
- *
107
- * CRITICAL: Use different randomness for each issuance. Reusing randomness
108
- * effectively reveals the server's private key.
109
- *
110
- * @param credentialKeyPair - The server's profile key credential signing key pair
111
- * @param aci - The user's ACI ServiceId
112
- * @param request - Client-created blinded profile-key request
113
- * @param redemptionTime - Day-aligned epoch timestamp (seconds)
114
- * @param randomness - At least 32 bytes of cryptographically secure randomness
115
- * @returns The issuance response to send to the client
116
- */
117
- export function issueProfileKeyCredential(credentialKeyPair, aci, request, redemptionTime, randomness) {
118
- const aciUid = uidStructFromServiceId(aci);
119
- const builder = new IssuanceProofBuilder(CREDENTIAL_LABEL);
120
- builder.addAttribute(aciUid);
121
- builder.addPublicAttribute(redemptionTimePublicAttribute(redemptionTime));
122
- const issuanceProof = builder
123
- .addBlindedAttribute(request.blindedProfileKey)
124
- .issue(credentialKeyPair, request.blindingPublicKey, randomness);
125
- return { issuanceProof, redemptionTime };
126
- }
127
- // ---------------------------------------------------------------------------
128
92
  // Receive (client side)
129
93
  // ---------------------------------------------------------------------------
130
94
  /**
@@ -215,39 +179,6 @@ export function presentProfileKeyCredential(publicKey, credential, groupSecretPa
215
179
  };
216
180
  }
217
181
  // ---------------------------------------------------------------------------
218
- // Verification (server side)
219
- // ---------------------------------------------------------------------------
220
- /**
221
- * Verify a ProfileKeyCredentialPresentation against the server's key pair and
222
- * the group's public parameters.
223
- *
224
- * Called by the server. Checks that:
225
- * 1. The presentation proof is valid (ZK verification)
226
- * 2. The credential has not expired (redemptionTime >= currentTime)
227
- *
228
- * @param credentialKeyPair - The server's profile key credential signing key pair
229
- * @param groupPublicParams - The group's public parameters
230
- * @param presentation - The client's presentation proof
231
- * @param currentTime - Current time in epoch seconds for expiry check
232
- * @returns true if the presentation is valid
233
- * @throws {VerificationFailure} If the presentation proof is invalid or expired
234
- */
235
- export function verifyProfileKeyCredentialPresentation(credentialKeyPair, groupPublicParams, presentation, currentTime) {
236
- const { proof, uidEncCiphertext, profileKeyEncCiphertext, redemptionTime } = presentation;
237
- // Reject when the current time reaches or exceeds credential expiration.
238
- if (currentTime >= redemptionTime) {
239
- throw new VerificationFailure();
240
- }
241
- const verifier = new PresentationProofVerifier(CREDENTIAL_LABEL);
242
- // ACI checked against UID encryption public key
243
- verifier.addAttribute(uidEncCiphertext, groupPublicParams.uidEncPublicKey);
244
- // ProfileKey checked against PROFILE KEY encryption public key (different!)
245
- verifier.addAttribute(profileKeyEncCiphertext, groupPublicParams.profileKeyEncPublicKey);
246
- verifier.addPublicAttribute(redemptionTimePublicAttribute(redemptionTime));
247
- verifier.verify(credentialKeyPair, proof);
248
- return true;
249
- }
250
- // ---------------------------------------------------------------------------
251
182
  // Serialization helpers
252
183
  // ---------------------------------------------------------------------------
253
184
  const Point = RistrettoPoint;
@@ -266,53 +197,6 @@ export function serializeProfileKeyCredentialRequest(request) {
266
197
  points.forEach((point, index) => bytes.set(point.toBytes(), index * 32));
267
198
  return bytes;
268
199
  }
269
- /** Deserialize and validate the fixed-width blinded request. */
270
- export function deserializeProfileKeyCredentialRequest(bytes) {
271
- if (bytes.length !== PROFILE_KEY_CREDENTIAL_REQUEST_LENGTH) {
272
- throw new Error('deserializeProfileKeyCredentialRequest: invalid length');
273
- }
274
- const point = (index) => Point.fromBytes(bytes.subarray(index * 32, (index + 1) * 32));
275
- return {
276
- blindingPublicKey: { Y: point(0) },
277
- blindedProfileKey: {
278
- blindedPoints: [
279
- { D1: point(1), D2: point(2) },
280
- { D1: point(3), D2: point(4) },
281
- ],
282
- },
283
- };
284
- }
285
- /**
286
- * Serialize an ExpiringProfileKeyCredentialResponse to bytes.
287
- *
288
- * Format:
289
- * [redemptionTime: 8 bytes BE u64]
290
- * [credential.t: 32 bytes scalar LE]
291
- * [credential.U: 32 bytes point]
292
- * [credential.S1: 32 bytes point]
293
- * [credential.S2: 32 bytes point]
294
- * [pokshoProof: remaining bytes]
295
- */
296
- export function serializeProfileKeyCredentialResponse(response) {
297
- const { issuanceProof, redemptionTime } = response;
298
- const tBytes = scalarToBytes(issuanceProof.credential.t);
299
- const uBytes = issuanceProof.credential.U.toBytes();
300
- const s1Bytes = issuanceProof.credential.S1.toBytes();
301
- const s2Bytes = issuanceProof.credential.S2.toBytes();
302
- const proofBytes = issuanceProof.pokshoProof;
303
- if (proofBytes.length !== 352) {
304
- throw new Error('serializeProfileKeyCredentialResponse: invalid proof length');
305
- }
306
- const buf = new Uint8Array(8 + 32 + 32 + 32 + 32 + proofBytes.length);
307
- const view = new DataView(buf.buffer);
308
- view.setBigUint64(0, BigInt(redemptionTime), false);
309
- buf.set(tBytes, 8);
310
- buf.set(uBytes, 40);
311
- buf.set(s1Bytes, 72);
312
- buf.set(s2Bytes, 104);
313
- buf.set(proofBytes, 136);
314
- return buf;
315
- }
316
200
  /**
317
201
  * Deserialize an ExpiringProfileKeyCredentialResponse from bytes.
318
202
  */
@@ -384,60 +268,4 @@ export function serializeProfileKeyCredentialPresentation(presentation) {
384
268
  buf.set(profileKeyEncCiphertext.E_A2.toBytes(), offset);
385
269
  return buf;
386
270
  }
387
- /**
388
- * Deserialize a ProfileKeyCredentialPresentation from bytes.
389
- */
390
- export function deserializeProfileKeyCredentialPresentation(bytes) {
391
- // Minimum: 8 (time) + 96 (C_x0,C_x1,C_V) + 4 (cyCount) + 4 (proofLen) + 128 (4 ciphertext points)
392
- const MIN_LEN = 240;
393
- if (bytes.length < MIN_LEN) {
394
- throw new Error('deserializeProfileKeyCredentialPresentation: too short');
395
- }
396
- const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
397
- let offset = 0;
398
- const redemptionTime = Number(view.getBigUint64(offset, false));
399
- offset += 8;
400
- const C_x0 = Point.fromBytes(bytes.subarray(offset, offset + 32));
401
- offset += 32;
402
- const C_x1 = Point.fromBytes(bytes.subarray(offset, offset + 32));
403
- offset += 32;
404
- const C_V = Point.fromBytes(bytes.subarray(offset, offset + 32));
405
- offset += 32;
406
- const cyCount = view.getUint32(offset, true);
407
- offset += 4;
408
- // Bounds: cyCount * 32 + proofLen(4) + proof + ciphertexts(128) must fit in remaining bytes
409
- if (cyCount > 16 || offset + cyCount * 32 + 4 + 128 > bytes.length) {
410
- throw new Error('deserializeProfileKeyCredentialPresentation: cyCount out of bounds');
411
- }
412
- const C_y = [];
413
- for (let i = 0; i < cyCount; i++) {
414
- C_y.push(Point.fromBytes(bytes.subarray(offset, offset + 32)));
415
- offset += 32;
416
- }
417
- const proofLen = view.getUint32(offset, true);
418
- offset += 4;
419
- if (offset + proofLen + 128 > bytes.length) {
420
- throw new Error('deserializeProfileKeyCredentialPresentation: proofLen out of bounds');
421
- }
422
- const pokshoProof = bytes.slice(offset, offset + proofLen);
423
- offset += proofLen;
424
- const aciE_A1 = Point.fromBytes(bytes.subarray(offset, offset + 32));
425
- offset += 32;
426
- const aciE_A2 = Point.fromBytes(bytes.subarray(offset, offset + 32));
427
- offset += 32;
428
- const pkE_A1 = Point.fromBytes(bytes.subarray(offset, offset + 32));
429
- offset += 32;
430
- const pkE_A2 = Point.fromBytes(bytes.subarray(offset, offset + 32));
431
- offset += 32;
432
- // Reject trailing bytes
433
- if (offset !== bytes.length) {
434
- throw new Error('deserializeProfileKeyCredentialPresentation: trailing bytes');
435
- }
436
- return {
437
- proof: { C_x0, C_x1, C_V, C_y, pokshoProof },
438
- uidEncCiphertext: new Ciphertext(aciE_A1, aciE_A2, UidEncryptionDomain),
439
- profileKeyEncCiphertext: new Ciphertext(pkE_A1, pkE_A2, ProfileKeyEncryptionDomain),
440
- redemptionTime,
441
- };
442
- }
443
271
  //# sourceMappingURL=profile-key-credential.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile-key-credential.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/profile-key-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,eAAe,EAIf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAE1B,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAkC,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAyB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAyB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAgC,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEpG,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,qGAAqG;AACrG,MAAM,gBAAgB,GAAG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M,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IAED,OAAO;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE;QAC5C,gBAAgB,EAAE,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC;QACvE,uBAAuB,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,0BAA0B,CAAC;QACnF,cAAc;KACf,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"profile-key-credential.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/profile-key-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,eAAe,EAIf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAA0B,MAAM,6BAA6B,CAAC;AAK/F,OAAO,EAAkC,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAyB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAOlF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,qGAAqG;AACrG,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,sDAAsD,CAAC,CAAC;AAE5F,8EAA8E;AAC9E,uCAAuC;AACvC,8EAA8E;AAE9E;;;;;GAKG;AACH,SAAS,6BAA6B,CAAC,IAAY;IACjD,OAAO;QACL,QAAQ,CAAC,GAAkB;YACzB,MAAM,GAAG,GAA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70 +1,27 @@
1
1
  /**
2
- * Server parameters -- ServerSecretParams and ServerPublicParams
2
+ * Group authority parameters
3
3
  *
4
4
  *
5
- * The server holds a `ServerSecretParams` containing all credential-issuing
6
- * key material. Clients receive the corresponding `ServerPublicParams` for
7
- * verifying server responses.
5
+ * The server holds the secret keys for credential issuance and response signatures.
6
+ * Clients use the corresponding `ServerPublicParams` to verify server responses.
8
7
  *
9
8
  * Key material:
10
- * - credentialKeyPair: for issuing generic (auth) credentials
11
- * - endorsementKeyPair: for issuing group-send endorsements
12
- * - signingKeyPair: Ed25519-like Schnorr key for signing server responses
9
+ * - The credential key authenticates credentials.
10
+ * - The endorsement key authenticates group-send endorsements.
11
+ * - The Schnorr signing key authenticates server responses.
13
12
  *
14
13
  * All keys are derived deterministically from 32 bytes of randomness via
15
14
  * domain-separated SHO instances.
16
15
  *
17
16
  * @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
18
17
  */
19
- import { RistrettoPoint } from '../proofs/sho.js';
20
- import { type CredentialKeyPair, type CredentialPublicKey } from '../credentials/credentials.js';
21
- import { ServerRootKeyPair, ServerRootPublicKey } from '../credentials/endorsements.js';
18
+ import { type CredentialPublicKey } from '../credentials/credentials.js';
19
+ import { ServerRootPublicKey } from '../credentials/endorsements.js';
22
20
  export {};
23
21
  /** Minimum randomness length in bytes. */
24
22
  export declare const RANDOMNESS_LEN = 32;
25
23
  /** Signature length in bytes (Schnorr proof: 32 challenge + 32 response). */
26
24
  export declare const SIGNATURE_LEN = 64;
27
- /**
28
- * A Schnorr signing key pair: private scalar + public point.
29
- *
30
- * Equivalent to `crypto::signature::KeyPair` in the profile.
31
- */
32
- interface SigningKeyPair {
33
- /** Private signing scalar. */
34
- readonly signingKey: bigint;
35
- /** Public verification point (signingKey * G). */
36
- readonly publicKey: RistrettoPoint;
37
- }
38
- /**
39
- * All credential-issuing key material held by the server.
40
- *
41
- * Carries only the server-side key pairs used by this package:
42
- * - Generic credential issuance (auth credentials)
43
- * - Group-send endorsement issuance
44
- * - Response signing / verification
45
- */
46
- export interface ServerSecretParams {
47
- /** Key pair for issuing generic (auth) credentials. */
48
- readonly credentialKeyPair: CredentialKeyPair;
49
- /** Key pair for issuing profile key credentials. */
50
- readonly profileKeyCredentialKeyPair: CredentialKeyPair;
51
- /** Root key pair for issuing group-send endorsements. */
52
- readonly endorsementKeyPair: ServerRootKeyPair;
53
- /** Schnorr signing key pair for server response signatures. */
54
- readonly signingKeyPair: SigningKeyPair;
55
- }
56
- /**
57
- * Derive all server key material deterministically from randomness.
58
- *
59
- * Each key pair is derived from its own domain-separated SHO instance,
60
- * absorbing the provided randomness. That keeps independence between
61
- * the credential, endorsement, and signing keys.
62
- *
63
- * @param randomness - At least 32 bytes of cryptographically secure randomness
64
- * @returns A fully populated ServerSecretParams
65
- * @throws If randomness is too short
66
- */
67
- export declare function generateServerSecretParams(randomness: Uint8Array): ServerSecretParams;
68
25
  /**
69
26
  * Public keys for client-side verification of server responses.
70
27
  *
@@ -81,27 +38,6 @@ export interface ServerPublicParams {
81
38
  /** Public key for verifying server response signatures (32 bytes compressed). */
82
39
  readonly signingPublicKey: Uint8Array;
83
40
  }
84
- /**
85
- * Extract the public parameters from server secret parameters.
86
- *
87
- * @param secretParams - The server's secret parameters
88
- * @returns The corresponding public parameters safe for distribution
89
- */
90
- export declare function getServerPublicParams(secretParams: ServerSecretParams): ServerPublicParams;
91
- /**
92
- * Sign a message using the server's signing key.
93
- *
94
- * Uses a Schnorr signature (ZK proof of knowledge of discrete log) via
95
- * the poksho proof system. The randomness is first passed through a
96
- * domain-separated SHO to derive the proof nonce.
97
- *
98
- * @param secretParams - The server's secret parameters
99
- * @param randomness - At least 32 bytes of cryptographically secure randomness
100
- * @param message - The message bytes to sign
101
- * @returns Signature bytes (64 bytes: 32 challenge + 32 response)
102
- * @throws If randomness is too short
103
- */
104
- export declare function serverSign(secretParams: ServerSecretParams, randomness: Uint8Array, message: Uint8Array): Uint8Array;
105
41
  /**
106
42
  * Verify a server signature against the server's public parameters.
107
43
  *
@@ -1 +1 @@
1
- {"version":3,"file":"server-params.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/server-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiB,cAAc,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,CAAC;AAQV,0CAA0C;AAC1C,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,6EAA6E;AAC7E,eAAO,MAAM,aAAa,KAAK,CAAC;AAqBhC;;;;GAIG;AACH,UAAU,cAAc;IACtB,8BAA8B;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;CACpC;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,oDAAoD;IACpD,QAAQ,CAAC,2BAA2B,EAAE,iBAAiB,CAAC;IACxD,yDAAyD;IACzD,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;IAC/C,+DAA+D;IAC/D,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,UAAU,GAAG,kBAAkB,CA6CrF;AAMD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,wDAAwD;IACxD,QAAQ,CAAC,6BAA6B,EAAE,mBAAmB,CAAC;IAC5D,wDAAwD;IACxD,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IACnD,iFAAiF;IACjF,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,kBAAkB,GAAG,kBAAkB,CAO1F;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,UAAU,GAClB,UAAU,CAkBZ;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,EAC1D,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,GACpB,OAAO,CAQT"}
1
+ {"version":3,"file":"server-params.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/server-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,CAAC;AAOV,0CAA0C;AAC1C,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,6EAA6E;AAC7E,eAAO,MAAM,aAAa,KAAK,CAAC;AAMhC;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,wDAAwD;IACxD,QAAQ,CAAC,6BAA6B,EAAE,mBAAmB,CAAC;IAC5D,wDAAwD;IACxD,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IACnD,iFAAiF;IACjF,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,EAC1D,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,GACpB,OAAO,CAQT"}
@@ -1,27 +1,23 @@
1
1
  /**
2
- * Server parameters -- ServerSecretParams and ServerPublicParams
2
+ * Group authority parameters
3
3
  *
4
4
  *
5
- * The server holds a `ServerSecretParams` containing all credential-issuing
6
- * key material. Clients receive the corresponding `ServerPublicParams` for
7
- * verifying server responses.
5
+ * The server holds the secret keys for credential issuance and response signatures.
6
+ * Clients use the corresponding `ServerPublicParams` to verify server responses.
8
7
  *
9
8
  * Key material:
10
- * - credentialKeyPair: for issuing generic (auth) credentials
11
- * - endorsementKeyPair: for issuing group-send endorsements
12
- * - signingKeyPair: Ed25519-like Schnorr key for signing server responses
9
+ * - The credential key authenticates credentials.
10
+ * - The endorsement key authenticates group-send endorsements.
11
+ * - The Schnorr signing key authenticates server responses.
13
12
  *
14
13
  * All keys are derived deterministically from 32 bytes of randomness via
15
14
  * domain-separated SHO instances.
16
15
  *
17
16
  * @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
18
17
  */
19
- import { ShoHmacSha256, RistrettoPoint } from '../proofs/sho.js';
20
- import { schnorrSign, schnorrVerifySignature } from '../proofs/sign.js';
21
- import { generateKeyPair as generateCredentialKeyPair, } from '../credentials/credentials.js';
22
- import { ServerRootKeyPair } from '../credentials/endorsements.js';
18
+ import { RistrettoPoint } from '../proofs/sho.js';
19
+ import { schnorrVerifySignature } from '../proofs/sign.js';
23
20
  const Point = RistrettoPoint;
24
- const enc = new TextEncoder();
25
21
  // ---------------------------------------------------------------------------
26
22
  // Constants
27
23
  // ---------------------------------------------------------------------------
@@ -29,102 +25,6 @@ const enc = new TextEncoder();
29
25
  export const RANDOMNESS_LEN = 32;
30
26
  /** Signature length in bytes (Schnorr proof: 32 challenge + 32 response). */
31
27
  export const SIGNATURE_LEN = 64;
32
- // SHO labels -- must match profile for interoperability
33
- const LABEL_CREDENTIAL_KEY = enc.encode('Signal_ZKGroup_20221011_ServerSecretParams_Generate_GenericCredentialKeyPair');
34
- const LABEL_PROFILE_KEY_CREDENTIAL_KEY = enc.encode('Signal_ZKGroup_20221011_ServerSecretParams_Generate_ProfileKeyCredentialKeyPair');
35
- const LABEL_ENDORSEMENT_KEY = enc.encode('Signal_ZKGroup_20240215_ServerSecretParams_Generate_EndorsementRootKeyPair');
36
- const LABEL_SIGNING_KEY = enc.encode('Signal_ZKGroup_20221011_ServerSecretParams_Generate_SigningKey');
37
- const LABEL_SIGN = enc.encode('Signal_ZKGroup_20200424_Random_ServerSecretParams_Sign');
38
- /**
39
- * Derive all server key material deterministically from randomness.
40
- *
41
- * Each key pair is derived from its own domain-separated SHO instance,
42
- * absorbing the provided randomness. That keeps independence between
43
- * the credential, endorsement, and signing keys.
44
- *
45
- * @param randomness - At least 32 bytes of cryptographically secure randomness
46
- * @returns A fully populated ServerSecretParams
47
- * @throws If randomness is too short
48
- */
49
- export function generateServerSecretParams(randomness) {
50
- if (randomness.length < RANDOMNESS_LEN) {
51
- throw new Error(`generateServerSecretParams: need at least ${RANDOMNESS_LEN} bytes of randomness, got ${randomness.length}`);
52
- }
53
- // --- Credential key pair (auth) ---
54
- // Derive randomness for the credential key pair through a domain-separated SHO
55
- const credSho = new ShoHmacSha256(LABEL_CREDENTIAL_KEY);
56
- credSho.absorbAndRatchet(randomness);
57
- const credentialRandomness = credSho.squeezeAndRatchet(RANDOMNESS_LEN);
58
- const credentialKeyPair = generateCredentialKeyPair(credentialRandomness);
59
- // --- Profile key credential key pair ---
60
- // Separate key pair for profile key credentials (distinct from auth credentials)
61
- const pkCredSho = new ShoHmacSha256(LABEL_PROFILE_KEY_CREDENTIAL_KEY);
62
- pkCredSho.absorbAndRatchet(randomness);
63
- const pkCredentialRandomness = pkCredSho.squeezeAndRatchet(RANDOMNESS_LEN);
64
- const profileKeyCredentialKeyPair = generateCredentialKeyPair(pkCredentialRandomness);
65
- // --- Endorsement key pair ---
66
- // Derive randomness for the endorsement key pair through a domain-separated SHO
67
- const endSho = new ShoHmacSha256(LABEL_ENDORSEMENT_KEY);
68
- endSho.absorbAndRatchet(randomness);
69
- const endorsementRandomness = endSho.squeezeAndRatchet(RANDOMNESS_LEN);
70
- const endorsementKeyPair = ServerRootKeyPair.generate(endorsementRandomness);
71
- // --- Signing key pair ---
72
- // Derive the signing scalar directly from the SHO
73
- const sigSho = new ShoHmacSha256(LABEL_SIGNING_KEY);
74
- sigSho.absorbAndRatchet(randomness);
75
- const signingKey = sigSho.getScalar();
76
- const signingPublicKey = Point.BASE.multiply(signingKey);
77
- const signingKeyPair = {
78
- signingKey,
79
- publicKey: signingPublicKey,
80
- };
81
- return {
82
- credentialKeyPair,
83
- profileKeyCredentialKeyPair,
84
- endorsementKeyPair,
85
- signingKeyPair,
86
- };
87
- }
88
- /**
89
- * Extract the public parameters from server secret parameters.
90
- *
91
- * @param secretParams - The server's secret parameters
92
- * @returns The corresponding public parameters safe for distribution
93
- */
94
- export function getServerPublicParams(secretParams) {
95
- return {
96
- credentialPublicKey: secretParams.credentialKeyPair.publicKey,
97
- profileKeyCredentialPublicKey: secretParams.profileKeyCredentialKeyPair.publicKey,
98
- endorsementPublicKey: secretParams.endorsementKeyPair.publicKey(),
99
- signingPublicKey: secretParams.signingKeyPair.publicKey.toBytes(),
100
- };
101
- }
102
- // ---------------------------------------------------------------------------
103
- // Signing / Verification
104
- // ---------------------------------------------------------------------------
105
- /**
106
- * Sign a message using the server's signing key.
107
- *
108
- * Uses a Schnorr signature (ZK proof of knowledge of discrete log) via
109
- * the poksho proof system. The randomness is first passed through a
110
- * domain-separated SHO to derive the proof nonce.
111
- *
112
- * @param secretParams - The server's secret parameters
113
- * @param randomness - At least 32 bytes of cryptographically secure randomness
114
- * @param message - The message bytes to sign
115
- * @returns Signature bytes (64 bytes: 32 challenge + 32 response)
116
- * @throws If randomness is too short
117
- */
118
- export function serverSign(secretParams, randomness, message) {
119
- if (randomness.length < RANDOMNESS_LEN) {
120
- throw new Error(`serverSign: need at least ${RANDOMNESS_LEN} bytes of randomness, got ${randomness.length}`);
121
- }
122
- // Derive proof randomness through the signing domain before signing.
123
- const sho = new ShoHmacSha256(LABEL_SIGN);
124
- sho.absorbAndRatchet(randomness);
125
- const proofRandomness = sho.squeezeAndRatchet(RANDOMNESS_LEN);
126
- return schnorrSign(secretParams.signingKeyPair.signingKey, secretParams.signingKeyPair.publicKey, message, proofRandomness);
127
- }
128
28
  /**
129
29
  * Verify a server signature against the server's public parameters.
130
30
  *