@open-e2ee/signal-protocol-sdk 8.1.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 (387) hide show
  1. package/ADAPTERS.md +13 -31
  2. package/ARCHITECTURE.md +5 -7
  3. package/CHANGELOG.md +258 -0
  4. package/README.md +36 -48
  5. package/SECURITY.md +2 -2
  6. package/client/README.md +9 -0
  7. package/device/README.md +16 -7
  8. package/dist/client/client.d.ts +25 -16
  9. package/dist/client/client.d.ts.map +1 -1
  10. package/dist/client/client.js +115 -95
  11. package/dist/client/client.js.map +1 -1
  12. package/dist/client/config.d.ts +10 -17
  13. package/dist/client/config.d.ts.map +1 -1
  14. package/dist/client/config.js.map +1 -1
  15. package/dist/client/event-hooks.js +27 -0
  16. package/dist/client/event-hooks.js.map +1 -1
  17. package/dist/client/group-outbox.d.ts +31 -1
  18. package/dist/client/group-outbox.d.ts.map +1 -1
  19. package/dist/client/group-outbox.js +67 -58
  20. package/dist/client/group-outbox.js.map +1 -1
  21. package/dist/client/group-receive-authorization.d.ts +5 -0
  22. package/dist/client/group-receive-authorization.d.ts.map +1 -0
  23. package/dist/client/group-receive-authorization.js +32 -0
  24. package/dist/client/group-receive-authorization.js.map +1 -0
  25. package/dist/client/group-sender-key-operations.d.ts +15 -0
  26. package/dist/client/group-sender-key-operations.d.ts.map +1 -0
  27. package/dist/client/group-sender-key-operations.js +31 -0
  28. package/dist/client/group-sender-key-operations.js.map +1 -0
  29. package/dist/client/groups.d.ts +3 -1
  30. package/dist/client/groups.d.ts.map +1 -1
  31. package/dist/client/groups.js +5 -2
  32. package/dist/client/groups.js.map +1 -1
  33. package/dist/client/hosted-anonymous-delivery.d.ts +9 -1
  34. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  35. package/dist/client/hosted-anonymous-delivery.js +61 -22
  36. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  37. package/dist/client/hosted-transport.d.ts +7 -0
  38. package/dist/client/hosted-transport.d.ts.map +1 -1
  39. package/dist/client/hosted-transport.js +44 -6
  40. package/dist/client/hosted-transport.js.map +1 -1
  41. package/dist/client/key-rotation.d.ts.map +1 -1
  42. package/dist/client/key-rotation.js +2 -4
  43. package/dist/client/key-rotation.js.map +1 -1
  44. package/dist/client/prekeys.d.ts.map +1 -1
  45. package/dist/client/prekeys.js +1 -1
  46. package/dist/client/prekeys.js.map +1 -1
  47. package/dist/client/relay-device-refusal.d.ts +32 -0
  48. package/dist/client/relay-device-refusal.d.ts.map +1 -0
  49. package/dist/client/relay-device-refusal.js +36 -0
  50. package/dist/client/relay-device-refusal.js.map +1 -0
  51. package/dist/client/relay-subscription.d.ts +2 -0
  52. package/dist/client/relay-subscription.d.ts.map +1 -1
  53. package/dist/client/relay-subscription.js +3 -1
  54. package/dist/client/relay-subscription.js.map +1 -1
  55. package/dist/client/relay-work.d.ts +26 -0
  56. package/dist/client/relay-work.d.ts.map +1 -1
  57. package/dist/client/relay-work.js +37 -0
  58. package/dist/client/relay-work.js.map +1 -1
  59. package/dist/client/sealed-sender.d.ts.map +1 -1
  60. package/dist/client/sealed-sender.js +12 -17
  61. package/dist/client/sealed-sender.js.map +1 -1
  62. package/dist/client/sender-key-distribution.d.ts.map +1 -1
  63. package/dist/client/sender-key-distribution.js +4 -1
  64. package/dist/client/sender-key-distribution.js.map +1 -1
  65. package/dist/client/sessions.d.ts.map +1 -1
  66. package/dist/client/sessions.js +2 -4
  67. package/dist/client/sessions.js.map +1 -1
  68. package/dist/client/signal-service-cipher.d.ts +94 -6
  69. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  70. package/dist/client/signal-service-cipher.js +483 -184
  71. package/dist/client/signal-service-cipher.js.map +1 -1
  72. package/dist/client/types.d.ts +7 -0
  73. package/dist/client/types.d.ts.map +1 -1
  74. package/dist/client/types.js.map +1 -1
  75. package/dist/index.d.ts +27 -21
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +8 -17
  78. package/dist/index.js.map +1 -1
  79. package/dist/internal/crypto/pq/kyber.d.ts +1 -1
  80. package/dist/internal/crypto/pq/kyber.js +1 -1
  81. package/dist/internal/encoding/proto/sender-key-message.d.ts +2 -2
  82. package/dist/internal/encoding/proto/sender-key-message.d.ts.map +1 -1
  83. package/dist/internal/encoding/proto/sender-key-message.js +5 -2
  84. package/dist/internal/encoding/proto/sender-key-message.js.map +1 -1
  85. package/dist/internal/groups/manager.d.ts.map +1 -1
  86. package/dist/internal/groups/manager.js +5 -2
  87. package/dist/internal/groups/manager.js.map +1 -1
  88. package/dist/internal/groups/wire.d.ts +0 -2
  89. package/dist/internal/groups/wire.d.ts.map +1 -1
  90. package/dist/internal/groups/wire.js +0 -6
  91. package/dist/internal/groups/wire.js.map +1 -1
  92. package/dist/internal/manager/manager.d.ts +8 -7
  93. package/dist/internal/manager/manager.d.ts.map +1 -1
  94. package/dist/internal/manager/manager.js +34 -37
  95. package/dist/internal/manager/manager.js.map +1 -1
  96. package/dist/internal/protocol/double-ratchet/ratchet.d.ts +0 -17
  97. package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
  98. package/dist/internal/protocol/double-ratchet/ratchet.js +0 -4
  99. package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
  100. package/dist/internal/protocol/sealed-sender/certificate.d.ts +2 -32
  101. package/dist/internal/protocol/sealed-sender/certificate.d.ts.map +1 -1
  102. package/dist/internal/protocol/sealed-sender/certificate.js +4 -85
  103. package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -1
  104. package/dist/internal/protocol/sealed-sender/index.d.ts +2 -2
  105. package/dist/internal/protocol/sealed-sender/index.d.ts.map +1 -1
  106. package/dist/internal/protocol/sealed-sender/index.js +2 -6
  107. package/dist/internal/protocol/sealed-sender/index.js.map +1 -1
  108. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +0 -19
  109. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  110. package/dist/internal/protocol/sealed-sender/proto/index.js +1 -48
  111. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  112. package/dist/internal/protocol/sender-keys/manager.d.ts +9 -13
  113. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  114. package/dist/internal/protocol/sender-keys/manager.js +90 -95
  115. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  116. package/dist/internal/protocol/spqr/index.d.ts +1 -1
  117. package/dist/internal/protocol/spqr/index.d.ts.map +1 -1
  118. package/dist/internal/protocol/spqr/index.js +2 -2
  119. package/dist/internal/protocol/spqr/index.js.map +1 -1
  120. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts +0 -2
  121. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts.map +1 -1
  122. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js +4 -12
  123. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js.map +1 -1
  124. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -1
  125. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js +1 -3
  126. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js.map +1 -1
  127. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +1 -0
  128. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
  129. package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -1
  130. package/dist/internal/protocol/spqr/serialize.js +1 -4
  131. package/dist/internal/protocol/spqr/serialize.js.map +1 -1
  132. package/dist/internal/protocol/spqr/spqr.d.ts +1 -1
  133. package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
  134. package/dist/internal/protocol/spqr/spqr.js +2 -3
  135. package/dist/internal/protocol/spqr/spqr.js.map +1 -1
  136. package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
  137. package/dist/internal/protocol/x3dh/x3dh.js +1 -1
  138. package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
  139. package/dist/internal/protocol/zk/credentials/credentials.d.ts +3 -54
  140. package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -1
  141. package/dist/internal/protocol/zk/credentials/credentials.js +4 -91
  142. package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -1
  143. package/dist/internal/protocol/zk/credentials/endorsements.d.ts +3 -64
  144. package/dist/internal/protocol/zk/credentials/endorsements.d.ts.map +1 -1
  145. package/dist/internal/protocol/zk/credentials/endorsements.js +4 -134
  146. package/dist/internal/protocol/zk/credentials/endorsements.js.map +1 -1
  147. package/dist/internal/protocol/zk/credentials/index.d.ts +3 -3
  148. package/dist/internal/protocol/zk/credentials/index.d.ts.map +1 -1
  149. package/dist/internal/protocol/zk/credentials/index.js +3 -3
  150. package/dist/internal/protocol/zk/credentials/index.js.map +1 -1
  151. package/dist/internal/protocol/zk/credentials/issuance.d.ts +3 -26
  152. package/dist/internal/protocol/zk/credentials/issuance.d.ts.map +1 -1
  153. package/dist/internal/protocol/zk/credentials/issuance.js +3 -80
  154. package/dist/internal/protocol/zk/credentials/issuance.js.map +1 -1
  155. package/dist/internal/protocol/zk/credentials/presentation.d.ts +4 -73
  156. package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
  157. package/dist/internal/protocol/zk/credentials/presentation.js +4 -152
  158. package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
  159. package/dist/internal/protocol/zk/groups/auth-credential.d.ts +1 -61
  160. package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -1
  161. package/dist/internal/protocol/zk/groups/auth-credential.js +2 -196
  162. package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -1
  163. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts +1 -86
  164. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts.map +1 -1
  165. package/dist/internal/protocol/zk/groups/group-send-endorsement.js +1 -152
  166. package/dist/internal/protocol/zk/groups/group-send-endorsement.js.map +1 -1
  167. package/dist/internal/protocol/zk/groups/index.d.ts +4 -4
  168. package/dist/internal/protocol/zk/groups/index.d.ts.map +1 -1
  169. package/dist/internal/protocol/zk/groups/index.js +4 -4
  170. package/dist/internal/protocol/zk/groups/index.js.map +1 -1
  171. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +2 -57
  172. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts.map +1 -1
  173. package/dist/internal/protocol/zk/groups/profile-key-credential.js +2 -174
  174. package/dist/internal/protocol/zk/groups/profile-key-credential.js.map +1 -1
  175. package/dist/internal/protocol/zk/groups/server-params.d.ts +8 -72
  176. package/dist/internal/protocol/zk/groups/server-params.d.ts.map +1 -1
  177. package/dist/internal/protocol/zk/groups/server-params.js +8 -108
  178. package/dist/internal/protocol/zk/groups/server-params.js.map +1 -1
  179. package/dist/internal/protocol/zk/proofs/sign.d.ts +1 -2
  180. package/dist/internal/protocol/zk/proofs/sign.d.ts.map +1 -1
  181. package/dist/internal/protocol/zk/proofs/sign.js +2 -11
  182. package/dist/internal/protocol/zk/proofs/sign.js.map +1 -1
  183. package/dist/internal/sesame/device-registry.d.ts +24 -4
  184. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  185. package/dist/internal/sesame/device-registry.js +55 -28
  186. package/dist/internal/sesame/device-registry.js.map +1 -1
  187. package/dist/internal/sesame/manager.d.ts +79 -11
  188. package/dist/internal/sesame/manager.d.ts.map +1 -1
  189. package/dist/internal/sesame/manager.js +381 -280
  190. package/dist/internal/sesame/manager.js.map +1 -1
  191. package/dist/internal/session/cipher.d.ts +0 -5
  192. package/dist/internal/session/cipher.d.ts.map +1 -1
  193. package/dist/internal/session/cipher.js +3 -9
  194. package/dist/internal/session/cipher.js.map +1 -1
  195. package/dist/internal/session/ratchet.d.ts.map +1 -1
  196. package/dist/internal/session/ratchet.js +0 -2
  197. package/dist/internal/session/ratchet.js.map +1 -1
  198. package/dist/internal/session/record-locks.d.ts +46 -0
  199. package/dist/internal/session/record-locks.d.ts.map +1 -0
  200. package/dist/internal/session/record-locks.js +72 -0
  201. package/dist/internal/session/record-locks.js.map +1 -0
  202. package/dist/local/store/expo/adapter.d.ts +8 -2
  203. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  204. package/dist/local/store/expo/adapter.js +24 -3
  205. package/dist/local/store/expo/adapter.js.map +1 -1
  206. package/dist/local/store/expo/driver.d.ts +7 -0
  207. package/dist/local/store/expo/driver.d.ts.map +1 -1
  208. package/dist/local/store/expo/driver.js +16 -0
  209. package/dist/local/store/expo/driver.js.map +1 -1
  210. package/dist/local/store/key-value/adapter.d.ts +3 -3
  211. package/dist/local/store/key-value/adapter.d.ts.map +1 -1
  212. package/dist/local/store/key-value/adapter.js +91 -53
  213. package/dist/local/store/key-value/adapter.js.map +1 -1
  214. package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -1
  215. package/dist/local/store/key-value/backend-conformance.js +25 -0
  216. package/dist/local/store/key-value/backend-conformance.js.map +1 -1
  217. package/dist/local/store/key-value/batch.d.ts +3 -1
  218. package/dist/local/store/key-value/batch.d.ts.map +1 -1
  219. package/dist/local/store/key-value/batch.js +9 -1
  220. package/dist/local/store/key-value/batch.js.map +1 -1
  221. package/dist/local/store/key-value/storage.d.ts +6 -0
  222. package/dist/local/store/key-value/storage.d.ts.map +1 -1
  223. package/dist/local/store/key-value/transactional-backend.d.ts +1 -1
  224. package/dist/local/store/key-value/transactional-backend.js +1 -1
  225. package/dist/local/store/memory/adapter.d.ts +13 -3
  226. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  227. package/dist/local/store/memory/adapter.js +122 -73
  228. package/dist/local/store/memory/adapter.js.map +1 -1
  229. package/dist/local/store/reliability.d.ts +16 -0
  230. package/dist/local/store/reliability.d.ts.map +1 -1
  231. package/dist/local/store/reliability.js +58 -28
  232. package/dist/local/store/reliability.js.map +1 -1
  233. package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
  234. package/dist/local/store/sqlite/migrations.js +18 -0
  235. package/dist/local/store/sqlite/migrations.js.map +1 -1
  236. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts +3 -3
  237. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts.map +1 -1
  238. package/dist/local/store/sqlite/models/skipped-sender-key.js +13 -17
  239. package/dist/local/store/sqlite/models/skipped-sender-key.js.map +1 -1
  240. package/dist/local/store/sqlite/store.d.ts +3 -3
  241. package/dist/local/store/sqlite/store.d.ts.map +1 -1
  242. package/dist/local/store/sqlite/store.js +53 -23
  243. package/dist/local/store/sqlite/store.js.map +1 -1
  244. package/dist/local/store/web/adapter.d.ts +3 -3
  245. package/dist/local/store/web/adapter.d.ts.map +1 -1
  246. package/dist/local/store/web/adapter.js +122 -73
  247. package/dist/local/store/web/adapter.js.map +1 -1
  248. package/dist/local/vault/electron-safe-storage.d.ts.map +1 -1
  249. package/dist/local/vault/electron-safe-storage.js +15 -2
  250. package/dist/local/vault/electron-safe-storage.js.map +1 -1
  251. package/dist/profile/index.d.ts +2 -1
  252. package/dist/profile/index.d.ts.map +1 -1
  253. package/dist/profile/index.js +2 -1
  254. package/dist/profile/index.js.map +1 -1
  255. package/dist/profile/own-profile-key.d.ts +42 -0
  256. package/dist/profile/own-profile-key.d.ts.map +1 -0
  257. package/dist/profile/own-profile-key.js +64 -0
  258. package/dist/profile/own-profile-key.js.map +1 -0
  259. package/dist/profile/profile-key.d.ts +1 -34
  260. package/dist/profile/profile-key.d.ts.map +1 -1
  261. package/dist/profile/profile-key.js +3 -63
  262. package/dist/profile/profile-key.js.map +1 -1
  263. package/dist/profile/update-service.js +1 -1
  264. package/dist/profile/update-service.js.map +1 -1
  265. package/dist/remote/relay/index.d.ts +4 -7
  266. package/dist/remote/relay/index.d.ts.map +1 -1
  267. package/dist/remote/relay/index.js +5 -7
  268. package/dist/remote/relay/index.js.map +1 -1
  269. package/dist/remote/relay/types.d.ts +3 -3
  270. package/dist/types/api.d.ts +29 -8
  271. package/dist/types/api.d.ts.map +1 -1
  272. package/dist/username/link.d.ts.map +1 -1
  273. package/dist/username/link.js +1 -5
  274. package/dist/username/link.js.map +1 -1
  275. package/dist/utils/bounded-fan-out.d.ts +99 -0
  276. package/dist/utils/bounded-fan-out.d.ts.map +1 -0
  277. package/dist/utils/bounded-fan-out.js +180 -0
  278. package/dist/utils/bounded-fan-out.js.map +1 -0
  279. package/dist/utils/keyed-lock.d.ts +16 -0
  280. package/dist/utils/keyed-lock.d.ts.map +1 -0
  281. package/dist/utils/keyed-lock.js +39 -0
  282. package/dist/utils/keyed-lock.js.map +1 -0
  283. package/dist/versions.d.ts +3 -3
  284. package/dist/versions.js +3 -3
  285. package/dist/zk/credentials.d.ts +2 -2
  286. package/dist/zk/credentials.js +2 -2
  287. package/dist/zk/groups.d.ts +3 -3
  288. package/dist/zk/groups.d.ts.map +1 -1
  289. package/dist/zk/groups.js +3 -3
  290. package/dist/zk/groups.js.map +1 -1
  291. package/docs/ASSURANCE.md +69 -28
  292. package/docs/CLIENT_COMPOSITION.md +9 -3
  293. package/docs/DEVIATIONS.md +45 -27
  294. package/docs/GETTING_STARTED.md +42 -320
  295. package/docs/INTERFACES.md +7 -7
  296. package/docs/PACKAGE_SURFACE.md +14 -16
  297. package/docs/RECIPES.md +6 -112
  298. package/groups/README.md +9 -1
  299. package/hooks/README.md +11 -2
  300. package/local/store/README.md +26 -6
  301. package/local/store/expo/README.md +18 -5
  302. package/local/store/key-value/README.md +5 -3
  303. package/local/store/node/README.md +2 -1
  304. package/local/store/web-sqlite/README.md +28 -8
  305. package/local/vault/README.md +21 -2
  306. package/package.json +1 -30
  307. package/remote/README.md +12 -78
  308. package/remote/object-store/convex-r2/README.md +20 -42
  309. package/remote/relay/README.md +21 -18
  310. package/zk/README.md +6 -7
  311. package/dist/client/dual-store.d.ts +0 -70
  312. package/dist/client/dual-store.d.ts.map +0 -1
  313. package/dist/client/dual-store.js +0 -123
  314. package/dist/client/dual-store.js.map +0 -1
  315. package/dist/client/multi-device.d.ts +0 -74
  316. package/dist/client/multi-device.d.ts.map +0 -1
  317. package/dist/client/multi-device.js +0 -105
  318. package/dist/client/multi-device.js.map +0 -1
  319. package/dist/groups/server.d.ts +0 -10
  320. package/dist/groups/server.d.ts.map +0 -1
  321. package/dist/groups/server.js +0 -6
  322. package/dist/groups/server.js.map +0 -1
  323. package/dist/internal/encoding/index.d.ts +0 -2
  324. package/dist/internal/encoding/index.d.ts.map +0 -1
  325. package/dist/internal/encoding/index.js +0 -2
  326. package/dist/internal/encoding/index.js.map +0 -1
  327. package/dist/internal/groups/server-engine.d.ts +0 -118
  328. package/dist/internal/groups/server-engine.d.ts.map +0 -1
  329. package/dist/internal/groups/server-engine.js +0 -1268
  330. package/dist/internal/groups/server-engine.js.map +0 -1
  331. package/dist/internal/protocol/index.d.ts +0 -24
  332. package/dist/internal/protocol/index.d.ts.map +0 -1
  333. package/dist/internal/protocol/index.js +0 -9
  334. package/dist/internal/protocol/index.js.map +0 -1
  335. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +0 -56
  336. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +0 -1
  337. package/dist/internal/protocol/sealed-sender/trust-root.js +0 -90
  338. package/dist/internal/protocol/sealed-sender/trust-root.js.map +0 -1
  339. package/dist/internal/protocol/triple-ratchet/index.d.ts +0 -21
  340. package/dist/internal/protocol/triple-ratchet/index.d.ts.map +0 -1
  341. package/dist/internal/protocol/triple-ratchet/index.js +0 -19
  342. package/dist/internal/protocol/triple-ratchet/index.js.map +0 -1
  343. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +0 -233
  344. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +0 -1
  345. package/dist/internal/protocol/triple-ratchet/ratchet.js +0 -254
  346. package/dist/internal/protocol/triple-ratchet/ratchet.js.map +0 -1
  347. package/dist/internal/protocol/zk/proofs/index.d.ts +0 -13
  348. package/dist/internal/protocol/zk/proofs/index.d.ts.map +0 -1
  349. package/dist/internal/protocol/zk/proofs/index.js +0 -7
  350. package/dist/internal/protocol/zk/proofs/index.js.map +0 -1
  351. package/dist/local/store/sqlite/index.d.ts +0 -20
  352. package/dist/local/store/sqlite/index.d.ts.map +0 -1
  353. package/dist/local/store/sqlite/index.js +0 -18
  354. package/dist/local/store/sqlite/index.js.map +0 -1
  355. package/dist/remote/object-store/convex-r2/server/index.d.ts +0 -2
  356. package/dist/remote/object-store/convex-r2/server/index.d.ts.map +0 -1
  357. package/dist/remote/object-store/convex-r2/server/index.js +0 -2
  358. package/dist/remote/object-store/convex-r2/server/index.js.map +0 -1
  359. package/dist/remote/object-store/convex-r2/server.d.ts +0 -129
  360. package/dist/remote/object-store/convex-r2/server.d.ts.map +0 -1
  361. package/dist/remote/object-store/convex-r2/server.js +0 -244
  362. package/dist/remote/object-store/convex-r2/server.js.map +0 -1
  363. package/dist/remote/relay/memory/adapter.d.ts +0 -252
  364. package/dist/remote/relay/memory/adapter.d.ts.map +0 -1
  365. package/dist/remote/relay/memory/adapter.js +0 -1058
  366. package/dist/remote/relay/memory/adapter.js.map +0 -1
  367. package/dist/remote/relay/memory/failures.d.ts +0 -58
  368. package/dist/remote/relay/memory/failures.d.ts.map +0 -1
  369. package/dist/remote/relay/memory/failures.js +0 -124
  370. package/dist/remote/relay/memory/failures.js.map +0 -1
  371. package/dist/remote/relay/memory/group-server.d.ts +0 -13
  372. package/dist/remote/relay/memory/group-server.d.ts.map +0 -1
  373. package/dist/remote/relay/memory/group-server.js +0 -19
  374. package/dist/remote/relay/memory/group-server.js.map +0 -1
  375. package/dist/remote/relay/memory/index.d.ts +0 -11
  376. package/dist/remote/relay/memory/index.d.ts.map +0 -1
  377. package/dist/remote/relay/memory/index.js +0 -7
  378. package/dist/remote/relay/memory/index.js.map +0 -1
  379. package/examples/browser/README.md +0 -35
  380. package/examples/browser/index.html +0 -27
  381. package/examples/browser/src/exchange.ts +0 -69
  382. package/examples/browser/src/main.ts +0 -63
  383. package/examples/browser/src/style.css +0 -9
  384. package/examples/browser/src/worker.ts +0 -10
  385. package/examples/browser/vite.config.ts +0 -9
  386. package/remote/relay/memory/README.md +0 -72
  387. package/scripts/oe-groups.mjs +0 -166
@@ -20,47 +20,10 @@
20
20
  * @see https://signal.org/docs/ -- Signal Protocol Specifications
21
21
  * @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
22
22
  */
23
- import { ServerRootKeyPair, ServerRootPublicKey, ServerDerivedKeyPair, EndorsementResponse, Endorsement } from '../credentials/endorsements.js';
23
+ import { ServerRootPublicKey, EndorsementResponse, Endorsement } from '../credentials/endorsements.js';
24
24
  import type { ServiceId } from './uid-struct.js';
25
- import type { UidEncCiphertext } from './uid-encryption.js';
26
25
  import { type GroupSecretParams } from './group-params.js';
27
26
  export {};
28
- /**
29
- * A key pair used to sign endorsements for a particular expiration.
30
- *
31
- * Derived daily from a {@link ServerRootKeyPair} by absorbing the
32
- * day-aligned expiration timestamp. Intended to be cheaply cached --
33
- * regeneration is not expensive, but these are reused frequently
34
- * enough that caching is worthwhile.
35
- */
36
- export interface GroupSendDerivedKeyPair {
37
- /** The derived server key pair for endorsement issuance/verification. */
38
- readonly keyPair: ServerDerivedKeyPair;
39
- /** Day-aligned expiration timestamp in epoch seconds. */
40
- readonly expiration: number;
41
- }
42
- /**
43
- * Derive the appropriate key pair for the given expiration.
44
- *
45
- * @param rootKeyPair - The server's root key pair
46
- * @param expiration - Day-aligned epoch seconds timestamp
47
- * @returns The derived key pair bound to the expiration
48
- * @throws Error if expiration is not day-aligned
49
- */
50
- export declare function deriveForExpiration(rootKeyPair: ServerRootKeyPair, expiration: number): GroupSendDerivedKeyPair;
51
- /**
52
- * Compute the default expiration for endorsements issued at `currentTime`.
53
- *
54
- * Returns the end of the next UTC day. If that is less than 25 hours away, it
55
- * returns the end of the following day.
56
- *
57
- * Endorsements therefore stay valid for at least 25 hours,
58
- * providing a comfortable buffer for clock skew and timezone issues.
59
- *
60
- * @param currentTime - Current time in epoch seconds
61
- * @returns Day-aligned expiration timestamp in epoch seconds
62
- */
63
- export declare function defaultExpiration(currentTime: number): number;
64
27
  /**
65
28
  * A response from the group server containing endorsements for all group
66
29
  * members.
@@ -75,19 +38,6 @@ export interface GroupSendEndorsementsResponse {
75
38
  /** Day-aligned expiration in epoch seconds for all endorsements. */
76
39
  readonly expiration: number;
77
40
  }
78
- /**
79
- * Issue endorsements for all group members.
80
- *
81
- * Takes an array of UID encryption ciphertexts, one per member. Sorts them
82
- * deterministically, extracts the E_A1 points, and issues endorsements over
83
- * those points using the derived key pair.
84
- *
85
- * @param memberCiphertexts - Encrypted UIDs of group members
86
- * @param derivedKeyPair - Key pair derived for the target expiration
87
- * @param randomness - 32 bytes of randomness for the batch proof
88
- * @returns Response containing endorsements and expiration
89
- */
90
- export declare function issueEndorsements(memberCiphertexts: UidEncCiphertext[], derivedKeyPair: GroupSendDerivedKeyPair, randomness: Uint8Array): GroupSendEndorsementsResponse;
91
41
  /**
92
42
  * An endorsement as extracted from a {@link GroupSendEndorsementsResponse}.
93
43
  *
@@ -191,33 +141,6 @@ export interface GroupSendFullToken {
191
141
  * @returns A full token ready for verification
192
142
  */
193
143
  export declare function createFullToken(token: GroupSendToken, expiration: number): GroupSendFullToken;
194
- /**
195
- * Verify that a full token is valid for sending to the given ServiceIds
196
- * at the current time.
197
- *
198
- * The chat server calls this to authorize a group send. Verification:
199
- * 1. Checks that the token has not expired
200
- * 2. Asserts the expiration matches the derived key pair
201
- * 3. Sums the M1 points of all recipient ServiceIds
202
- * 4. Verifies the token against the summed point using the derived key
203
- *
204
- * @param fullToken - The full token to verify
205
- * @param serviceIds - ServiceIds the sender claims to be sending to
206
- * @param now - Current time in epoch seconds
207
- * @param derivedKeyPair - Key pair derived for the token's expiration
208
- * @returns true if the token is valid
209
- * @throws VerificationFailure if verification fails
210
- */
211
- export declare function verifyFullToken(fullToken: GroupSendFullToken, serviceIds: ServiceId[], now: number, derivedKeyPair: GroupSendDerivedKeyPair): boolean;
212
- /**
213
- * Serialize a {@link GroupSendEndorsementsResponse} to bytes.
214
- *
215
- * Format: [expiration (8 bytes BE)] [endorsement response bytes]
216
- *
217
- * @param response - The response to serialize
218
- * @returns The serialized bytes
219
- */
220
- export declare function serializeEndorsementsResponse(response: GroupSendEndorsementsResponse): Uint8Array;
221
144
  /**
222
145
  * Deserialize a {@link GroupSendEndorsementsResponse} from bytes.
223
146
  *
@@ -235,12 +158,4 @@ export declare function deserializeEndorsementsResponse(bytes: Uint8Array): Grou
235
158
  * @returns The serialized bytes (24 bytes)
236
159
  */
237
160
  export declare function serializeFullToken(fullToken: GroupSendFullToken): Uint8Array;
238
- /**
239
- * Deserialize a {@link GroupSendFullToken} from bytes.
240
- *
241
- * @param bytes - The serialized bytes (24 bytes)
242
- * @returns The deserialized full token
243
- * @throws Error if the bytes are malformed
244
- */
245
- export declare function deserializeFullToken(bytes: Uint8Array): GroupSendFullToken;
246
161
  //# sourceMappingURL=group-send-endorsement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"group-send-endorsement.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/group-send-endorsement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EAGpB,mBAAmB,EACnB,WAAW,EACZ,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,KAAK,iBAAiB,EAAmB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,CAAC;AAiBV;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAkBD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,iBAAiB,EAC9B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,wBAAwB;IACxB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAE7F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,kBAAkB,EAC7B,UAAU,EAAE,SAAS,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,uBAAuB,GACtC,OAAO,CA+BT;AAMD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,6BAA6B,GAAG,UAAU,CAOjG;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,UAAU,GAAG,6BAA6B,CAShG;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,UAAU,CAM5E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,kBAAkB,CAQ1E"}
1
+ {"version":3,"file":"group-send-endorsement.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/group-send-endorsement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,mBAAmB,EAA+C,mBAAmB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAIjJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,KAAK,iBAAiB,EAAmB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,CAAC;AAiCV;;;;;;;GAOG;AACH,MAAM,WAAW,6BAA6B;IAC5C,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,oEAAoE;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7 +20,7 @@
20
20
  * @see https://signal.org/docs/ -- Signal Protocol Specifications
21
21
  * @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
22
22
  */
23
- import { ClientDecryptionKey, EndorsementResponse, Endorsement, } from '../credentials/endorsements.js';
23
+ import { ClientDecryptionKey, EndorsementResponse, Endorsement } from '../credentials/endorsements.js';
24
24
  import { VerificationFailure } from '../credentials/issuance.js';
25
25
  import { ShoHmacSha256 } from '../proofs/sho.js';
26
26
  import { seedM1, calcM1 } from './uid-struct.js';
@@ -48,44 +48,6 @@ function tagInfo(expiration) {
48
48
  sho.absorbAndRatchet(buf);
49
49
  return sho;
50
50
  }
51
- /**
52
- * Derive the appropriate key pair for the given expiration.
53
- *
54
- * @param rootKeyPair - The server's root key pair
55
- * @param expiration - Day-aligned epoch seconds timestamp
56
- * @returns The derived key pair bound to the expiration
57
- * @throws Error if expiration is not day-aligned
58
- */
59
- export function deriveForExpiration(rootKeyPair, expiration) {
60
- if (expiration % SECONDS_PER_DAY !== 0) {
61
- throw new Error(`deriveForExpiration: expiration must be day-aligned (multiple of ${SECONDS_PER_DAY}), got ${expiration}`);
62
- }
63
- const keyPair = rootKeyPair.deriveKey(tagInfo(expiration));
64
- return { keyPair, expiration };
65
- }
66
- // ---------------------------------------------------------------------------
67
- // Default expiration
68
- // ---------------------------------------------------------------------------
69
- /**
70
- * Compute the default expiration for endorsements issued at `currentTime`.
71
- *
72
- * Returns the end of the next UTC day. If that is less than 25 hours away, it
73
- * returns the end of the following day.
74
- *
75
- * Endorsements therefore stay valid for at least 25 hours,
76
- * providing a comfortable buffer for clock skew and timezone issues.
77
- *
78
- * @param currentTime - Current time in epoch seconds
79
- * @returns Day-aligned expiration timestamp in epoch seconds
80
- */
81
- export function defaultExpiration(currentTime) {
82
- const startOfDay = currentTime - (currentTime % SECONDS_PER_DAY);
83
- let expiration = startOfDay + 2 * SECONDS_PER_DAY;
84
- if (expiration - currentTime < SECONDS_PER_DAY + SECONDS_PER_HOUR) {
85
- expiration += SECONDS_PER_DAY;
86
- }
87
- return expiration;
88
- }
89
51
  // ---------------------------------------------------------------------------
90
52
  // Point sorting (deterministic ordering)
91
53
  // ---------------------------------------------------------------------------
@@ -115,39 +77,6 @@ function sortPointsByKeys(points, sortKeys) {
115
77
  return 0;
116
78
  });
117
79
  }
118
- // ---------------------------------------------------------------------------
119
- // Issue endorsements (server-side)
120
- // ---------------------------------------------------------------------------
121
- /**
122
- * Issue endorsements for all group members.
123
- *
124
- * Takes an array of UID encryption ciphertexts, one per member. Sorts them
125
- * deterministically, extracts the E_A1 points, and issues endorsements over
126
- * those points using the derived key pair.
127
- *
128
- * @param memberCiphertexts - Encrypted UIDs of group members
129
- * @param derivedKeyPair - Key pair derived for the target expiration
130
- * @param randomness - 32 bytes of randomness for the batch proof
131
- * @returns Response containing endorsements and expiration
132
- */
133
- export function issueEndorsements(memberCiphertexts, derivedKeyPair, randomness) {
134
- // Extract E_A1 (first point of each ciphertext) with original indices
135
- const indexedPoints = memberCiphertexts.map((ct, i) => [
136
- i,
137
- ct.E_A1,
138
- ]);
139
- // Compute sort keys before sorting
140
- const sortKeys = indexedPoints.map(([_i, point]) => point.add(point).toBytes());
141
- sortPointsByKeys(indexedPoints, sortKeys);
142
- // Extract just the sorted points for issuance
143
- const sortedPoints = indexedPoints.map(([_i, point]) => point);
144
- // Issue endorsements over the sorted points
145
- const response = EndorsementResponse.issue(sortedPoints, derivedKeyPair.keyPair, randomness);
146
- return {
147
- response,
148
- expiration: derivedKeyPair.expiration,
149
- };
150
- }
151
80
  /**
152
81
  * Create a {@link ReceivedEndorsement} wrapping the given endorsement.
153
82
  *
@@ -290,70 +219,6 @@ export function removeEndorsement(combined, unwanted) {
290
219
  export function createFullToken(token, expiration) {
291
220
  return { token, expiration };
292
221
  }
293
- /**
294
- * Verify that a full token is valid for sending to the given ServiceIds
295
- * at the current time.
296
- *
297
- * The chat server calls this to authorize a group send. Verification:
298
- * 1. Checks that the token has not expired
299
- * 2. Asserts the expiration matches the derived key pair
300
- * 3. Sums the M1 points of all recipient ServiceIds
301
- * 4. Verifies the token against the summed point using the derived key
302
- *
303
- * @param fullToken - The full token to verify
304
- * @param serviceIds - ServiceIds the sender claims to be sending to
305
- * @param now - Current time in epoch seconds
306
- * @param derivedKeyPair - Key pair derived for the token's expiration
307
- * @returns true if the token is valid
308
- * @throws VerificationFailure if verification fails
309
- */
310
- export function verifyFullToken(fullToken, serviceIds, now, derivedKeyPair) {
311
- if (now > fullToken.expiration) {
312
- throw new VerificationFailure();
313
- }
314
- if (fullToken.expiration !== derivedKeyPair.expiration) {
315
- throw new Error('verifyFullToken: wrong key pair used for this token ' +
316
- `(token expiration: ${fullToken.expiration}, ` +
317
- `key pair expiration: ${derivedKeyPair.expiration})`);
318
- }
319
- // Sum M1 points for all recipient ServiceIds
320
- const uidShoSeed = seedM1();
321
- let userIdSum = null;
322
- for (const serviceId of serviceIds) {
323
- const m1 = calcM1(uidShoSeed.clone(), serviceId);
324
- if (userIdSum === null) {
325
- userIdSum = m1;
326
- }
327
- else {
328
- userIdSum = userIdSum.add(m1);
329
- }
330
- }
331
- if (userIdSum === null) {
332
- throw new Error('verifyFullToken: serviceIds must not be empty');
333
- }
334
- // ServerDerivedKeyPair.verify throws VerificationFailure on mismatch
335
- derivedKeyPair.keyPair.verify(userIdSum, fullToken.token.token);
336
- return true;
337
- }
338
- // ---------------------------------------------------------------------------
339
- // Serialization helpers
340
- // ---------------------------------------------------------------------------
341
- /**
342
- * Serialize a {@link GroupSendEndorsementsResponse} to bytes.
343
- *
344
- * Format: [expiration (8 bytes BE)] [endorsement response bytes]
345
- *
346
- * @param response - The response to serialize
347
- * @returns The serialized bytes
348
- */
349
- export function serializeEndorsementsResponse(response) {
350
- const responseBytes = response.response.toBytes();
351
- const result = new Uint8Array(8 + responseBytes.length);
352
- const view = new DataView(result.buffer);
353
- view.setBigUint64(0, BigInt(response.expiration), false);
354
- result.set(responseBytes, 8);
355
- return result;
356
- }
357
222
  /**
358
223
  * Deserialize a {@link GroupSendEndorsementsResponse} from bytes.
359
224
  *
@@ -386,20 +251,4 @@ export function serializeFullToken(fullToken) {
386
251
  result.set(fullToken.token.token, 8);
387
252
  return result;
388
253
  }
389
- /**
390
- * Deserialize a {@link GroupSendFullToken} from bytes.
391
- *
392
- * @param bytes - The serialized bytes (24 bytes)
393
- * @returns The deserialized full token
394
- * @throws Error if the bytes are malformed
395
- */
396
- export function deserializeFullToken(bytes) {
397
- if (bytes.length < 24) {
398
- throw new Error('deserializeFullToken: expected at least 24 bytes, got ' + bytes.length);
399
- }
400
- const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
401
- const expiration = Number(view.getBigUint64(0, false));
402
- const token = bytes.slice(8, 24);
403
- return { token: { token }, expiration };
404
- }
405
254
  //# sourceMappingURL=group-send-endorsement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group-send-endorsement.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/group-send-endorsement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAKL,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,GACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAkB,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAA0B,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEzE,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,2BAA2B;AAC3B,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;AAEjC,uEAAuE;AACvE,MAAM,iBAAiB,GAAG,sCAAsC,CAAC;AAqBjE;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,UAAkB;IACjC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12,8 @@ export { ProfileKeyEncryptionDomain, type ProfileKeyEncKeyPair, type ProfileKeyE
12
12
  export { type GroupMasterKey, type GroupSecretParams, type GroupPublicParams, 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';
13
13
  export { lizardEncode, lizardDecode, fromUniformBytesSingleElligator, decode253Bits, } from './lizard.js';
14
14
  export { type UuidCiphertext, type ProfileKeyCiphertext, encryptUuid, decryptUuid, encryptProfileKeyCiphertext, decryptProfileKeyCiphertext, } from './client-zk-group-cipher.js';
15
- export { type ServerSecretParams, type ServerPublicParams, generateServerSecretParams, getServerPublicParams, serverSign, serverVerifySignature, SIGNATURE_LEN, } from './server-params.js';
16
- export { type AuthCredentialWithPniResponse, type AuthCredentialWithPni, type AuthCredentialPresentation, issueAuthCredential, receiveAuthCredential, presentAuthCredential, verifyAuthCredentialPresentation, } from './auth-credential.js';
17
- export { type ProfileKeyCredentialRequest, type ProfileKeyCredentialRequestContext, type ExpiringProfileKeyCredentialResponse, type ExpiringProfileKeyCredential, type ProfileKeyCredentialPresentation, createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest, deserializeProfileKeyCredentialRequest, issueProfileKeyCredential, receiveProfileKeyCredential, presentProfileKeyCredential, verifyProfileKeyCredentialPresentation, serializeProfileKeyCredentialResponse, deserializeProfileKeyCredentialResponse, serializeProfileKeyCredentialPresentation, deserializeProfileKeyCredentialPresentation, } from './profile-key-credential.js';
18
- export { type GroupSendDerivedKeyPair, type GroupSendEndorsementsResponse, type ReceivedEndorsement, type GroupSendToken, type GroupSendFullToken, deriveForExpiration, defaultExpiration, issueEndorsements, receiveEndorsements, combineEndorsements, removeEndorsement, createFullToken, verifyFullToken, serializeEndorsementsResponse, deserializeEndorsementsResponse, serializeFullToken, deserializeFullToken, } from './group-send-endorsement.js';
15
+ export { type ServerPublicParams, serverVerifySignature, SIGNATURE_LEN } from './server-params.js';
16
+ export { type AuthCredentialWithPniResponse, type AuthCredentialWithPni, type AuthCredentialPresentation, receiveAuthCredential, presentAuthCredential } from './auth-credential.js';
17
+ export { type ProfileKeyCredentialRequest, type ProfileKeyCredentialRequestContext, type ExpiringProfileKeyCredentialResponse, type ExpiringProfileKeyCredential, type ProfileKeyCredentialPresentation, createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest, receiveProfileKeyCredential, presentProfileKeyCredential, deserializeProfileKeyCredentialResponse, serializeProfileKeyCredentialPresentation } from './profile-key-credential.js';
18
+ export { type GroupSendEndorsementsResponse, type ReceivedEndorsement, type GroupSendToken, type GroupSendFullToken, receiveEndorsements, combineEndorsements, removeEndorsement, createFullToken, deserializeEndorsementsResponse, serializeFullToken } from './group-send-endorsement.js';
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC;AACV,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,SAAS,EACd,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,gBAAgB,IAAI,mBAAmB,EACvC,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,wBAAwB,GAC/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B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C,EACrC,uCAAuC,EACvC,yCAAyC,EACzC,2CAA2C,GAC5C,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,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.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC;AACV,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,SAAS,EACd,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,gBAAgB,IAAI,mBAAmB,EACvC,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,wBAAwB,GAC/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,iBAAiB,IAAI,mBAAmB,EACxC,iBAAiB,IAAI,mBAAmB,EACxC,kBAAkB,IAAI,+BAA+B,GACtD,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,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,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,WAAW,EACX,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,kBAAkB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhG,OAAO,EAAE,KAAK,6BAA6B,EAAE,KAAK,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGlL,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,kCAAkC,EAAE,KAAK,oCAAoC,EAAE,KAAK,4BAA4B,EAAE,KAAK,gCAAgC,EAAE,iCAAiC,EAAE,oCAAoC,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,uCAAuC,EAAE,yCAAyC,EAAE,MAAM,0BAA0B,CAAC;AAGjc,OAAO,EAAE,KAAK,6BAA6B,EAAE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -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":["../../../../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yB,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;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAEL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,4BAA4B,CAAC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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,KAAK,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,EAAE,CAAC;AAkCV,kEAAkE;AAClE,MAAM,WAA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