@open-e2ee/signal-protocol-sdk 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (1095) hide show
  1. package/ADAPTERS.md +24 -24
  2. package/ARCHITECTURE.md +4 -4
  3. package/CHANGELOG.md +1370 -0
  4. package/COMMERCIAL.md +56 -0
  5. package/NOTICE +3 -1
  6. package/README.md +40 -35
  7. package/SECURITY.md +15 -1
  8. package/blocking/README.md +5 -5
  9. package/client/README.md +5 -5
  10. package/device/README.md +3 -1
  11. package/dist/blocking/index.d.ts +2 -2
  12. package/dist/blocking/index.d.ts.map +1 -1
  13. package/dist/blocking/index.js +1 -1
  14. package/dist/blocking/index.js.map +1 -1
  15. package/dist/blocking/manager.d.ts +7 -7
  16. package/dist/blocking/manager.d.ts.map +1 -1
  17. package/dist/blocking/manager.js +3 -3
  18. package/dist/blocking/manager.js.map +1 -1
  19. package/dist/blocking/types.d.ts +4 -4
  20. package/dist/blocking/types.d.ts.map +1 -1
  21. package/dist/blocking/types.js +1 -1
  22. package/dist/client/client.d.ts +48 -41
  23. package/dist/client/client.d.ts.map +1 -1
  24. package/dist/client/client.js +160 -101
  25. package/dist/client/client.js.map +1 -1
  26. package/dist/client/compose.d.ts +15 -10
  27. package/dist/client/compose.d.ts.map +1 -1
  28. package/dist/client/compose.js +2 -0
  29. package/dist/client/compose.js.map +1 -1
  30. package/dist/client/config.d.ts +68 -34
  31. package/dist/client/config.d.ts.map +1 -1
  32. package/dist/client/config.js.map +1 -1
  33. package/dist/client/content-adapter.d.ts +4 -4
  34. package/dist/client/content-adapter.d.ts.map +1 -1
  35. package/dist/client/content-adapter.js +1 -1
  36. package/dist/client/content-adapter.js.map +1 -1
  37. package/dist/client/dual-store.d.ts +5 -5
  38. package/dist/client/dual-store.d.ts.map +1 -1
  39. package/dist/client/dual-store.js.map +1 -1
  40. package/dist/client/endorsement-manager.d.ts +23 -2
  41. package/dist/client/endorsement-manager.d.ts.map +1 -1
  42. package/dist/client/endorsement-manager.js +37 -12
  43. package/dist/client/endorsement-manager.js.map +1 -1
  44. package/dist/client/event-hooks.d.ts +1 -1
  45. package/dist/client/groups.d.ts +29 -29
  46. package/dist/client/groups.d.ts.map +1 -1
  47. package/dist/client/groups.js +54 -37
  48. package/dist/client/groups.js.map +1 -1
  49. package/dist/client/headless.d.ts +12 -12
  50. package/dist/client/headless.d.ts.map +1 -1
  51. package/dist/client/headless.js +9 -9
  52. package/dist/client/headless.js.map +1 -1
  53. package/dist/client/index.d.ts +4 -4
  54. package/dist/client/index.d.ts.map +1 -1
  55. package/dist/client/index.js +1 -1
  56. package/dist/client/index.js.map +1 -1
  57. package/dist/client/key-rotation-core.d.ts +11 -11
  58. package/dist/client/key-rotation-core.d.ts.map +1 -1
  59. package/dist/client/key-rotation-core.js +22 -22
  60. package/dist/client/key-rotation-core.js.map +1 -1
  61. package/dist/client/media.d.ts +2 -2
  62. package/dist/client/media.js +5 -5
  63. package/dist/client/media.js.map +1 -1
  64. package/dist/client/messages.js +2 -2
  65. package/dist/client/messages.js.map +1 -1
  66. package/dist/client/prekeys.js +1 -1
  67. package/dist/client/prekeys.js.map +1 -1
  68. package/dist/client/relay-subscription.d.ts +2 -2
  69. package/dist/client/relay-subscription.d.ts.map +1 -1
  70. package/dist/client/relay-subscription.js +18 -1
  71. package/dist/client/relay-subscription.js.map +1 -1
  72. package/dist/client/retry.js +1 -1
  73. package/dist/client/retry.js.map +1 -1
  74. package/dist/client/sealed-sender-ops.d.ts +28 -2
  75. package/dist/client/sealed-sender-ops.d.ts.map +1 -1
  76. package/dist/client/sealed-sender-ops.js +40 -10
  77. package/dist/client/sealed-sender-ops.js.map +1 -1
  78. package/dist/client/sessions.d.ts.map +1 -1
  79. package/dist/client/sessions.js +3 -0
  80. package/dist/client/sessions.js.map +1 -1
  81. package/dist/client/signal-service-cipher.d.ts +34 -11
  82. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  83. package/dist/client/signal-service-cipher.js +149 -75
  84. package/dist/client/signal-service-cipher.js.map +1 -1
  85. package/dist/client/types.d.ts +28 -15
  86. package/dist/client/types.d.ts.map +1 -1
  87. package/dist/client/types.js.map +1 -1
  88. package/dist/device/connection.js +2 -2
  89. package/dist/device/connection.js.map +1 -1
  90. package/dist/device/device-id.d.ts.map +1 -1
  91. package/dist/device/device-id.js +4 -4
  92. package/dist/device/device-id.js.map +1 -1
  93. package/dist/device/expo-metadata.d.ts +26 -0
  94. package/dist/device/expo-metadata.d.ts.map +1 -0
  95. package/dist/device/expo-metadata.js +33 -0
  96. package/dist/device/expo-metadata.js.map +1 -0
  97. package/dist/device/index.d.ts +1 -1
  98. package/dist/device/index.d.ts.map +1 -1
  99. package/dist/device/index.js +5 -1
  100. package/dist/device/index.js.map +1 -1
  101. package/dist/device/provisioning.d.ts +9 -17
  102. package/dist/device/provisioning.d.ts.map +1 -1
  103. package/dist/device/provisioning.js +13 -30
  104. package/dist/device/provisioning.js.map +1 -1
  105. package/dist/device/transfer.d.ts.map +1 -1
  106. package/dist/device/transfer.js +14 -14
  107. package/dist/device/transfer.js.map +1 -1
  108. package/dist/files/index.d.ts +1 -1
  109. package/dist/files/index.js +1 -1
  110. package/dist/groups/index.d.ts +4 -4
  111. package/dist/groups/index.d.ts.map +1 -1
  112. package/dist/groups/index.js +3 -3
  113. package/dist/groups/index.js.map +1 -1
  114. package/dist/hooks/use-connection-presence.d.ts +5 -5
  115. package/dist/hooks/use-connection-presence.d.ts.map +1 -1
  116. package/dist/hooks/use-connection-presence.js +5 -5
  117. package/dist/hooks/use-connection-presence.js.map +1 -1
  118. package/dist/hooks/use-group-membership.d.ts +2 -2
  119. package/dist/hooks/use-key-rotation.js +2 -2
  120. package/dist/hooks/use-key-rotation.js.map +1 -1
  121. package/dist/index.d.ts +29 -22
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +20 -13
  124. package/dist/index.js.map +1 -1
  125. package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
  126. package/dist/internal/crypto/ec/x25519-validation.js +4 -4
  127. package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
  128. package/dist/internal/crypto/index.d.ts +1 -1
  129. package/dist/internal/crypto/index.d.ts.map +1 -1
  130. package/dist/internal/crypto/index.js +2 -2
  131. package/dist/internal/crypto/index.js.map +1 -1
  132. package/dist/internal/crypto/kdf/hkdf.d.ts +1 -1
  133. package/dist/internal/crypto/kdf/hkdf.d.ts.map +1 -1
  134. package/dist/internal/crypto/kdf/hkdf.js +2 -2
  135. package/dist/internal/crypto/kdf/hkdf.js.map +1 -1
  136. package/dist/internal/crypto/key-prefix.d.ts +1 -1
  137. package/dist/internal/crypto/key-prefix.js +1 -1
  138. package/dist/internal/crypto/pq/kyber.d.ts +1 -1
  139. package/dist/internal/crypto/pq/kyber.js +1 -1
  140. package/dist/internal/crypto/random.d.ts +9 -0
  141. package/dist/internal/crypto/random.d.ts.map +1 -1
  142. package/dist/internal/crypto/random.js +16 -0
  143. package/dist/internal/crypto/random.js.map +1 -1
  144. package/dist/internal/crypto/symmetric/aes-gcm-siv.d.ts +1 -1
  145. package/dist/internal/crypto/symmetric/aes-gcm-siv.js +1 -1
  146. package/dist/internal/crypto/symmetric/mac.d.ts +3 -3
  147. package/dist/internal/crypto/symmetric/mac.js +3 -3
  148. package/dist/internal/crypto/utils.d.ts +2 -2
  149. package/dist/internal/crypto/utils.js +2 -2
  150. package/dist/internal/encoding/proto/envelope.d.ts +21 -21
  151. package/dist/internal/encoding/proto/envelope.d.ts.map +1 -1
  152. package/dist/internal/encoding/proto/envelope.js +25 -25
  153. package/dist/internal/encoding/proto/envelope.js.map +1 -1
  154. package/dist/internal/encoding/proto/index.d.ts +2 -2
  155. package/dist/internal/encoding/proto/index.d.ts.map +1 -1
  156. package/dist/internal/encoding/proto/index.js +3 -3
  157. package/dist/internal/encoding/proto/index.js.map +1 -1
  158. package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts +5 -5
  159. package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts.map +1 -1
  160. package/dist/internal/encoding/proto/pq-ratchet-serialize.js +4 -4
  161. package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -1
  162. package/dist/internal/encoding/proto/primitives.d.ts +261 -6
  163. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  164. package/dist/internal/encoding/proto/primitives.js +468 -6
  165. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  166. package/dist/internal/encoding/proto/sender-key-message.d.ts +4 -3
  167. package/dist/internal/encoding/proto/sender-key-message.d.ts.map +1 -1
  168. package/dist/internal/encoding/proto/sender-key-message.js +97 -76
  169. package/dist/internal/encoding/proto/sender-key-message.js.map +1 -1
  170. package/dist/internal/encoding/proto/signal-message.d.ts +39 -34
  171. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  172. package/dist/internal/encoding/proto/signal-message.js +236 -152
  173. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  174. package/dist/internal/groups/access-control.d.ts +170 -0
  175. package/dist/internal/groups/access-control.d.ts.map +1 -0
  176. package/dist/internal/groups/access-control.js +284 -0
  177. package/dist/internal/groups/access-control.js.map +1 -0
  178. package/dist/internal/groups/change-actions.d.ts +57 -0
  179. package/dist/internal/groups/change-actions.d.ts.map +1 -0
  180. package/dist/internal/groups/change-actions.js +827 -0
  181. package/dist/internal/groups/change-actions.js.map +1 -0
  182. package/dist/internal/groups/change-authorization.d.ts +16 -0
  183. package/dist/internal/groups/change-authorization.d.ts.map +1 -0
  184. package/dist/internal/groups/change-authorization.js +120 -0
  185. package/dist/internal/groups/change-authorization.js.map +1 -0
  186. package/dist/internal/{groups-v2 → groups}/encrypted-state.d.ts +12 -2
  187. package/dist/internal/groups/encrypted-state.d.ts.map +1 -0
  188. package/dist/internal/{groups-v2 → groups}/encrypted-state.js +122 -22
  189. package/dist/internal/groups/encrypted-state.js.map +1 -0
  190. package/dist/internal/groups/group-id.d.ts +9 -9
  191. package/dist/internal/groups/group-id.d.ts.map +1 -1
  192. package/dist/internal/groups/group-id.js +11 -12
  193. package/dist/internal/groups/group-id.js.map +1 -1
  194. package/dist/internal/groups/index.d.ts +16 -6
  195. package/dist/internal/groups/index.d.ts.map +1 -1
  196. package/dist/internal/groups/index.js +9 -1
  197. package/dist/internal/groups/index.js.map +1 -1
  198. package/dist/internal/groups/invite-link.d.ts.map +1 -0
  199. package/dist/internal/groups/invite-link.js.map +1 -0
  200. package/dist/internal/{groups-v2 → groups}/manager.d.ts +212 -43
  201. package/dist/internal/groups/manager.d.ts.map +1 -0
  202. package/dist/internal/groups/manager.js +1945 -0
  203. package/dist/internal/groups/manager.js.map +1 -0
  204. package/dist/internal/groups/sdk-store.d.ts +32 -0
  205. package/dist/internal/groups/sdk-store.d.ts.map +1 -0
  206. package/dist/internal/groups/sdk-store.js +111 -0
  207. package/dist/internal/groups/sdk-store.js.map +1 -0
  208. package/dist/internal/groups/server-engine.d.ts +98 -0
  209. package/dist/internal/groups/server-engine.d.ts.map +1 -0
  210. package/dist/internal/groups/server-engine.js +1235 -0
  211. package/dist/internal/groups/server-engine.js.map +1 -0
  212. package/dist/internal/groups/trust-root.d.ts +32 -0
  213. package/dist/internal/groups/trust-root.d.ts.map +1 -0
  214. package/dist/internal/groups/trust-root.js +91 -0
  215. package/dist/internal/groups/trust-root.js.map +1 -0
  216. package/dist/internal/{groups-v2 → groups}/types.d.ts +190 -41
  217. package/dist/internal/groups/types.d.ts.map +1 -0
  218. package/dist/internal/{groups-v2 → groups}/types.js +3 -2
  219. package/dist/internal/groups/types.js.map +1 -0
  220. package/dist/internal/groups/wire.d.ts +68 -0
  221. package/dist/internal/groups/wire.d.ts.map +1 -0
  222. package/dist/internal/groups/wire.js +708 -0
  223. package/dist/internal/groups/wire.js.map +1 -0
  224. package/dist/internal/manager/manager.d.ts +4 -4
  225. package/dist/internal/manager/manager.d.ts.map +1 -1
  226. package/dist/internal/manager/manager.js +28 -17
  227. package/dist/internal/manager/manager.js.map +1 -1
  228. package/dist/internal/protocol/double-ratchet/chains.d.ts +1 -1
  229. package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
  230. package/dist/internal/protocol/double-ratchet/chains.js +10 -10
  231. package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
  232. package/dist/internal/protocol/double-ratchet/ratchet.d.ts +3 -3
  233. package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
  234. package/dist/internal/protocol/double-ratchet/ratchet.js +3 -3
  235. package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
  236. package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
  237. package/dist/internal/protocol/pqxdh/pqxdh.js +3 -3
  238. package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
  239. package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +1 -1
  240. package/dist/internal/protocol/sealed-sender/decryption-v2.js +32 -18
  241. package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +1 -1
  242. package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
  243. package/dist/internal/protocol/sealed-sender/decryption.js +35 -21
  244. package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
  245. package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +1 -1
  246. package/dist/internal/protocol/sealed-sender/encryption-v2.js +8 -14
  247. package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +1 -1
  248. package/dist/internal/protocol/sealed-sender/encryption.d.ts +9 -4
  249. package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -1
  250. package/dist/internal/protocol/sealed-sender/encryption.js +7 -15
  251. package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -1
  252. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +56 -11
  253. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  254. package/dist/internal/protocol/sealed-sender/proto/index.js +278 -158
  255. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  256. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +45 -0
  257. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -0
  258. package/dist/internal/protocol/sealed-sender/trust-root.js +77 -0
  259. package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -0
  260. package/dist/internal/protocol/sealed-sender/types.d.ts +65 -10
  261. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  262. package/dist/internal/protocol/sealed-sender/types.js +44 -1
  263. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  264. package/dist/internal/protocol/sender-keys/index.d.ts +1 -1
  265. package/dist/internal/protocol/sender-keys/manager.d.ts +41 -4
  266. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  267. package/dist/internal/protocol/sender-keys/manager.js +113 -12
  268. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  269. package/dist/internal/protocol/spqr/index.d.ts +1 -1
  270. package/dist/internal/protocol/spqr/index.js +1 -1
  271. package/dist/internal/protocol/spqr/message.d.ts +1 -1
  272. package/dist/internal/protocol/spqr/message.js +1 -1
  273. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts +3 -3
  274. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -1
  275. package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.js +2 -2
  276. package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.js.map +1 -1
  277. package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.d.ts +1 -1
  278. package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.js +1 -1
  279. package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.js.map +1 -1
  280. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts +8 -2
  281. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts.map +1 -1
  282. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js +335 -152
  283. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js.map +1 -1
  284. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +5 -5
  285. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
  286. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +1 -1
  287. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
  288. package/dist/internal/protocol/spqr/spqr.d.ts +10 -10
  289. package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
  290. package/dist/internal/protocol/spqr/spqr.js +14 -14
  291. package/dist/internal/protocol/spqr/spqr.js.map +1 -1
  292. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +3 -3
  293. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -1
  294. package/dist/internal/protocol/triple-ratchet/ratchet.js +5 -5
  295. package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -1
  296. package/dist/internal/protocol/username/generate.d.ts +1 -1
  297. package/dist/internal/protocol/username/generate.js +1 -1
  298. package/dist/internal/protocol/username/hash.d.ts +1 -1
  299. package/dist/internal/protocol/username/hash.js +1 -1
  300. package/dist/internal/protocol/username/link.d.ts +1 -1
  301. package/dist/internal/protocol/username/link.js +1 -1
  302. package/dist/internal/protocol/username/proof.d.ts +1 -1
  303. package/dist/internal/protocol/username/proof.js +1 -1
  304. package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
  305. package/dist/internal/protocol/x3dh/x3dh.js +6 -6
  306. package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
  307. package/dist/internal/protocol/zk/groups/auth-credential.d.ts +14 -11
  308. package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -1
  309. package/dist/internal/protocol/zk/groups/auth-credential.js +68 -29
  310. package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -1
  311. package/dist/internal/protocol/zk/groups/client-zk-group-cipher.d.ts +2 -2
  312. package/dist/internal/protocol/zk/groups/client-zk-group-cipher.js +2 -2
  313. package/dist/internal/protocol/zk/groups/server-params.d.ts +1 -1
  314. package/dist/internal/protocol/zk/groups/server-params.d.ts.map +1 -1
  315. package/dist/internal/protocol/zk/groups/server-params.js.map +1 -1
  316. package/dist/internal/protocol/zk/groups/uid-struct.d.ts +2 -0
  317. package/dist/internal/protocol/zk/groups/uid-struct.d.ts.map +1 -1
  318. package/dist/internal/protocol/zk/groups/uid-struct.js +4 -0
  319. package/dist/internal/protocol/zk/groups/uid-struct.js.map +1 -1
  320. package/dist/internal/sesame/device-registry.d.ts +18 -13
  321. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  322. package/dist/internal/sesame/device-registry.js +13 -9
  323. package/dist/internal/sesame/device-registry.js.map +1 -1
  324. package/dist/internal/sesame/manager.d.ts +1 -1
  325. package/dist/internal/sesame/manager.d.ts.map +1 -1
  326. package/dist/internal/sesame/manager.js +66 -34
  327. package/dist/internal/sesame/manager.js.map +1 -1
  328. package/dist/internal/sesame/types.d.ts.map +1 -1
  329. package/dist/internal/sesame/types.js +7 -2
  330. package/dist/internal/sesame/types.js.map +1 -1
  331. package/dist/internal/session/builder.js +3 -3
  332. package/dist/internal/session/builder.js.map +1 -1
  333. package/dist/internal/session/cipher.d.ts +2 -2
  334. package/dist/internal/session/cipher.d.ts.map +1 -1
  335. package/dist/internal/session/cipher.js +38 -30
  336. package/dist/internal/session/cipher.js.map +1 -1
  337. package/dist/internal/session/decryption.d.ts +1 -1
  338. package/dist/internal/session/decryption.js +10 -10
  339. package/dist/internal/session/decryption.js.map +1 -1
  340. package/dist/internal/session/factory.d.ts.map +1 -1
  341. package/dist/internal/session/factory.js +3 -3
  342. package/dist/internal/session/factory.js.map +1 -1
  343. package/dist/internal/session/handshake.d.ts.map +1 -1
  344. package/dist/internal/session/handshake.js +3 -3
  345. package/dist/internal/session/handshake.js.map +1 -1
  346. package/dist/internal/session/keys.d.ts +1 -1
  347. package/dist/internal/session/ratchet.d.ts.map +1 -1
  348. package/dist/internal/session/ratchet.js +4 -4
  349. package/dist/internal/session/ratchet.js.map +1 -1
  350. package/dist/internal/session/types.d.ts +2 -2
  351. package/dist/internal/session/types.d.ts.map +1 -1
  352. package/dist/internal/session/validation.d.ts.map +1 -1
  353. package/dist/internal/session/validation.js +3 -3
  354. package/dist/internal/session/validation.js.map +1 -1
  355. package/dist/keys/generation.d.ts +4 -3
  356. package/dist/keys/generation.d.ts.map +1 -1
  357. package/dist/keys/generation.js +2 -2
  358. package/dist/keys/generation.js.map +1 -1
  359. package/dist/keys/identity.d.ts +32 -0
  360. package/dist/keys/identity.d.ts.map +1 -1
  361. package/dist/keys/identity.js +55 -0
  362. package/dist/keys/identity.js.map +1 -1
  363. package/dist/keys/index.d.ts +1 -1
  364. package/dist/keys/index.d.ts.map +1 -1
  365. package/dist/keys/index.js +1 -1
  366. package/dist/keys/index.js.map +1 -1
  367. package/dist/keys/types.d.ts +1 -1
  368. package/dist/keys/types.d.ts.map +1 -1
  369. package/dist/layers.d.ts +5 -5
  370. package/dist/layers.d.ts.map +1 -1
  371. package/dist/layers.js +9 -9
  372. package/dist/layers.js.map +1 -1
  373. package/dist/local/store/expo/adapter.d.ts +28 -25
  374. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  375. package/dist/local/store/expo/adapter.js +125 -113
  376. package/dist/local/store/expo/adapter.js.map +1 -1
  377. package/dist/local/store/expo/database-key.d.ts +2 -2
  378. package/dist/local/store/expo/database-key.d.ts.map +1 -1
  379. package/dist/local/store/expo/database-key.js +5 -5
  380. package/dist/local/store/expo/database-key.js.map +1 -1
  381. package/dist/local/store/expo/db.d.ts +13 -10
  382. package/dist/local/store/expo/db.d.ts.map +1 -1
  383. package/dist/local/store/expo/db.js +8 -3
  384. package/dist/local/store/expo/db.js.map +1 -1
  385. package/dist/local/store/expo/index.d.ts +5 -7
  386. package/dist/local/store/expo/index.d.ts.map +1 -1
  387. package/dist/local/store/expo/index.js +3 -3
  388. package/dist/local/store/expo/index.js.map +1 -1
  389. package/dist/local/store/expo/key-storage.d.ts +1 -1
  390. package/dist/local/store/expo/key-storage.d.ts.map +1 -1
  391. package/dist/local/store/expo/key-storage.js +4 -4
  392. package/dist/local/store/expo/key-storage.js.map +1 -1
  393. package/dist/local/store/expo/models/index.d.ts +1 -1
  394. package/dist/local/store/expo/models/index.d.ts.map +1 -1
  395. package/dist/local/store/expo/models/index.js +2 -2
  396. package/dist/local/store/expo/models/index.js.map +1 -1
  397. package/dist/local/store/expo/models/local-identity.d.ts +1 -1
  398. package/dist/local/store/expo/models/local-identity.js +1 -1
  399. package/dist/local/store/expo/models/sender-key.d.ts +101 -77
  400. package/dist/local/store/expo/models/sender-key.d.ts.map +1 -1
  401. package/dist/local/store/expo/models/sender-key.js +154 -124
  402. package/dist/local/store/expo/models/sender-key.js.map +1 -1
  403. package/dist/local/store/expo/schema.d.ts +135 -33
  404. package/dist/local/store/expo/schema.d.ts.map +1 -1
  405. package/dist/local/store/expo/schema.js +37 -8
  406. package/dist/local/store/expo/schema.js.map +1 -1
  407. package/dist/local/store/expo/secure-store-options.d.ts +2 -2
  408. package/dist/local/store/expo/secure-store-options.d.ts.map +1 -1
  409. package/dist/local/store/expo/secure-store-options.js +1 -1
  410. package/dist/local/store/expo/secure-store-options.js.map +1 -1
  411. package/dist/local/store/index.d.ts +9 -9
  412. package/dist/local/store/index.d.ts.map +1 -1
  413. package/dist/local/store/index.js +9 -9
  414. package/dist/local/store/index.js.map +1 -1
  415. package/dist/local/store/{mock → memory}/adapter.d.ts +14 -7
  416. package/dist/local/store/memory/adapter.d.ts.map +1 -0
  417. package/dist/local/store/{mock → memory}/adapter.js +156 -58
  418. package/dist/local/store/memory/adapter.js.map +1 -0
  419. package/dist/local/store/memory/failures.d.ts +34 -0
  420. package/dist/local/store/memory/failures.d.ts.map +1 -0
  421. package/dist/local/store/memory/failures.js +75 -0
  422. package/dist/local/store/memory/failures.js.map +1 -0
  423. package/dist/local/store/memory/index.d.ts +11 -0
  424. package/dist/local/store/memory/index.d.ts.map +1 -0
  425. package/dist/local/store/memory/index.js +7 -0
  426. package/dist/local/store/memory/index.js.map +1 -0
  427. package/dist/local/store/node/adapter.d.ts +56 -7
  428. package/dist/local/store/node/adapter.d.ts.map +1 -1
  429. package/dist/local/store/node/adapter.js +458 -11
  430. package/dist/local/store/node/adapter.js.map +1 -1
  431. package/dist/local/store/node/database-key.js +1 -1
  432. package/dist/local/store/node/database.d.ts +68 -0
  433. package/dist/local/store/node/database.d.ts.map +1 -1
  434. package/dist/local/store/node/database.js +203 -20
  435. package/dist/local/store/node/database.js.map +1 -1
  436. package/dist/local/store/node/index.d.ts +4 -4
  437. package/dist/local/store/node/index.d.ts.map +1 -1
  438. package/dist/local/store/node/index.js +3 -3
  439. package/dist/local/store/node/index.js.map +1 -1
  440. package/dist/local/store/react-native/adapter.d.ts +44 -5
  441. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  442. package/dist/local/store/react-native/adapter.js +177 -22
  443. package/dist/local/store/react-native/adapter.js.map +1 -1
  444. package/dist/local/store/react-native/index.d.ts +4 -4
  445. package/dist/local/store/react-native/index.d.ts.map +1 -1
  446. package/dist/local/store/react-native/index.js +3 -3
  447. package/dist/local/store/react-native/index.js.map +1 -1
  448. package/dist/local/store/react-native/storage.d.ts +2 -2
  449. package/dist/local/store/web/adapter.d.ts +5 -4
  450. package/dist/local/store/web/adapter.d.ts.map +1 -1
  451. package/dist/local/store/web/adapter.js +54 -10
  452. package/dist/local/store/web/adapter.js.map +1 -1
  453. package/dist/local/store/web/index.d.ts +4 -4
  454. package/dist/local/store/web/index.d.ts.map +1 -1
  455. package/dist/local/store/web/index.js +3 -3
  456. package/dist/local/store/web/index.js.map +1 -1
  457. package/dist/local/vault/expo-secure-store.d.ts +2 -2
  458. package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
  459. package/dist/local/vault/expo-secure-store.js +5 -5
  460. package/dist/local/vault/expo-secure-store.js.map +1 -1
  461. package/dist/local/vault/index.d.ts +7 -3
  462. package/dist/local/vault/index.d.ts.map +1 -1
  463. package/dist/local/vault/index.js +1 -1
  464. package/dist/local/vault/index.js.map +1 -1
  465. package/dist/logger.d.ts +4 -4
  466. package/dist/logger.d.ts.map +1 -1
  467. package/dist/logger.js +5 -5
  468. package/dist/logger.js.map +1 -1
  469. package/dist/media/index.d.ts +7 -7
  470. package/dist/media/index.d.ts.map +1 -1
  471. package/dist/media/index.js +2 -2
  472. package/dist/profile/cipher.d.ts +1 -1
  473. package/dist/profile/cipher.js +1 -1
  474. package/dist/profile/contact-state.d.ts +1 -1
  475. package/dist/profile/contact-state.d.ts.map +1 -1
  476. package/dist/profile/contact-state.js +3 -3
  477. package/dist/profile/contact-state.js.map +1 -1
  478. package/dist/profile/crypto.d.ts +1 -1
  479. package/dist/profile/crypto.js +1 -1
  480. package/dist/profile/profile-key.d.ts.map +1 -1
  481. package/dist/profile/profile-key.js +3 -3
  482. package/dist/profile/profile-key.js.map +1 -1
  483. package/dist/profile/update-service.d.ts +2 -2
  484. package/dist/profile/update-service.d.ts.map +1 -1
  485. package/dist/profile/update-service.js +2 -2
  486. package/dist/profile/update-service.js.map +1 -1
  487. package/dist/remote/object-store/convex-r2/server.d.ts +1 -1
  488. package/dist/remote/object-store/convex-r2/storage.d.ts +2 -2
  489. package/dist/remote/object-store/convex-r2/storage.d.ts.map +1 -1
  490. package/dist/remote/object-store/index.d.ts +1 -1
  491. package/dist/remote/object-store/index.d.ts.map +1 -1
  492. package/dist/remote/object-store/s3/storage.d.ts +3 -3
  493. package/dist/remote/object-store/s3/storage.d.ts.map +1 -1
  494. package/dist/remote/object-store/s3/storage.js +1 -1
  495. package/dist/remote/object-store/types.d.ts +1 -1
  496. package/dist/remote/object-store/types.d.ts.map +1 -1
  497. package/dist/remote/relay/convex/backend.d.ts +405 -0
  498. package/dist/remote/relay/convex/backend.d.ts.map +1 -0
  499. package/dist/remote/relay/convex/backend.js +687 -0
  500. package/dist/remote/relay/convex/backend.js.map +1 -0
  501. package/dist/remote/relay/convex/component/_generated/api.d.ts +58 -0
  502. package/dist/remote/relay/convex/component/_generated/api.d.ts.map +1 -0
  503. package/dist/remote/relay/convex/component/_generated/api.js +31 -0
  504. package/dist/remote/relay/convex/component/_generated/api.js.map +1 -0
  505. package/dist/remote/relay/convex/component/_generated/component.d.ts +483 -0
  506. package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -0
  507. package/dist/remote/relay/convex/component/_generated/component.js +11 -0
  508. package/dist/remote/relay/convex/component/_generated/component.js.map +1 -0
  509. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts +46 -0
  510. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts.map +1 -0
  511. package/dist/remote/relay/convex/component/_generated/dataModel.js +11 -0
  512. package/dist/remote/relay/convex/component/_generated/dataModel.js.map +1 -0
  513. package/dist/remote/relay/convex/component/_generated/server.d.ts +129 -0
  514. package/dist/remote/relay/convex/component/_generated/server.d.ts.map +1 -0
  515. package/dist/remote/relay/convex/component/_generated/server.js +79 -0
  516. package/dist/remote/relay/convex/component/_generated/server.js.map +1 -0
  517. package/dist/remote/relay/convex/component/accounts.d.ts +43 -0
  518. package/dist/remote/relay/convex/component/accounts.d.ts.map +1 -0
  519. package/dist/remote/relay/convex/component/accounts.js +181 -0
  520. package/dist/remote/relay/convex/component/accounts.js.map +1 -0
  521. package/dist/remote/relay/convex/component/certificates.d.ts +10 -0
  522. package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -0
  523. package/dist/remote/relay/convex/component/certificates.js +117 -0
  524. package/dist/remote/relay/convex/component/certificates.js.map +1 -0
  525. package/dist/remote/relay/convex/component/cleanup.d.ts +32 -0
  526. package/dist/remote/relay/convex/component/cleanup.d.ts.map +1 -0
  527. package/dist/remote/relay/convex/component/cleanup.js +146 -0
  528. package/dist/remote/relay/convex/component/cleanup.js.map +1 -0
  529. package/dist/remote/relay/convex/component/convex.config.d.ts +5 -0
  530. package/dist/remote/relay/convex/component/convex.config.d.ts.map +1 -0
  531. package/dist/remote/relay/convex/component/convex.config.js +33 -0
  532. package/dist/remote/relay/convex/component/convex.config.js.map +1 -0
  533. package/dist/remote/relay/convex/component/crons.d.ts +3 -0
  534. package/dist/remote/relay/convex/component/crons.d.ts.map +1 -0
  535. package/dist/remote/relay/convex/component/crons.js +10 -0
  536. package/dist/remote/relay/convex/component/crons.js.map +1 -0
  537. package/dist/remote/relay/convex/component/devices.d.ts +101 -0
  538. package/dist/remote/relay/convex/component/devices.d.ts.map +1 -0
  539. package/dist/remote/relay/convex/component/devices.js +299 -0
  540. package/dist/remote/relay/convex/component/devices.js.map +1 -0
  541. package/dist/remote/relay/convex/component/errors.d.ts +22 -0
  542. package/dist/remote/relay/convex/component/errors.d.ts.map +1 -0
  543. package/dist/remote/relay/convex/component/errors.js +17 -0
  544. package/dist/remote/relay/convex/component/errors.js.map +1 -0
  545. package/dist/remote/relay/convex/component/groups.d.ts +63 -0
  546. package/dist/remote/relay/convex/component/groups.d.ts.map +1 -0
  547. package/dist/remote/relay/convex/component/groups.js +341 -0
  548. package/dist/remote/relay/convex/component/groups.js.map +1 -0
  549. package/dist/remote/relay/convex/component/keys.d.ts +130 -0
  550. package/dist/remote/relay/convex/component/keys.d.ts.map +1 -0
  551. package/dist/remote/relay/convex/component/keys.js +578 -0
  552. package/dist/remote/relay/convex/component/keys.js.map +1 -0
  553. package/dist/remote/relay/convex/component/messages.d.ts +119 -0
  554. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -0
  555. package/dist/remote/relay/convex/component/messages.js +723 -0
  556. package/dist/remote/relay/convex/component/messages.js.map +1 -0
  557. package/dist/remote/relay/convex/component/provisioning.d.ts +92 -0
  558. package/dist/remote/relay/convex/component/provisioning.d.ts.map +1 -0
  559. package/dist/remote/relay/convex/component/provisioning.js +359 -0
  560. package/dist/remote/relay/convex/component/provisioning.js.map +1 -0
  561. package/dist/remote/relay/convex/component/runtime.d.ts +18 -0
  562. package/dist/remote/relay/convex/component/runtime.d.ts.map +1 -0
  563. package/dist/remote/relay/convex/component/runtime.js +142 -0
  564. package/dist/remote/relay/convex/component/runtime.js.map +1 -0
  565. package/dist/remote/relay/convex/component/schema.d.ts +358 -0
  566. package/dist/remote/relay/convex/component/schema.d.ts.map +1 -0
  567. package/dist/remote/relay/convex/component/schema.js +287 -0
  568. package/dist/remote/relay/convex/component/schema.js.map +1 -0
  569. package/dist/remote/relay/convex/component/zkAuth.d.ts +12 -0
  570. package/dist/remote/relay/convex/component/zkAuth.d.ts.map +1 -0
  571. package/dist/remote/relay/convex/component/zkAuth.js +71 -0
  572. package/dist/remote/relay/convex/component/zkAuth.js.map +1 -0
  573. package/dist/remote/relay/convex/constants.d.ts +3 -0
  574. package/dist/remote/relay/convex/constants.d.ts.map +1 -0
  575. package/dist/remote/relay/convex/constants.js +3 -0
  576. package/dist/remote/relay/convex/constants.js.map +1 -0
  577. package/dist/remote/relay/convex/group-server.d.ts +29 -24
  578. package/dist/remote/relay/convex/group-server.d.ts.map +1 -1
  579. package/dist/remote/relay/convex/group-server.js +62 -28
  580. package/dist/remote/relay/convex/group-server.js.map +1 -1
  581. package/dist/remote/relay/convex/index.d.ts +14 -11
  582. package/dist/remote/relay/convex/index.d.ts.map +1 -1
  583. package/dist/remote/relay/convex/index.js +9 -7
  584. package/dist/remote/relay/convex/index.js.map +1 -1
  585. package/dist/remote/relay/convex/relay.d.ts +67 -80
  586. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  587. package/dist/remote/relay/convex/relay.js +143 -59
  588. package/dist/remote/relay/convex/relay.js.map +1 -1
  589. package/dist/remote/relay/convex/types.d.ts +16 -103
  590. package/dist/remote/relay/convex/types.d.ts.map +1 -1
  591. package/dist/remote/relay/convex/types.js +8 -13
  592. package/dist/remote/relay/convex/types.js.map +1 -1
  593. package/dist/remote/relay/index.d.ts +7 -7
  594. package/dist/remote/relay/index.d.ts.map +1 -1
  595. package/dist/remote/relay/index.js +7 -7
  596. package/dist/remote/relay/index.js.map +1 -1
  597. package/dist/remote/relay/{mock → memory}/adapter.d.ts +55 -31
  598. package/dist/remote/relay/memory/adapter.d.ts.map +1 -0
  599. package/dist/remote/relay/{mock → memory}/adapter.js +276 -135
  600. package/dist/remote/relay/memory/adapter.js.map +1 -0
  601. package/dist/remote/relay/memory/failures.d.ts +58 -0
  602. package/dist/remote/relay/memory/failures.d.ts.map +1 -0
  603. package/dist/remote/relay/memory/failures.js +123 -0
  604. package/dist/remote/relay/memory/failures.js.map +1 -0
  605. package/dist/remote/relay/memory/group-server.d.ts +9 -0
  606. package/dist/remote/relay/memory/group-server.d.ts.map +1 -0
  607. package/dist/remote/relay/memory/group-server.js +9 -0
  608. package/dist/remote/relay/memory/group-server.js.map +1 -0
  609. package/dist/remote/relay/memory/index.d.ts +11 -0
  610. package/dist/remote/relay/memory/index.d.ts.map +1 -0
  611. package/dist/remote/relay/memory/index.js +7 -0
  612. package/dist/remote/relay/memory/index.js.map +1 -0
  613. package/dist/remote/relay/types.d.ts +99 -86
  614. package/dist/remote/relay/types.d.ts.map +1 -1
  615. package/dist/remote/relay/types.js +2 -3
  616. package/dist/remote/relay/types.js.map +1 -1
  617. package/dist/safety/protobuf.d.ts +1 -1
  618. package/dist/safety/protobuf.d.ts.map +1 -1
  619. package/dist/types/api.d.ts +42 -17
  620. package/dist/types/api.d.ts.map +1 -1
  621. package/dist/types/errors.d.ts +2 -2
  622. package/dist/types/errors.d.ts.map +1 -1
  623. package/dist/types/errors.js +2 -2
  624. package/dist/types/errors.js.map +1 -1
  625. package/dist/types/messages.d.ts +1 -1
  626. package/dist/types/protocol-config.d.ts +71 -4
  627. package/dist/types/protocol-config.d.ts.map +1 -1
  628. package/dist/types/protocol-config.js +63 -2
  629. package/dist/types/protocol-config.js.map +1 -1
  630. package/dist/types/protocol-constants.d.ts +1 -1
  631. package/dist/types/protocol-constants.js +1 -1
  632. package/dist/utils/binary-transfer.d.ts +1 -1
  633. package/dist/utils/errors.d.ts +2 -2
  634. package/dist/utils/errors.js +2 -2
  635. package/dist/utils/retry.d.ts +4 -3
  636. package/dist/utils/retry.d.ts.map +1 -1
  637. package/dist/utils/retry.js +20 -1
  638. package/dist/utils/retry.js.map +1 -1
  639. package/dist/zk/groups.d.ts +1 -1
  640. package/dist/zk/groups.js +1 -1
  641. package/docs/ASSURANCE.md +28 -11
  642. package/docs/CLIENT_COMPOSITION.md +32 -76
  643. package/docs/DEVIATIONS.md +944 -0
  644. package/docs/E2EE.md +71 -6
  645. package/docs/ERROR_HANDLING.md +8 -1
  646. package/docs/GETTING_STARTED.md +22 -18
  647. package/docs/INTERFACES.md +22 -22
  648. package/docs/PACKAGE_SURFACE.md +23 -16
  649. package/docs/PROTOCOL_POLICY.md +11 -2
  650. package/docs/RECIPES.md +17 -13
  651. package/docs/SECURITY.md +8 -0
  652. package/files/README.md +1 -1
  653. package/groups/README.md +16 -5
  654. package/local/store/README.md +14 -12
  655. package/local/store/expo/README.md +15 -6
  656. package/local/store/memory/README.md +58 -0
  657. package/local/store/node/README.md +8 -1
  658. package/local/store/react-native/README.md +1 -1
  659. package/local/store/web/README.md +1 -1
  660. package/local/vault/README.md +3 -3
  661. package/package.json +33 -13
  662. package/remote/README.md +19 -19
  663. package/remote/object-store/README.md +3 -3
  664. package/remote/object-store/convex-r2/README.md +1 -1
  665. package/remote/object-store/s3/README.md +1 -1
  666. package/remote/relay/README.md +7 -7
  667. package/remote/relay/convex/README.md +10 -4
  668. package/remote/relay/convex/component/README.md +428 -0
  669. package/remote/relay/memory/README.md +69 -0
  670. package/scripts/oe-groups.mjs +162 -0
  671. package/types/README.md +1 -1
  672. package/dist/internal/groups-v2/access-control.d.ts +0 -101
  673. package/dist/internal/groups-v2/access-control.d.ts.map +0 -1
  674. package/dist/internal/groups-v2/access-control.js +0 -184
  675. package/dist/internal/groups-v2/access-control.js.map +0 -1
  676. package/dist/internal/groups-v2/change-actions.d.ts +0 -35
  677. package/dist/internal/groups-v2/change-actions.d.ts.map +0 -1
  678. package/dist/internal/groups-v2/change-actions.js +0 -358
  679. package/dist/internal/groups-v2/change-actions.js.map +0 -1
  680. package/dist/internal/groups-v2/encrypted-state.d.ts.map +0 -1
  681. package/dist/internal/groups-v2/encrypted-state.js.map +0 -1
  682. package/dist/internal/groups-v2/index.d.ts +0 -14
  683. package/dist/internal/groups-v2/index.d.ts.map +0 -1
  684. package/dist/internal/groups-v2/index.js +0 -11
  685. package/dist/internal/groups-v2/index.js.map +0 -1
  686. package/dist/internal/groups-v2/invite-link.d.ts.map +0 -1
  687. package/dist/internal/groups-v2/invite-link.js.map +0 -1
  688. package/dist/internal/groups-v2/manager.d.ts.map +0 -1
  689. package/dist/internal/groups-v2/manager.js +0 -1093
  690. package/dist/internal/groups-v2/manager.js.map +0 -1
  691. package/dist/internal/groups-v2/types.d.ts.map +0 -1
  692. package/dist/internal/groups-v2/types.js.map +0 -1
  693. package/dist/local/store/mock/adapter.d.ts.map +0 -1
  694. package/dist/local/store/mock/adapter.js.map +0 -1
  695. package/dist/local/store/mock/index.d.ts +0 -10
  696. package/dist/local/store/mock/index.d.ts.map +0 -1
  697. package/dist/local/store/mock/index.js +0 -6
  698. package/dist/local/store/mock/index.js.map +0 -1
  699. package/dist/remote/relay/mock/adapter.d.ts.map +0 -1
  700. package/dist/remote/relay/mock/adapter.js.map +0 -1
  701. package/dist/remote/relay/mock/index.d.ts +0 -10
  702. package/dist/remote/relay/mock/index.d.ts.map +0 -1
  703. package/dist/remote/relay/mock/index.js +0 -6
  704. package/dist/remote/relay/mock/index.js.map +0 -1
  705. package/docs/api/README.md +0 -471
  706. package/docs/api/classes/EncryptionError.md +0 -112
  707. package/docs/api/classes/EndorsementManager.md +0 -307
  708. package/docs/api/classes/SealedSenderAuthError.md +0 -127
  709. package/docs/api/classes/ServerDerivedKeyPair.md +0 -68
  710. package/docs/api/classes/ServerDerivedPublicKey.md +0 -33
  711. package/docs/api/classes/ServerRootKeyPair.md +0 -94
  712. package/docs/api/classes/ServerRootPublicKey.md +0 -72
  713. package/docs/api/classes/SignalBlockingManager.md +0 -106
  714. package/docs/api/classes/SignalProtocolClient.md +0 -2651
  715. package/docs/api/classes/VerificationFailure.md +0 -25
  716. package/docs/api/enumerations/ContentHint.md +0 -63
  717. package/docs/api/enumerations/EncryptionErrorCode.md +0 -488
  718. package/docs/api/enumerations/IdentityKeyChange.md +0 -65
  719. package/docs/api/enumerations/MessageType.md +0 -29
  720. package/docs/api/enumerations/TrustDirection.md +0 -33
  721. package/docs/api/enumerations/TypingAction.md +0 -31
  722. package/docs/api/functions/createDefaultSignalContentAdapter.md +0 -13
  723. package/docs/api/functions/createDefaultSignalLogger.md +0 -36
  724. package/docs/api/functions/createGroupId.md +0 -32
  725. package/docs/api/functions/createSignalProtocolClient.md +0 -36
  726. package/docs/api/functions/createSignalProtocolClientConfig.md +0 -24
  727. package/docs/api/functions/extractGroupId.md +0 -32
  728. package/docs/api/functions/formatVersion.md +0 -25
  729. package/docs/api/functions/isCompatible.md +0 -31
  730. package/docs/api/functions/isGroupId.md +0 -37
  731. package/docs/api/functions/isSealedSenderAuthError.md +0 -25
  732. package/docs/api/functions/parseVersion.md +0 -29
  733. package/docs/api/functions/resolveSPQRLimits.md +0 -21
  734. package/docs/api/functions/resolveSignalLogger.md +0 -42
  735. package/docs/api/interfaces/AccountIdentityProvisioning.md +0 -43
  736. package/docs/api/interfaces/AccountIdentityRotation.md +0 -69
  737. package/docs/api/interfaces/AttachmentTransferOptions.md +0 -49
  738. package/docs/api/interfaces/BlockedRecipientEntry.md +0 -25
  739. package/docs/api/interfaces/BlockedRecipientsSyncInput.md +0 -27
  740. package/docs/api/interfaces/ConfigurationSyncInput.md +0 -19
  741. package/docs/api/interfaces/CredentialPublicKey.md +0 -25
  742. package/docs/api/interfaces/DataMessageInput.md +0 -21
  743. package/docs/api/interfaces/DecryptedEnvelope.md +0 -95
  744. package/docs/api/interfaces/DecryptedGroup.md +0 -86
  745. package/docs/api/interfaces/DeviceInfo.md +0 -79
  746. package/docs/api/interfaces/DeviceRecord.md +0 -87
  747. package/docs/api/interfaces/DeviceRegistration.md +0 -27
  748. package/docs/api/interfaces/DoubleRatchetConfig.md +0 -36
  749. package/docs/api/interfaces/EcOneTimePreKey.md +0 -27
  750. package/docs/api/interfaces/EcSignedPreKey.md +0 -39
  751. package/docs/api/interfaces/EcSignedPreKeyUpload.md +0 -50
  752. package/docs/api/interfaces/EncryptionErrorContext.md +0 -51
  753. package/docs/api/interfaces/Envelope.md +0 -154
  754. package/docs/api/interfaces/ForceKeyResetResult.md +0 -37
  755. package/docs/api/interfaces/GroupAuthorization.md +0 -23
  756. package/docs/api/interfaces/GroupChangeEntry.md +0 -42
  757. package/docs/api/interfaces/GroupMemberDevice.md +0 -26
  758. package/docs/api/interfaces/IEcOneTimePreKeyStore.md +0 -86
  759. package/docs/api/interfaces/IEcSignedPreKeyStore.md +0 -132
  760. package/docs/api/interfaces/IGroupServer.md +0 -120
  761. package/docs/api/interfaces/IGroupStateStore.md +0 -128
  762. package/docs/api/interfaces/IIdentityKeyStore.md +0 -312
  763. package/docs/api/interfaces/IKemPreKeyStore.md +0 -144
  764. package/docs/api/interfaces/IKyberLastResortPreKeyStore.md +0 -111
  765. package/docs/api/interfaces/ILogger.md +0 -117
  766. package/docs/api/interfaces/IProtocolStore.md +0 -1033
  767. package/docs/api/interfaces/ISenderKeyStore.md +0 -417
  768. package/docs/api/interfaces/ISesameStore.md +0 -249
  769. package/docs/api/interfaces/ISessionStore.md +0 -178
  770. package/docs/api/interfaces/ISignalLocalSecretVault.md +0 -71
  771. package/docs/api/interfaces/ISignalLocalStore.md +0 -2053
  772. package/docs/api/interfaces/ISignalProtocolClient.md +0 -1183
  773. package/docs/api/interfaces/ISignalProtocolManager.md +0 -272
  774. package/docs/api/interfaces/ISignalRelayServer.md +0 -1329
  775. package/docs/api/interfaces/IdentityKeyPair.md +0 -49
  776. package/docs/api/interfaces/IncomingEnvelope.md +0 -91
  777. package/docs/api/interfaces/InspectedSignalContent.md +0 -43
  778. package/docs/api/interfaces/KDFChain.md +0 -31
  779. package/docs/api/interfaces/KemLastResortPreKeyUpload.md +0 -50
  780. package/docs/api/interfaces/KeyPair.md +0 -23
  781. package/docs/api/interfaces/KyberPreKey.md +0 -42
  782. package/docs/api/interfaces/MLKEMBraidAgentState.md +0 -191
  783. package/docs/api/interfaces/MLKEMBraidMessage.md +0 -49
  784. package/docs/api/interfaces/MediaAttachmentDeleteSyncInput.md +0 -31
  785. package/docs/api/interfaces/MessageHeader.md +0 -49
  786. package/docs/api/interfaces/MessageRecord.md +0 -86
  787. package/docs/api/interfaces/ParsedReceiptContent.md +0 -19
  788. package/docs/api/interfaces/ParsedTypingContent.md +0 -19
  789. package/docs/api/interfaces/PreKeyMaintenanceStore.md +0 -87
  790. package/docs/api/interfaces/PreKeyMessage.md +0 -159
  791. package/docs/api/interfaces/PreKeyStatusResult.md +0 -21
  792. package/docs/api/interfaces/PreKeyUpload.md +0 -42
  793. package/docs/api/interfaces/ProcessEnvelopeOptions.md +0 -72
  794. package/docs/api/interfaces/ProtocolAddress.md +0 -38
  795. package/docs/api/interfaces/ProtocolStrategyConfig.md +0 -91
  796. package/docs/api/interfaces/RatchetMessage.md +0 -96
  797. package/docs/api/interfaces/ReadSyncEntryInput.md +0 -19
  798. package/docs/api/interfaces/ReceiverChain.md +0 -43
  799. package/docs/api/interfaces/RecipientUsernameSyncInput.md +0 -31
  800. package/docs/api/interfaces/RelayPreKeyBundle.md +0 -254
  801. package/docs/api/interfaces/RemoteObjectDownload.md +0 -33
  802. package/docs/api/interfaces/RemoteObjectUpload.md +0 -49
  803. package/docs/api/interfaces/ResolvedSPQRInfoStrings.md +0 -27
  804. package/docs/api/interfaces/ResolvedSPQRLimits.md +0 -37
  805. package/docs/api/interfaces/RetryRequest.md +0 -80
  806. package/docs/api/interfaces/SCKAState.md +0 -65
  807. package/docs/api/interfaces/SPQRLimits.md +0 -40
  808. package/docs/api/interfaces/SPQRState.md +0 -191
  809. package/docs/api/interfaces/SafetyNumber.md +0 -60
  810. package/docs/api/interfaces/SafetyNumberConfirmation.md +0 -46
  811. package/docs/api/interfaces/SealedSenderConfig.md +0 -70
  812. package/docs/api/interfaces/SendOptions.md +0 -191
  813. package/docs/api/interfaces/SendResult.md +0 -93
  814. package/docs/api/interfaces/SenderKeyDistributionMessage.md +0 -43
  815. package/docs/api/interfaces/SenderKeyState.md +0 -76
  816. package/docs/api/interfaces/SenderKeysConfig.md +0 -65
  817. package/docs/api/interfaces/SentSyncTranscriptInput.md +0 -31
  818. package/docs/api/interfaces/ServiceId.md +0 -19
  819. package/docs/api/interfaces/SesameMessage.md +0 -84
  820. package/docs/api/interfaces/SesameStats.md +0 -57
  821. package/docs/api/interfaces/SessionHealthResult.md +0 -120
  822. package/docs/api/interfaces/SessionRecord.md +0 -80
  823. package/docs/api/interfaces/SessionRecordMetadata.md +0 -109
  824. package/docs/api/interfaces/SessionState.md +0 -368
  825. package/docs/api/interfaces/SessionTrustCommit.md +0 -58
  826. package/docs/api/interfaces/SignalBlockingHooks.md +0 -44
  827. package/docs/api/interfaces/SignalBlockingManagerOptions.md +0 -31
  828. package/docs/api/interfaces/SignalBlockingMirror.md +0 -30
  829. package/docs/api/interfaces/SignalBlockingStore.md +0 -83
  830. package/docs/api/interfaces/SignalContentAdapter.md +0 -325
  831. package/docs/api/interfaces/SignalProtocolClientAdapterConfig.md +0 -44
  832. package/docs/api/interfaces/SignalProtocolClientCompositionOptions.md +0 -693
  833. package/docs/api/interfaces/SignalProtocolClientConfig.md +0 -839
  834. package/docs/api/interfaces/SignalProtocolClientDeleteLocalAttachmentInput.md +0 -25
  835. package/docs/api/interfaces/SignalProtocolClientHooks.md +0 -506
  836. package/docs/api/interfaces/SignalProtocolClientIdentityConfig.md +0 -35
  837. package/docs/api/interfaces/SignalProtocolClientLoadLocalAttachmentInput.md +0 -187
  838. package/docs/api/interfaces/SignalProtocolClientLoadedLocalAttachment.md +0 -19
  839. package/docs/api/interfaces/SignalProtocolClientMedia.md +0 -83
  840. package/docs/api/interfaces/SignalProtocolClientMediaCompletedResult.md +0 -25
  841. package/docs/api/interfaces/SignalProtocolClientMediaConfig.md +0 -157
  842. package/docs/api/interfaces/SignalProtocolClientMediaDownloadCompletedResult.md +0 -37
  843. package/docs/api/interfaces/SignalProtocolClientMediaDownloadNotNeededResult.md +0 -25
  844. package/docs/api/interfaces/SignalProtocolClientMediaFailedResult.md +0 -19
  845. package/docs/api/interfaces/SignalProtocolClientMediaOperationOptions.md +0 -53
  846. package/docs/api/interfaces/SignalProtocolClientMediaPendingResult.md +0 -19
  847. package/docs/api/interfaces/SignalProtocolClientMediaProcessResult.md +0 -43
  848. package/docs/api/interfaces/SignalProtocolClientMediaSkippedResult.md +0 -25
  849. package/docs/api/interfaces/SignalProtocolClientMediaUploadCompletedResult.md +0 -31
  850. package/docs/api/interfaces/SignalProtocolClientProcessPendingMediaOptions.md +0 -87
  851. package/docs/api/interfaces/SignalProtocolClientSaveDownloadedAttachmentInput.md +0 -25
  852. package/docs/api/interfaces/SignalProtocolClientSaveUploadedAttachmentInput.md +0 -25
  853. package/docs/api/interfaces/SignalProtocolClientSyncDeleteInput.md +0 -19
  854. package/docs/api/interfaces/SignalProtocolConfig.md +0 -50
  855. package/docs/api/interfaces/SignalRemoteObjectStore.md +0 -88
  856. package/docs/api/interfaces/SkippedSenderMessageKey.md +0 -26
  857. package/docs/api/interfaces/TaskNotificationAckSyncInput.md +0 -31
  858. package/docs/api/interfaces/TripleRatchetState.md +0 -64
  859. package/docs/api/interfaces/UserRecord.md +0 -71
  860. package/docs/api/interfaces/UsernameStateSyncInput.md +0 -19
  861. package/docs/api/interfaces/VerificationStateSyncInput.md +0 -31
  862. package/docs/api/interfaces/VersionNegotiationState.md +0 -84
  863. package/docs/api/interfaces/ViewOnceOpenSyncInput.md +0 -19
  864. package/docs/api/namespaces/ProtocolAddress/README.md +0 -33
  865. package/docs/api/namespaces/ProtocolAddress/functions/create.md +0 -41
  866. package/docs/api/namespaces/ProtocolAddress/functions/equals.md +0 -39
  867. package/docs/api/namespaces/ProtocolAddress/functions/fromStorageKey.md +0 -36
  868. package/docs/api/namespaces/ProtocolAddress/functions/isUser.md +0 -39
  869. package/docs/api/namespaces/ProtocolAddress/functions/isValid.md +0 -34
  870. package/docs/api/namespaces/ProtocolAddress/functions/parse.md +0 -41
  871. package/docs/api/namespaces/ProtocolAddress/functions/toStorageKey.md +0 -38
  872. package/docs/api/namespaces/ProtocolAddress/functions/toString.md +0 -34
  873. package/docs/api/namespaces/SessionRecord/README.md +0 -30
  874. package/docs/api/namespaces/SessionRecord/functions/archiveCurrent.md +0 -40
  875. package/docs/api/namespaces/SessionRecord/functions/archiveCurrentState.md +0 -34
  876. package/docs/api/namespaces/SessionRecord/functions/create.md +0 -25
  877. package/docs/api/namespaces/SessionRecord/functions/deserialize.md +0 -29
  878. package/docs/api/namespaces/SessionRecord/functions/findSession.md +0 -34
  879. package/docs/api/namespaces/SessionRecord/functions/getAllSessions.md +0 -25
  880. package/docs/api/namespaces/SessionRecord/functions/getArchivedCount.md +0 -25
  881. package/docs/api/namespaces/SessionRecord/functions/hasCurrentSession.md +0 -25
  882. package/docs/api/namespaces/SessionRecord/functions/hasUsableSenderChain.md +0 -36
  883. package/docs/api/namespaces/SessionRecord/functions/promoteSession.md +0 -34
  884. package/docs/api/namespaces/SessionRecord/functions/serialize.md +0 -28
  885. package/docs/api/namespaces/SessionRecord/variables/MAX_ARCHIVED_SESSIONS.md +0 -14
  886. package/docs/api/namespaces/SessionState/README.md +0 -15
  887. package/docs/api/namespaces/SessionState/functions/getSessionId.md +0 -32
  888. package/docs/api/namespaces/blocking/README.md +0 -43
  889. package/docs/api/namespaces/encoding/README.md +0 -33
  890. package/docs/api/namespaces/encoding/functions/base64ToUrlSafe.md +0 -28
  891. package/docs/api/namespaces/encoding/functions/bytesToBase64.md +0 -21
  892. package/docs/api/namespaces/encoding/functions/bytesToString.md +0 -21
  893. package/docs/api/namespaces/encoding/functions/bytesToUrlSafeBase64.md +0 -33
  894. package/docs/api/namespaces/encoding/functions/concatBytes.md +0 -21
  895. package/docs/api/namespaces/encoding/functions/stringToBytes.md +0 -21
  896. package/docs/api/namespaces/encoding/functions/urlSafeToBase64.md +0 -27
  897. package/docs/api/namespaces/keys/README.md +0 -126
  898. package/docs/api/namespaces/keys/functions/acceptContactIdentityRotation.md +0 -33
  899. package/docs/api/namespaces/keys/functions/assertIdentityCommitment.md +0 -25
  900. package/docs/api/namespaces/keys/functions/compositeIdentitiesEqual.md +0 -23
  901. package/docs/api/namespaces/keys/functions/createCompositeIdentityV1.md +0 -19
  902. package/docs/api/namespaces/keys/functions/createPreKeySignatureContext.md +0 -31
  903. package/docs/api/namespaces/keys/functions/createUnverifiedContactIdentityRecord.md +0 -23
  904. package/docs/api/namespaces/keys/functions/decodeCompositeIdentityV1.md +0 -19
  905. package/docs/api/namespaces/keys/functions/deriveIdentityCommitment.md +0 -19
  906. package/docs/api/namespaces/keys/functions/encodeCompositeIdentityV1.md +0 -19
  907. package/docs/api/namespaces/keys/functions/evaluateContactIdentityCandidate.md +0 -27
  908. package/docs/api/namespaces/keys/functions/generateEcOneTimePreKeys.md +0 -37
  909. package/docs/api/namespaces/keys/functions/generateEcSignedPreKey.md +0 -39
  910. package/docs/api/namespaces/keys/functions/generateEcSignedPreKeyId.md +0 -21
  911. package/docs/api/namespaces/keys/functions/generateIdentityKeyPair.md +0 -24
  912. package/docs/api/namespaces/keys/functions/generateKemOneTimePreKeys.md +0 -47
  913. package/docs/api/namespaces/keys/functions/generateKyberLastResortPreKey.md +0 -37
  914. package/docs/api/namespaces/keys/functions/generateRegistrationId.md +0 -13
  915. package/docs/api/namespaces/keys/functions/signMlKem1024PreKey.md +0 -29
  916. package/docs/api/namespaces/keys/functions/signPreKey.md +0 -31
  917. package/docs/api/namespaces/keys/functions/validateContactIdentityRecord.md +0 -19
  918. package/docs/api/namespaces/keys/functions/verifyContactIdentityRecord.md +0 -31
  919. package/docs/api/namespaces/keys/functions/verifyMlKem1024PreKey.md +0 -33
  920. package/docs/api/namespaces/keys/functions/verifyPreKeySignature.md +0 -35
  921. package/docs/api/namespaces/keys/interfaces/CompositeIdentityV1.md +0 -33
  922. package/docs/api/namespaces/keys/interfaces/ContactIdentityRecord.md +0 -53
  923. package/docs/api/namespaces/keys/interfaces/KemOneTimePreKey.md +0 -43
  924. package/docs/api/namespaces/keys/type-aliases/IdentityCandidateStatus.md +0 -9
  925. package/docs/api/namespaces/keys/type-aliases/IdentityTrustState.md +0 -9
  926. package/docs/api/namespaces/keys/type-aliases/IdentityType.md +0 -9
  927. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_ED25519_TAG.md +0 -9
  928. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_LENGTH.md +0 -9
  929. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_VERSION.md +0 -9
  930. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_X25519_TAG.md +0 -9
  931. package/docs/api/namespaces/keys/variables/IDENTITY_COMMITMENT_V1_DOMAIN.md +0 -9
  932. package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_ML_KEM_1024.md +0 -9
  933. package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_X25519.md +0 -9
  934. package/docs/api/namespaces/keys/variables/PREKEY_SIGNATURE_V1_DOMAIN.md +0 -9
  935. package/docs/api/namespaces/media/README.md +0 -105
  936. package/docs/api/namespaces/media/classes/MediaAttachmentError.md +0 -57
  937. package/docs/api/namespaces/media/functions/createByteRangeMediaAttachmentTransfer.md +0 -19
  938. package/docs/api/namespaces/media/functions/createMediaAttachmentDeliveryId.md +0 -29
  939. package/docs/api/namespaces/media/functions/createMediaAttachmentId.md +0 -19
  940. package/docs/api/namespaces/media/functions/createMediaAttachmentMessage.md +0 -25
  941. package/docs/api/namespaces/media/functions/createMediaAttachmentPointer.md +0 -19
  942. package/docs/api/namespaces/media/functions/createTusMediaAttachmentTransfer.md +0 -19
  943. package/docs/api/namespaces/media/functions/deleteMediaAttachment.md +0 -23
  944. package/docs/api/namespaces/media/functions/executeMediaAttachmentJob.md +0 -23
  945. package/docs/api/namespaces/media/functions/isMediaAttachmentFlagSet.md +0 -19
  946. package/docs/api/namespaces/media/functions/parseMediaAttachmentMessage.md +0 -19
  947. package/docs/api/namespaces/media/functions/planMediaAttachmentCleanup.md +0 -23
  948. package/docs/api/namespaces/media/functions/planMediaAttachmentCleanupJobs.md +0 -19
  949. package/docs/api/namespaces/media/functions/planMediaAttachmentDeleteSync.md +0 -19
  950. package/docs/api/namespaces/media/functions/planMediaAttachmentDownloadJob.md +0 -19
  951. package/docs/api/namespaces/media/functions/planMediaAttachmentOpen.md +0 -19
  952. package/docs/api/namespaces/media/functions/planMediaAttachmentProcessing.md +0 -19
  953. package/docs/api/namespaces/media/functions/planMediaAttachmentUploadJob.md +0 -19
  954. package/docs/api/namespaces/media/functions/prepareMediaAttachmentUpload.md +0 -30
  955. package/docs/api/namespaces/media/functions/resolveMediaAttachment.md +0 -30
  956. package/docs/api/namespaces/media/functions/serializeMediaAttachmentMessage.md +0 -25
  957. package/docs/api/namespaces/media/functions/validateMediaAttachmentPolicy.md +0 -23
  958. package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentPartialStore.md +0 -68
  959. package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentTransferOptions.md +0 -91
  960. package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentOptions.md +0 -25
  961. package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentResult.md +0 -19
  962. package/docs/api/namespaces/media/interfaces/ExecuteMediaAttachmentJobOptions.md +0 -157
  963. package/docs/api/namespaces/media/interfaces/MediaAttachmentBackgroundJob.md +0 -85
  964. package/docs/api/namespaces/media/interfaces/MediaAttachmentCleanupPlan.md +0 -37
  965. package/docs/api/namespaces/media/interfaces/MediaAttachmentJobExecutionResult.md +0 -55
  966. package/docs/api/namespaces/media/interfaces/MediaAttachmentMessage.md +0 -31
  967. package/docs/api/namespaces/media/interfaces/MediaAttachmentOpenDecision.md +0 -31
  968. package/docs/api/namespaces/media/interfaces/MediaAttachmentPointer.md +0 -133
  969. package/docs/api/namespaces/media/interfaces/MediaAttachmentPolicy.md +0 -67
  970. package/docs/api/namespaces/media/interfaces/MediaAttachmentProcessingPlan.md +0 -73
  971. package/docs/api/namespaces/media/interfaces/MediaAttachmentProgress.md +0 -69
  972. package/docs/api/namespaces/media/interfaces/MediaAttachmentResumeState.md +0 -37
  973. package/docs/api/namespaces/media/interfaces/MediaAttachmentRetryOptions.md +0 -31
  974. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransfer.md +0 -51
  975. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferCheckpoint.md +0 -69
  976. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferOptions.md +0 -67
  977. package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadJobData.md +0 -19
  978. package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadResponse.md +0 -25
  979. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentCleanupJobsInput.md +0 -61
  980. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDeleteSyncInput.md +0 -25
  981. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDownloadJobInput.md +0 -161
  982. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentOpenInput.md +0 -25
  983. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentProcessingInput.md +0 -83
  984. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentUploadJobInput.md +0 -147
  985. package/docs/api/namespaces/media/interfaces/PrepareMediaAttachmentUploadOptions.md +0 -144
  986. package/docs/api/namespaces/media/interfaces/ResolveMediaAttachmentOptions.md +0 -55
  987. package/docs/api/namespaces/media/interfaces/ResolvedMediaAttachment.md +0 -109
  988. package/docs/api/namespaces/media/interfaces/TusMediaAttachmentTransferOptions.md +0 -85
  989. package/docs/api/namespaces/media/type-aliases/CreateMediaAttachmentPointerInput.md +0 -15
  990. package/docs/api/namespaces/media/type-aliases/MediaAttachmentCheckpointCallback.md +0 -19
  991. package/docs/api/namespaces/media/type-aliases/MediaAttachmentCleanupReason.md +0 -9
  992. package/docs/api/namespaces/media/type-aliases/MediaAttachmentErrorCode.md +0 -9
  993. package/docs/api/namespaces/media/type-aliases/MediaAttachmentFlag.md +0 -9
  994. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobExecutionStatus.md +0 -9
  995. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobOperation.md +0 -9
  996. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobPriority.md +0 -9
  997. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSkipReason.md +0 -9
  998. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSource.md +0 -9
  999. package/docs/api/namespaces/media/type-aliases/MediaAttachmentKnownIds.md +0 -9
  1000. package/docs/api/namespaces/media/type-aliases/MediaAttachmentMessageType.md +0 -9
  1001. package/docs/api/namespaces/media/type-aliases/MediaAttachmentProgressCallback.md +0 -19
  1002. package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_DEFAULTS.md +0 -47
  1003. package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_PRESETS.md +0 -95
  1004. package/docs/api/namespaces/media/variables/MediaAttachmentCleanupReason.md +0 -27
  1005. package/docs/api/namespaces/media/variables/MediaAttachmentErrorCode.md +0 -75
  1006. package/docs/api/namespaces/media/variables/MediaAttachmentFlag.md +0 -23
  1007. package/docs/api/namespaces/media/variables/MediaAttachmentJobExecutionStatus.md +0 -19
  1008. package/docs/api/namespaces/media/variables/MediaAttachmentJobOperation.md +0 -31
  1009. package/docs/api/namespaces/media/variables/MediaAttachmentJobPriority.md +0 -23
  1010. package/docs/api/namespaces/media/variables/MediaAttachmentJobSource.md +0 -51
  1011. package/docs/api/namespaces/media/variables/MediaAttachmentMessageType.md +0 -15
  1012. package/docs/api/namespaces/media/variables/downloadMediaAttachment.md +0 -30
  1013. package/docs/api/namespaces/safety/README.md +0 -61
  1014. package/docs/api/namespaces/safety/classes/DisplayableFingerprint.md +0 -108
  1015. package/docs/api/namespaces/safety/classes/Fingerprint.md +0 -104
  1016. package/docs/api/namespaces/safety/classes/ScannableFingerprint.md +0 -209
  1017. package/docs/api/namespaces/safety/functions/base64ToBytes.md +0 -21
  1018. package/docs/api/namespaces/safety/functions/clearFingerprintCache.md +0 -15
  1019. package/docs/api/namespaces/safety/functions/compareSafetyNumbers.md +0 -25
  1020. package/docs/api/namespaces/safety/functions/createFingerprintData.md +0 -60
  1021. package/docs/api/namespaces/safety/functions/extractQrData.md +0 -34
  1022. package/docs/api/namespaces/safety/functions/generateCompositeSafetyNumber.md +0 -39
  1023. package/docs/api/namespaces/safety/functions/generateEmojiFingerprint.md +0 -24
  1024. package/docs/api/namespaces/safety/functions/generateSingleKeyReferenceSafetyNumber.md +0 -51
  1025. package/docs/api/namespaces/safety/functions/generateVerifySchemeUrl.md +0 -32
  1026. package/docs/api/namespaces/safety/functions/generateVerifyUrl.md +0 -49
  1027. package/docs/api/namespaces/safety/functions/isValidSafetyNumber.md +0 -21
  1028. package/docs/api/namespaces/safety/functions/isVerifyUrl.md +0 -45
  1029. package/docs/api/namespaces/safety/functions/parseVerifyUrl.md +0 -31
  1030. package/docs/api/namespaces/safety/interfaces/FingerprintData.md +0 -52
  1031. package/docs/api/namespaces/safety/interfaces/SafetyNumber.md +0 -49
  1032. package/docs/api/namespaces/safety/interfaces/VerifyLinkConfig.md +0 -28
  1033. package/docs/api/namespaces/safety/interfaces/VerifyUrlParams.md +0 -49
  1034. package/docs/api/namespaces/safety/type-aliases/CompareResult.md +0 -21
  1035. package/docs/api/namespaces/safety/variables/DEFAULT_VERIFY_LINK_CONFIG.md +0 -12
  1036. package/docs/api/namespaces/safety/variables/FINGERPRINT_ITERATIONS.md +0 -12
  1037. package/docs/api/namespaces/safety/variables/FINGERPRINT_VERSION.md +0 -12
  1038. package/docs/api/namespaces/safety/variables/VERIFY_BASE_URL.md +0 -11
  1039. package/docs/api/namespaces/safety/variables/VERIFY_SCHEME_URL.md +0 -11
  1040. package/docs/api/type-aliases/Base64.md +0 -20
  1041. package/docs/api/type-aliases/BraidPolicy.md +0 -11
  1042. package/docs/api/type-aliases/Bytes.md +0 -20
  1043. package/docs/api/type-aliases/Ciphertext.md +0 -21
  1044. package/docs/api/type-aliases/DeviceType.md +0 -11
  1045. package/docs/api/type-aliases/DownloadedAttachment.md +0 -11
  1046. package/docs/api/type-aliases/GroupId.md +0 -27
  1047. package/docs/api/type-aliases/Hex.md +0 -20
  1048. package/docs/api/type-aliases/HookName.md +0 -11
  1049. package/docs/api/type-aliases/PostQuantumPolicy.md +0 -11
  1050. package/docs/api/type-aliases/PreparedAttachmentUpload.md +0 -14
  1051. package/docs/api/type-aliases/PrivateKey.md +0 -22
  1052. package/docs/api/type-aliases/ProgressCallback.md +0 -45
  1053. package/docs/api/type-aliases/PublicKey.md +0 -22
  1054. package/docs/api/type-aliases/RemoteObjectCompleteUploadRequest.md +0 -19
  1055. package/docs/api/type-aliases/RemoteObjectDeleteRequest.md +0 -19
  1056. package/docs/api/type-aliases/RemoteObjectDownloadRequest.md +0 -19
  1057. package/docs/api/type-aliases/RemoteObjectUploadRequest.md +0 -42
  1058. package/docs/api/type-aliases/SCKAMode.md +0 -11
  1059. package/docs/api/type-aliases/SealedSenderAuth.md +0 -15
  1060. package/docs/api/type-aliases/SignalProtocolClientMediaCleanupInput.md +0 -9
  1061. package/docs/api/type-aliases/SignalProtocolClientMediaCleanupResult.md +0 -9
  1062. package/docs/api/type-aliases/SignalProtocolClientMediaDownloadInput.md +0 -9
  1063. package/docs/api/type-aliases/SignalProtocolClientMediaDownloadResult.md +0 -9
  1064. package/docs/api/type-aliases/SignalProtocolClientMediaOperationResult.md +0 -9
  1065. package/docs/api/type-aliases/SignalProtocolClientMediaUploadInput.md +0 -9
  1066. package/docs/api/type-aliases/SignalProtocolClientMediaUploadResult.md +0 -9
  1067. package/docs/api/type-aliases/Signature.md +0 -21
  1068. package/docs/api/type-aliases/Unsubscribe.md +0 -15
  1069. package/docs/api/variables/BraidPolicy.md +0 -21
  1070. package/docs/api/variables/DEFAULT_DEVICE_ID.md +0 -12
  1071. package/docs/api/variables/DOUBLE_RATCHET_SPEC.md +0 -11
  1072. package/docs/api/variables/GROUP_V2_PREFIX.md +0 -11
  1073. package/docs/api/variables/KEY_REFRESH_INTERVAL_MS_DEFAULT.md +0 -11
  1074. package/docs/api/variables/MAX_MESSAGE_KEYS.md +0 -14
  1075. package/docs/api/variables/MAX_PREKEY_AGE_MS_DEFAULT.md +0 -11
  1076. package/docs/api/variables/MAX_RECEIVER_CHAINS.md +0 -14
  1077. package/docs/api/variables/MAX_REGISTRATION_ID.md +0 -16
  1078. package/docs/api/variables/MAX_SKIP.md +0 -11
  1079. package/docs/api/variables/MESSAGE_FORMAT.md +0 -11
  1080. package/docs/api/variables/MIN_REGISTRATION_ID.md +0 -16
  1081. package/docs/api/variables/ML_KEM_BRAID_SPEC.md +0 -11
  1082. package/docs/api/variables/ONE_TIME_PREKEY_BATCH_SIZE.md +0 -21
  1083. package/docs/api/variables/PQXDH_SPEC.md +0 -11
  1084. package/docs/api/variables/PostQuantumPolicy.md +0 -21
  1085. package/docs/api/variables/SENDER_KEY_FORMAT.md +0 -11
  1086. package/docs/api/variables/SENDER_KEY_SPEC.md +0 -11
  1087. package/docs/api/variables/SESAME_SPEC.md +0 -11
  1088. package/docs/api/variables/SESSION_FORMAT.md +0 -11
  1089. package/docs/api/variables/SPQR_LIMITS_DEFAULTS.md +0 -11
  1090. package/docs/api/variables/X3DH_SPEC.md +0 -9
  1091. package/docs/api/variables/defaultSignalLogger.md +0 -32
  1092. package/local/store/mock/README.md +0 -27
  1093. package/remote/relay/mock/README.md +0 -32
  1094. /package/dist/internal/{groups-v2 → groups}/invite-link.d.ts +0 -0
  1095. /package/dist/internal/{groups-v2 → groups}/invite-link.js +0 -0
@@ -0,0 +1,944 @@
1
+ # Deviations from the Signal Protocol Specifications
2
+
3
+ > Navigation: [README](../README.md) | [ARCHITECTURE](../ARCHITECTURE.md) |
4
+ > [Security](./SECURITY.md) | [Protocol Policy](./PROTOCOL_POLICY.md) |
5
+ > **Deviations**
6
+
7
+ ## What compatibility means here
8
+
9
+ This SDK implements the same cryptographic core as the published Signal Protocol
10
+ specifications — X3DH/PQXDH key agreement, the Double Ratchet, the ML-KEM Braid
11
+ post-quantum ratchet, Sesame multi-device session management, sealed sender, and
12
+ the Signal Protocol's zero-knowledge group credential system. In many places it is faithful
13
+ down to the byte: the same KDF labels, the same chain-key constants, the same
14
+ protobuf field numbers, the same iteration counts.
15
+
16
+ It is **not wire-compatible with Signal Messenger or with `libsignal`**, and it
17
+ is not intended to be. Messages produced by this SDK cannot be decrypted by a
18
+ Signal Messenger client, identities cannot be exchanged, safety numbers computed here
19
+ cannot be compared against safety numbers shown in Signal Messenger, and sessions cannot be
20
+ migrated in either direction. This is a distinct wire profile —
21
+ `IndependentProfileV1` — that shares the Signal Protocol's cryptographic design and
22
+ deliberately does not share its encoding.
23
+
24
+ That distinction matters in a specific way. Reading "implements X3DH and the
25
+ Double Ratchet" reasonably leads someone to expect interoperability. There is
26
+ none. Reading "safety numbers compatible with Signal Messenger" would reasonably
27
+ lead someone to expect that a user could verify a contact by comparing a number
28
+ shown in this SDK against the same contact's number in Signal Messenger. They
29
+ cannot; the numbers are computed over different inputs and will never match.
30
+
31
+ This document is the complete, honest account of where and why the profile
32
+ differs. Each entry names the implementing file, the specification section or
33
+ `libsignal` source it departs from, the engineering reason, and the cost. Where a
34
+ deviation weakens an assurance that a reader of the specification would
35
+ reasonably assume, that is stated plainly rather than framed as a feature.
36
+
37
+ Deviations fall into three kinds:
38
+
39
+ - **Deviation** — does something different from the specification or from
40
+ `libsignal`, deliberately.
41
+ - **Extension** — adds a mechanism the specification does not describe.
42
+ - **Independent design** — shares a name and a goal with a Signal Protocol system, but is
43
+ the SDK's own construction rather than a port of the corresponding `libsignal` system.
44
+
45
+ A fourth label, **faithful**, appears in the table where an area follows the
46
+ specification closely enough that its presence in this document is only to
47
+ delimit what the neighbouring deviations do and do not touch.
48
+
49
+ Companion documents: [Protocol Policy](./PROTOCOL_POLICY.md) states which
50
+ protocol modes run and which fail closed; this document states how the profile
51
+ differs from the specifications. [Security](./SECURITY.md) states the threat
52
+ model and what is out of scope.
53
+
54
+ ---
55
+
56
+ ## Summary
57
+
58
+ | Area | Specification followed | Deviation or extension | Why | Consequence |
59
+ |---|---|---|---|---|
60
+ | **Identity keys** | X3DH §2.2; `libsignal` `identity_key.rs` | **Deviation.** A 67-byte composite of separate X25519 and Ed25519 keys replaces the single 33-byte Curve25519 identity key | Avoids XEdDSA, a non-standard signature scheme with no vetted JavaScript implementation; standard Ed25519 is independently verifiable | Two keys to store and rotate; larger identity; **no wire compatibility for any identity-bearing material** |
61
+ | **Prekey signatures** | X3DH §2.2, §4.5 | **Deviation.** RFC 8032 Ed25519 over a domain-separated context binding the identity commitment, algorithm tag, and key ID — not XEdDSA over the bare key | Defeats cross-algorithm and cross-key-ID substitution that a bare-key signature does not cover | Strictly stronger binding; signatures are unverifiable by Signal Messenger clients and vice versa |
62
+ | **Safety numbers** | `libsignal` `fingerprint.rs` | **Deviation.** Iteration and digit encoding are byte-identical, but the input is a composite-identity commitment under an SDK domain string, the QR version is `3`, and the two halves are ordered by user ID rather than by digit string | Follows from the composite identity; a single-key fingerprint cannot authenticate both components | **Safety numbers are not comparable to Signal Messenger's.** The ordering rule also differs from `libsignal` even on the single-key path |
63
+ | **X3DH / PQXDH** | X3DH rev. 1; PQXDH rev. 3 | **Faithful** on DH order, the `0xFF`×32 prefix, zero-salt HKDF, KEM-secret position, and — since `0.1.0-alpha.6` — on PQXDH §2.2's info-string construction. **Deviation:** ML-KEM-1024 (FIPS 203) replaces round-3 Kyber1024 | Standardized ML-KEM preferred over round-3 Kyber. The info string names it, and names this application rather than `libsignal`'s, as §2.1 and §2.2 require | Wire-incompatible with `libsignal` by construction, and the label now says so. Sessions established before `0.1.0-alpha.6` derive a different `SK` and cannot be continued |
64
+ | **Associated data** | X3DH §3.3 | **Deviation.** `AD` is a domain-separated HMAC input over SHA-256 commitments to both composite identities, not `IK_A ‖ IK_B` | Binds the Ed25519 component, which a raw-key `AD` would leave uncovered | Stronger binding; wire-incompatible |
65
+ | **Double Ratchet** | Double Ratchet rev. 4 | **Faithful** on `WhisperRatchet`, `WhisperMessageKeys`, the `0x01`/`0x02` seeds, the 80-byte split, AES-256-CBC, the `0x44` version byte, and 8-byte MAC truncation | — | The ratchet core follows the Double Ratchet specification |
66
+ | **Message wire format** | `libsignal` `wire.proto` | **Faithful** field numbers 1–8. **Extension:** fields at 100+ carry identity type and ML-KEM one-time prekey material. **Deviation:** address binding uses variable-length UTF-8 user IDs and 4-byte device IDs instead of 17-byte ServiceIds and 1-byte device IDs | The SDK binds application-defined identifiers, not Signal Messenger ACIs | Wire-incompatible; a Signal Messenger client would silently ignore the added fields |
67
+ | **Skipped keys and archiving** | Double Ratchet §2.6; `libsignal` `consts.rs` | **Deviation.** The 2000-key cap is global rather than per-chain, eviction is by wall-clock timestamp, and skipped keys expire after 7 days. Session records serialize as JSON, not protobuf | Simpler storage accounting and bounded growth | **Legitimate messages can become undecryptable** where `libsignal` would still decrypt them: a 5× smaller effective cap, cross-chain eviction, and a hard 7-day limit for offline recipients |
68
+ | **Padding** | — | **Extension.** ISO 7816-4 bit padding to 160-byte buckets inside the library | Length hiding by default rather than left to the application | `libsignal` does not pad at this layer; Signal Messenger's apps do. PKCS#7 then adds a block, so ciphertext lands 16 bytes past each boundary |
69
+ | **SPQR / ML-KEM Braid** | ML-KEM Braid rev. 1 | **Deviation.** Same protocol, same KDF labels, same Reed–Solomon parameters, byte-identical message framing — except `hek = SHA3-256(ek_seed ‖ ek_vector)`, the operand order the specification states, which is the reverse of `libsignal`'s implementation | The normative text was followed over the executable reference | Wire-visible. Headers, ciphertexts, and shared secrets diverge; a braid session cannot complete a single epoch against `libsignal`'s implementation. Also means the KEM is not FIPS 203 in braid mode |
70
+ | **Triple Ratchet** | `libsignal` `triple_ratchet.rs` | **Faithful.** The PQ secret enters as the HKDF salt at message-key expansion, same label, same order | — | The braiding construction follows the ML-KEM Braid specification |
71
+ | **Sesame** | Sesame rev. 2 | **Deviation** on session expiry (§4.2 applies only to unacknowledged sessions) and on deleted devices (hard-removed rather than marked stale). **Extensions:** QR provisioning, device transfer, encrypted device names, identity-change gating, a 5-device cap | Product requirements the specification does not address | Hard deletion **drops the MAXLATENCY window, so in-flight messages from a just-removed device become permanently undecryptable**. Device transfer clones ratchet state, which weakens the forward-secrecy bound |
72
+ | **Sealed sender v1** | `libsignal` `sealed_sender.rs` | **Deviation.** Correct labels, cipher, and MAC length, but the 96-byte HKDF output is split `(cipher, mac, chain)` where `libsignal` splits `(chain, cipher, mac)`; keys in the salt omit the `0x05` type byte; the inner envelope is a hand-rolled varint format rather than the `UnidentifiedSenderMessage.Message` protobuf, though it now carries the same message-type values | The slice order and the missing prefix are unintentional; the framing is a deliberate simplification | Self-consistent and secure, but every v1 key sits in a different slot than `libsignal`'s |
73
+ | **Sealed sender v2** | `libsignal` `sealed_sender.rs` | **Faithful** on all four labels, the KEM, AES-256-GCM-SIV, the multi-recipient binary format, and the `0x3FFF` registration-ID mask | — | The v2 construction follows `libsignal` |
74
+ | **Delivery token** | `libsignal` `profile_key.rs` | **Faithful.** `deriveAccessKey` follows `libsignal`'s `ProfileKey::derive_access_key`, and reproduces `libsignal`'s published known-answer values | — | Not an SDK invention, despite what the module name suggests |
75
+ | **Sender keys** | `libsignal` `sender_keys.rs` | **Deviation.** Protobuf field numbers and `0x33` framing match, and the `0x01`/`0x02` seeds match, but message-key derivation **omits HKDF-Extract**, signatures are Ed25519 not XEdDSA, and `distributionUuid` carries a UTF-8 string rather than 16 UUID bytes | The Ed25519 choice follows the identity profile; the missing Extract appears unintentional | Group message keys differ from `libsignal`'s for the same chain key. Confirmed numerically, not merely by inspection |
76
+ | **Groups** | Signal Private Group System | **Independent design.** Real zkgroup primitives underneath; the server validates every change against zero-knowledge presentations and signs the accepted result, and clients verify those signatures. **Deviation:** profile-key credential issuance is not blinded — the issuing server sees the raw profile key at issuance time | Ships a validating group server with an enforcement contract (S1–S14) specified in-tree | Not wire-compatible with the Signal Private Group System; credentials are not interchangeable. The unblinded issuance path means a hostile issuance server learns profile keys, which the Signal Private Group System's blinded issuance prevents |
77
+ | **zkgroup / zkcredential** | `libsignal` `zkgroup`, `zkcredential`, `poksho` | **Faithful** port of the Ristretto255 KVAC and Sigma-protocol system, verified against `libsignal`'s known-answer vectors. **Deviation:** server parameter derivation is structured as four labelled derivations rather than one seeded derivation | Server keys are the deploying operator's own trust root (each deployment generates its own seed), not Signal Messenger's | The zero-knowledge properties are real. Credentials are not interchangeable with Signal Messenger's |
78
+ | **Registration IDs** | `libsignal` `sealed_sender.rs` | **Faithful** as of 0.1.0-alpha.4. Generated in `[1, 16383]`, strictly inside the 14 bits the wire format reserves | — | Through alpha.3 the range ran to 16384, which masked to `0` on the wire in multi-recipient sealed sender for roughly 1 install in 16,384 |
79
+
80
+ ---
81
+
82
+ ## 1. Identity keys and signatures
83
+
84
+ ### 1.1 Composite identity replaces the single Curve25519 key
85
+
86
+ `libsignal` represents an identity as one Curve25519 public key serialized as
87
+ `0x05 ‖ key` — 33 bytes ([`identity_key.rs:23-49`][ik]). The same private key is
88
+ used both for Diffie-Hellman and, via XEdDSA, for signing.
89
+
90
+ This SDK stores a versioned tuple of two separate keys
91
+ (`keys/identity.ts:20-23`, `:66-72`):
92
+
93
+ ```text
94
+ 0x01 version
95
+ || 0x01 || 32-byte X25519 public key DH component
96
+ || 0x02 || 32-byte Ed25519 public key signing component
97
+ ```
98
+
99
+ 67 bytes, X25519 first. Decoding fails closed on any wrong version byte, tag, or
100
+ length (`keys/identity.ts:75-96`).
101
+
102
+ **Why.** XEdDSA ([spec][xeddsa]) lets one Curve25519 key serve both roles by
103
+ converting a Montgomery point to an Edwards point at signing time. It is
104
+ elegant, and it is also non-standard: no vetted JavaScript implementation exists,
105
+ the conversion has sign-bit handling that is easy to get subtly wrong, and the
106
+ resulting signatures cannot be checked by any general-purpose Ed25519 verifier.
107
+ Carrying an explicit Ed25519 key costs 32 bytes and one more key to manage, and
108
+ buys signatures that any RFC 8032 implementation can verify and that auditors can
109
+ reason about without first reasoning about curve conversion.
110
+
111
+ **Cost.** Two keys to generate, store, rotate, and back up. A larger identity on
112
+ the wire and at rest. And no wire compatibility for anything that carries an
113
+ identity: prekey bundles, initial messages, sender certificates, safety numbers.
114
+ `libsignal`'s `IdentityKey::decode` reads the leading `0x01` as an unknown key
115
+ type and errors.
116
+
117
+ A commitment binds the tuple (`keys/identity.ts:98-100`):
118
+
119
+ ```text
120
+ SHA-256(UTF8("signal-protocol-js composite identity v1") || CompositeIdentityV1)
121
+ ```
122
+
123
+ A commitment received from a relay, cache, or caller is never trusted; it is
124
+ recomputed and compared in constant time (`keys/identity.ts:103-111`), and every
125
+ producer of stored identity bytes is forced through a decode/re-encode round trip
126
+ so that two encodings of the same key cannot forge an identity-change event
127
+ (`keys/identity.ts:154-161`). `libsignal` has no commitment concept, because a
128
+ single-key format has nothing to bind together.
129
+
130
+ **Not ported.** `libsignal`'s ACI↔PNI alternate-identity signature
131
+ ([`identity_key.rs:61-70`][ik]) has no SDK equivalent. ACI and PNI are fully
132
+ independent identities here with independent trust histories; neither certifies
133
+ the other. An application that wants a user's two identities linked must
134
+ establish that link itself.
135
+
136
+ ### 1.2 Prekey signatures are Ed25519 over a domain-separated context
137
+
138
+ `libsignal` signs the bare serialized public key with the identity key via
139
+ XEdDSA, and verifies the same way ([`session.rs:199-213`][sess]).
140
+
141
+ This SDK signs, with the separate Ed25519 key (`keys/prekey-signature.ts:39-45`):
142
+
143
+ ```text
144
+ UTF8("signal-protocol-js prekey signature v1")
145
+ || SHA-256 identity commitment
146
+ || algorithm tag (1 byte)
147
+ || key ID (uint32, big-endian)
148
+ || serialized public key
149
+ ```
150
+
151
+ ML-KEM prekeys must carry their `0x0A` tag inside the signed bytes
152
+ (`keys/prekey-signature.ts:33-38`).
153
+
154
+ **Why.** A bare-key signature says only "the identity holder signed these 32
155
+ bytes." It does not say which algorithm the key is for, which key ID it occupies,
156
+ or which identity it belongs to. Binding all three defeats cross-algorithm
157
+ substitution (presenting an X25519 signature as an ML-KEM one) and cross-key-ID
158
+ substitution. This is strictly stronger than the specification requires.
159
+
160
+ **Cost.** Wire incompatibility, and a signature format that no Signal Messenger
161
+ implementation can verify.
162
+
163
+ The same Ed25519-instead-of-XEdDSA choice applies to sealed sender certificates
164
+ (`internal/protocol/sealed-sender/certificate.ts:59`, `:106`) and to sender key
165
+ messages (§7.2).
166
+
167
+ XEdDSA and VXEdDSA are not implemented, not stubbed, and not claimed anywhere in
168
+ this codebase. Where the frozen upstream specification snapshots mention them,
169
+ that is upstream text; the SDK's own documentation consistently states that
170
+ ordinary Ed25519 is used instead.
171
+
172
+ ### 1.3 Safety numbers are not comparable to Signal Messenger's
173
+
174
+ State this without hedging: **a safety number produced by this SDK will never
175
+ match the safety number Signal Messenger shows for the same two users.** A user cannot
176
+ verify a contact by reading a number out of one application and comparing it
177
+ against the other.
178
+
179
+ Three independent reasons, any one of which is sufficient.
180
+
181
+ **The user-facing number is computed over a composite commitment.**
182
+ `client.verify()` uses `generateCompositeSafetyNumber`
183
+ (`client/sessions.ts:326`, `:432-433`), whose per-party hash iterates over
184
+ `UTF8("signal-protocol-js composite safety number v1") ‖ type-tagged user ID ‖
185
+ SHA-256 identity commitment` (`safety/core.ts:48-50`, `:205-233`). None of that
186
+ input exists in `libsignal`'s construction ([`fingerprint.rs:161-192`][fp]).
187
+
188
+ **The identity material differs.** Even the raw input is a 67-byte two-key tuple
189
+ rather than a 33-byte `0x05 ‖ X25519` key.
190
+
191
+ **The two halves are ordered by a different rule.** This one applies even on the
192
+ SDK's low-level single-key path, which is otherwise byte-identical to
193
+ `libsignal`. The SDK orders by user identifier — `localId.localeCompare(remoteId)`
194
+ (`safety/core.ts:177`) — where `libsignal` orders by the encoded digit strings
195
+ themselves ([`fingerprint.rs:32-40`][fp]). Both rules are symmetric, so the two
196
+ parties always agree with each other; they simply do not agree with Signal Messenger, and
197
+ roughly half the time the halves come out in the opposite order. `localeCompare`
198
+ is additionally locale-sensitive, so two devices with different default locales
199
+ can in principle disagree with each other on the ordering of the same pair of
200
+ user IDs.
201
+
202
+ What *is* faithful: the iteration is byte-for-byte `libsignal`'s — 5200
203
+ iterations of SHA-512 over `0x0000 ‖ key ‖ id`, then `hash ‖ key`
204
+ (`safety/core.ts:138-143` vs [`fingerprint.rs:170-189`][fp]) — as is the digit
205
+ encoding (six 5-byte big-endian chunks mod 100000, 30 digits per party) and the
206
+ scannable-fingerprint protobuf layout (`safety/protobuf.ts:94-109`). The
207
+ cross-verification swap and constant-time comparison match as well.
208
+
209
+ The QR format version is the SDK's own: `3` for the composite path
210
+ (`safety/core.ts:46`), where `libsignal` knows only versions 1 and 2 and returns
211
+ `VersionMismatch` for anything else. Using a distinct version in the same
212
+ protobuf namespace is the correct fail-closed choice — a Signal Messenger client rejects
213
+ the code rather than misreading it.
214
+
215
+ The SDK also offers an emoji fingerprint (`safety/core.ts:308-392`) and
216
+ verification deep links (`safety/url.ts`). Both are extensions with no
217
+ `libsignal` counterpart. Note that the emoji form is derived from one party's
218
+ fingerprint only, so it carries roughly half the information of the 60-digit
219
+ number and should not be presented to users as an equal-strength alternative.
220
+
221
+ ### 1.4 Registration ID range
222
+
223
+ Registration IDs are generated in the closed range `[1, 16383]`
224
+ (`keys/generation.ts:43-46`). The wire format reserves exactly 14 bits, and
225
+ `libsignal` rejects any ID where `id & 0x3FFF != id`
226
+ ([`sealed_sender.rs:1508-1515`][ss]); `libsignal`'s own helper generates `[1, 16380]`.
227
+
228
+ Through 0.1.0-alpha.3 the range was `[1, 16384]`, an off-by-one: 16384 is
229
+ `0x4000` and does not fit in 14 bits, and the SDK's multi-recipient sealed sender
230
+ encoder masks rather than rejects
231
+ (`internal/protocol/sealed-sender/v2-binary.ts:170-171`), so a generated `16384`
232
+ was written to the wire as `0` — roughly 1 install in 16,384. This is corrected
233
+ as of 0.1.0-alpha.4; the generated range is now strictly narrower than
234
+ `libsignal`'s accepted range, and a regression test asserts every generated ID
235
+ survives the mask unchanged.
236
+
237
+ ---
238
+
239
+ ## 2. X3DH and PQXDH
240
+
241
+ The key agreement is the most faithful area in the codebase. The DH computation
242
+ order, the 32-byte `0xFF` discontinuity prefix, the zero-filled HKDF salt, the
243
+ single-step derivation over the full concatenation, the position of the KEM
244
+ shared secret (appended last), and the 96-byte output split all match
245
+ `libsignal` exactly.
246
+
247
+ - Initiator DH order `DH(IK_A,SPK_B)`, `DH(EK_A,IK_B)`, `DH(EK_A,SPK_B)`,
248
+ `DH(EK_A,OPK_B)`: `internal/protocol/pqxdh/pqxdh.ts:243-264` vs
249
+ [`pqxdh.rs:202-224`][pq]. Spec X3DH §3.3.
250
+ - `F = 0xFF × 32` prefix: `internal/protocol/pqxdh/pqxdh.ts:267-271` vs
251
+ [`pqxdh.rs:200`][pq]. Spec X3DH §2.2.
252
+ - KEM secret appended after all DH outputs, then one HKDF:
253
+ `internal/protocol/pqxdh/pqxdh.ts:365-374` vs [`pqxdh.rs:226-230`][pq]. Spec
254
+ PQXDH §3.3.
255
+
256
+ Two hardening extensions go beyond the specification at no interop cost: every
257
+ remote X25519 point is validated before any DH is computed
258
+ (`internal/protocol/pqxdh/pqxdh.ts:219-227`), and prekey bundles are validated
259
+ far more strictly than `libsignal` requires
260
+ (`internal/session/handshake.ts:107-138`).
261
+
262
+ ### 2.1 The info strings name this application and this KEM
263
+
264
+ The SDK uses ML-KEM-1024 (FIPS 203) where `libsignal` uses round-3 Kyber1024,
265
+ tagged `0x0A` rather than `0x08` (`internal/crypto/pq/kyber.ts:79`). That much is
266
+ deliberate: the standardized algorithm is preferred over the round-3 draft, and a
267
+ single unambiguous tag is preferred over carrying a legacy fallback.
268
+
269
+ The info strings are the SDK's own (`types/protocol-config.ts:363-386`):
270
+
271
+ ```text
272
+ OpenE2EE_X25519_SHA-256_ML-KEM-1024 (PQXDH)
273
+ OpenE2EE (X3DH)
274
+ ```
275
+
276
+ Both parameters the specifications leave to the implementer are set to what
277
+ this SDK is and runs. PQXDH §2.2 defines the info string as `info`, `curve`,
278
+ `hash`, and `pqkem` joined by `_`, with each representation implementer-chosen;
279
+ §2.1 defines `info` as an application identifier of at least 8 bytes. X3DH §2.1
280
+ defines the same `info` parameter, and §3.3 uses it as the HKDF info with
281
+ nothing appended.
282
+
283
+ Through `0.1.0-alpha.5` these were `libsignal`'s labels — `WhisperText` and
284
+ `WhisperText_X25519_SHA-256_CRYSTALS-KYBER-1024` ([`pqxdh.rs:73-74`][pq]) —
285
+ which was wrong on both parameters:
286
+
287
+ 1. **`pqkem` named a KEM the SDK does not run**, violating §2.2. Worse than a
288
+ labelling error: two implementations feeding an identical label derived
289
+ *different* shared secrets, because the KEM underneath differed, with
290
+ nothing at the KDF layer to signal it. Domain separation is the one job the
291
+ info string has.
292
+ 2. **`info` named someone else's application.** The specifications ask for an
293
+ identifier of the application deriving the key. This SDK is not Signal
294
+ Messenger, and the label saying otherwise was inherited, not chosen.
295
+
296
+ Both are corrected as of `0.1.0-alpha.6`. This is a
297
+ pre-1.0 format break: sessions established under the old labels derive a
298
+ different `SK` and cannot be continued. Nothing else about the derivation
299
+ changed.
300
+
301
+ An application that needs `libsignal`'s known-answer vectors can still get them
302
+ by setting `protocolStrategy.keyExchangeInfoString` to the old label
303
+ explicitly, which is what that option is for. Doing so re-adopts the §2.2
304
+ violation knowingly rather than by default.
305
+
306
+ ### 2.2 Associated data binds identity commitments
307
+
308
+ X3DH §3.3 specifies `AD = Encode(IK_A) ‖ Encode(IK_B)`, and `libsignal`
309
+ implements exactly that with raw 33-byte serialized keys
310
+ ([`protocol.rs:225-241`][proto]).
311
+
312
+ The SDK computes (`internal/session/identity-binding.ts:11-25`):
313
+
314
+ ```text
315
+ HMAC-SHA256(mac_key,
316
+ UTF8("signal-protocol-js composite identity message mac v1")
317
+ || SHA-256 commitment to sender's composite identity
318
+ || SHA-256 commitment to receiver's composite identity
319
+ || version byte || protobuf bytes
320
+ )[0..8]
321
+ ```
322
+
323
+ **Why.** With a two-key identity, an `AD` over the DH key alone would leave the
324
+ Ed25519 signing component unbound — the component that authenticates every prekey
325
+ the peer will ever publish. Hashing the commitment covers both.
326
+
327
+ **Cost.** This is the single largest wire deviation in the message path. The
328
+ truncation to 8 bytes matches `libsignal`'s convention, and the construction is sound
329
+ and domain-separated, but a Signal Messenger client and this SDK cannot exchange a single
330
+ message.
331
+
332
+ ### 2.3 One-time prekey deletion is deferred
333
+
334
+ PQXDH §3.4 has Bob delete a used one-time prekey after successful decryption. The
335
+ SDK records a pending deletion (`internal/manager/manager.ts:940-952`) and
336
+ commits it only once a prekey message decrypts
337
+ (`internal/session/cipher.ts:1189-1200`). This is compliant in letter and widens
338
+ the window in which the same first ciphertext can be replayed before commit;
339
+ duplicate and missing-prekey conditions are refused auto-recovery
340
+ (`internal/session/cipher.ts:1519-1527`).
341
+
342
+ ### 2.4 Ratchet initialization details
343
+
344
+ Two differences at the boundary between key agreement and the ratchet:
345
+
346
+ **Alice reuses her key-agreement ephemeral as her first ratchet key**
347
+ (`internal/session/builder.ts:159-171`). `libsignal` generates a fresh sending
348
+ ratchet key distinct from the handshake ephemeral ([`ratchet.rs:77-81`][rat]), so
349
+ the prekey message's base key and the first message's ratchet key differ. Here
350
+ they are the same value. No concrete attack follows, but it is a reduction in key
351
+ separation and it is wire-visible.
352
+
353
+ **Bob initializes without a sending chain** (`internal/session/builder.ts:326-364`),
354
+ deriving chains on the first DH ratchet, where `libsignal` seeds a sending chain
355
+ immediately ([`ratchet.rs:137-172`][rat]). A side effect is that bytes 32–64 of
356
+ the 96-byte derivation — the initial chain key — never produce a message key on
357
+ either side. The 96-byte split is retained for shape compatibility, but only the
358
+ root key and the SPQR key are load-bearing.
359
+
360
+ ### 2.5 Classical fallback is retained but gated
361
+
362
+ `libsignal` has removed X3DH entirely and rejects pre-Kyber prekey messages
363
+ ([`session.rs:105-112`][sess]). The SDK keeps the X3DH path reachable only via an
364
+ explicit opt-in; the default is fail-closed, and any PQXDH failure raises rather
365
+ than silently downgrading (`internal/session/handshake.ts:167-260`). This is a
366
+ downgrade surface that `libsignal` has closed, and it is documented in
367
+ [Protocol Policy](./PROTOCOL_POLICY.md).
368
+
369
+ ---
370
+
371
+ ## 3. Double Ratchet and wire format
372
+
373
+ ### 3.1 The ratchet core is faithful
374
+
375
+ Byte-for-byte with `libsignal`: the `0x01`/`0x02` chain-key seeds
376
+ (`internal/crypto/kdf/hkdf.ts:183-195` vs [`keys.rs:148-149`][rk]), the
377
+ `WhisperMessageKeys` expansion to 80 bytes split 32/32/16
378
+ (`internal/crypto/kdf/hkdf.ts:215-243` vs [`keys.rs:100-118`][rk]), the
379
+ `WhisperRatchet` root-key step producing a 64-byte split
380
+ (`internal/crypto/kdf/hkdf.ts:141-161` vs [`keys.rs:199-218`][rk]), the DH ratchet
381
+ half-step ordering, `MAX_RECEIVER_CHAINS = 5`, AES-256-CBC with PKCS#7, the
382
+ `0x44` version byte, and 8-byte MAC truncation.
383
+
384
+ Message framing matches too: `[version byte] ‖ protobuf ‖ [8-byte HMAC]` for
385
+ messages and `[version byte] ‖ protobuf` for prekey messages
386
+ (`internal/encoding/proto/envelope.ts:104-168`). What goes *into* the MAC does
387
+ not — see §2.2.
388
+
389
+ Protobuf fields 1–8 match [`wire.proto`][wp] exactly, including `libsignal`'s
390
+ non-obvious ordering where `registrationId` is field 5 and `signedPreKeyId` is
391
+ field 6.
392
+
393
+ ### 3.2 Added fields and address binding
394
+
395
+ **Extension.** The SDK adds fields in the 100+ range that `libsignal` does not
396
+ have: `recipientIdentityType` on both message types, and `kemOneTimePreKeyId` /
397
+ `kemOneTimeCiphertext` on prekey messages
398
+ (`internal/encoding/proto/signal-message.ts:80`, `:226-228`). High numbering
399
+ avoids collision with future upstream fields. A Signal Messenger client would parse the
400
+ message and silently ignore them, losing the identity-type binding.
401
+
402
+ **Deviation.** `libsignal` binds addresses as a 17-byte fixed-width ServiceId plus
403
+ a 1-byte device ID ([`protocol.rs:246-260`][proto]). The SDK binds a
404
+ format-version byte, a varint-length-prefixed UTF-8 user ID, and a 4-byte
405
+ big-endian device ID (`internal/encoding/proto/signal-message.ts:84-92`). The
406
+ encoding is unambiguous, but it authenticates an application-defined identifier
407
+ rather than a Signal Messenger ACI or PNI — which is the correct thing for this SDK to bind
408
+ and an incompatible thing to put on the wire.
409
+
410
+ The SDK is also stricter than `libsignal` on decode, requiring fields that
411
+ `libsignal` treats as optional for backward compatibility and enforcing exact
412
+ lengths (`internal/encoding/proto/signal-message.ts:332-340`, `:488-505`). Safer,
413
+ and one more reason the formats cannot meet.
414
+
415
+ ### 3.3 Skipped-key retention is materially tighter than libsignal's
416
+
417
+ The constants match — `MAX_MESSAGE_KEYS = 2000`, `MAX_FORWARD_JUMPS = 25000`
418
+ (`internal/protocol/double-ratchet/ratchet.ts:194-227` vs [`consts.rs:8-9`][consts])
419
+ — but they are applied differently, and the difference is user-visible.
420
+
421
+ **The cap is global, not per-chain.** `libsignal` applies 2000 to each chain's key
422
+ vector ([`double_ratchet.rs:349-361`][dr]), so with five receiver chains the true
423
+ system capacity is 10,000 skipped keys. The SDK counts across all chains and
424
+ evicts when the total reaches 2000
425
+ (`internal/protocol/double-ratchet/chains.ts:478-513`). The effective capacity is
426
+ 5× smaller, and traffic on a newer chain can evict keys belonging to an older one.
427
+
428
+ **Eviction is by wall-clock timestamp**, scanning every chain for the oldest
429
+ entry (`internal/protocol/double-ratchet/chains.ts:414-463`), where `libsignal`
430
+ evicts strictly by insertion position. `Date.now()` is not monotonic, so eviction
431
+ order is not deterministic across clock adjustments.
432
+
433
+ **Skipped keys expire after 7 days**
434
+ (`internal/protocol/double-ratchet/ratchet.ts:197`). `libsignal` has no
435
+ time-based expiry for message keys at all.
436
+
437
+ Taken together: **there are message-delivery patterns where this SDK reports an
438
+ undecryptable message and `libsignal` would have decrypted it.** A recipient
439
+ offline for more than a week, or one receiving heavy traffic on a new chain while
440
+ older-chain messages are still in flight, can lose messages that the
441
+ specification's own limits would have preserved. The bounds are defensible as
442
+ storage hygiene; the consequence should not be a surprise.
443
+
444
+ Two related extensions: a `processedChains` map rejects messages bearing a ratchet
445
+ key from an already-retired chain (`internal/protocol/double-ratchet/ratchet.ts:141-153`),
446
+ closing a replay gap that `libsignal` handles only via its five-chain window; and
447
+ self-sessions get a finite 100,000-message skip limit
448
+ (`internal/session/validation.ts:453-461`) where `libsignal` uses `usize::MAX`.
449
+
450
+ ### 3.4 Session archiving and serialization
451
+
452
+ The cap matches (40 archived states, [`consts.rs:11`][consts]), but the structure
453
+ differs. `libsignal` keeps an ordered list with strict insertion-order eviction
454
+ ([`session.rs:787-830`][st]); the SDK keeps a map keyed by base key and trims by
455
+ `lastUsedAt` (`types/session.ts:815-847`). Archiving a session whose base key
456
+ already exists overwrites rather than appends, so the effective history can be
457
+ shorter than 40.
458
+
459
+ `libsignal` clears unacknowledged prekey state before archiving a session; the SDK
460
+ does not. Retired sessions therefore keep pending prekey references alive in
461
+ storage.
462
+
463
+ **Session records serialize as JSON, not protobuf** (`types/session.ts:1002-1028`).
464
+ This is acknowledged in the source as a simplicity and debuggability choice.
465
+ Consequences worth naming: stored sessions are not portable to or from any Signal Messenger
466
+ client, and key material sits in immutable JavaScript strings that cannot be
467
+ zeroed, where `libsignal`'s byte vectors can be.
468
+
469
+ ### 3.5 Padding
470
+
471
+ **Extension.** Message plaintext is padded to 160-byte buckets with ISO 7816-4 bit
472
+ padding — a `0x80` terminator followed by zeros
473
+ (`internal/crypto/symmetric/padding.ts:19-60`). Unpadding scans backwards and
474
+ rejects malformed padding with a deliberately generic error to avoid a padding
475
+ oracle.
476
+
477
+ `libsignal` does not bucket-pad at this layer; in Signal Messenger, that lives in the client
478
+ applications. Doing it in the library means length hiding is on by default rather
479
+ than a thing each integrator must remember.
480
+
481
+ One imprecision: because the padded plaintext is an exact multiple of 160 and
482
+ AES-CBC then applies PKCS#7, a full block is always appended. A 5-byte message
483
+ produces 160 padded bytes and 176 ciphertext bytes. Length is still quantized in
484
+ 160-byte steps, so the hiding property holds; the ciphertext simply sits 16 bytes
485
+ past each boundary rather than on it.
486
+
487
+ ---
488
+
489
+ ## 4. SPQR and the ML-KEM Braid
490
+
491
+ This is the same protocol as the SparsePostQuantumRatchet v1 protocol, implemented
492
+ independently and pinned against `SparsePostQuantumRatchet v1.5.1` (commit
493
+ `f2589fef`). The fidelity is high and specific:
494
+
495
+ - **KDF labels are byte-identical**, including the double space in
496
+ `"Signal PQ Ratchet V1 Chain Start"` (`internal/crypto/kdf/hkdf.ts:353-368`).
497
+ - **The authenticator construction matches**, including `PROTOCOL_INFO =
498
+ "Signal_PQCKA_V1_MLKEM768"` and the `:ekheader` / `:ciphertext` MAC inputs
499
+ (`internal/protocol/spqr/ml-kem-braid/kdf.ts:32-92`).
500
+ - **The Reed–Solomon erasure layer matches**: GF(2^16) with primitive polynomial
501
+ `0x1100b`, 32-byte chunks, 16 polynomials, degree bound 35. Reed–Solomon is
502
+ present in `libsignal`; it is not an SDK addition.
503
+ - **The production wire framing is byte-compatible**:
504
+ `VERSION ‖ LEB128(epoch) ‖ LEB128(chain_index) ‖ MSG_TYPE ‖ [LEB128(chunk_index) ‖ CHUNK]`
505
+ (`internal/encoding/proto/pq-ratchet-serialize.ts`), matching `libsignal`'s
506
+ `serialize.rs`, with the same message-type values and the same epoch offset.
507
+ - **ML-KEM-768 with the same incremental split** (32-byte seed, 1152-byte vector,
508
+ 960/128-byte ciphertext parts).
509
+
510
+ ### 4.1 The `hek` operand order diverges
511
+
512
+ One divergence breaks interoperability completely. The SDK computes
513
+ (`internal/protocol/spqr/ml-kem-braid/noble-pq/index.ts:841-843`):
514
+
515
+ ```text
516
+ hek = SHA3-256(ek_seed || ek_vector)
517
+ ```
518
+
519
+ `libsignal`, via libcrux, builds the encapsulation key as
520
+ `t̂ ‖ ρ` before hashing — the reverse order.
521
+
522
+ The SDK follows the **normative text of the published ML-KEM Braid
523
+ specification**, which states seed-first ordering. `libsignal` follows FIPS 203,
524
+ which serializes vector-first. The specification and the reference implementation
525
+ disagree, and the SDK chose the specification.
526
+
527
+ The value feeds the Fujisaki–Okamoto transform, so the consequences cascade:
528
+ different header bytes, so `libsignal`'s header validation rejects the SDK's output;
529
+ different ciphertext; different shared secret; different epoch secret; different
530
+ authenticator ratchet. **A braid session between this SDK and Signal Messenger's
531
+ implementation cannot complete a single epoch.**
532
+
533
+ Two further consequences a reader should not have to infer:
534
+
535
+ - **In braid mode the KEM is not FIPS 203 ML-KEM-768.** It is ML-KEM-768 with a
536
+ modified `hek` derivation. The security argument is unaffected — the hash input
537
+ is a permutation of the same material — but a FIPS conformance claim would not
538
+ hold for this path. Direct (non-braid) mode uses stock ML-KEM-768.
539
+ - The SDK resolves the same spec-versus-code conflict in the *opposite* direction
540
+ elsewhere: for `KDF_AUTH`, it follows the `libsignal` Rust reference rather than the
541
+ written specification. The two choices are individually defensible and
542
+ collectively inconsistent about which artifact is authoritative.
543
+
544
+ The operand order is part of the public compatibility boundary stated in
545
+ [Protocol Policy](./PROTOCOL_POLICY.md). Changing it later would invalidate every
546
+ braid session persisted under the former ordering.
547
+
548
+ ### 4.2 Direct mode and state format
549
+
550
+ **Extension.** An opt-in direct mode (`protocol.braid: 'disabled'`) uses stock
551
+ ML-KEM-768 and adds wire message types `0x80`–`0x82`
552
+ (`internal/encoding/proto/pq-ratchet-serialize.ts:38-45`). `libsignal`'s parser rejects
553
+ anything above `6`, so these are visible only within the SDK; they occupy a byte
554
+ range `libsignal` has not claimed. This mode has no Signal Protocol analogue.
555
+
556
+ **Independent design.** Persisted SPQR state uses a flat message with 20 fields
557
+ where `libsignal` uses an 11-variant `oneof` over nested structures. Serialized SPQR
558
+ state is not portable in either direction.
559
+
560
+ **Deviation.** Skipped-key eviction in the SPQR chain triggers at the cap and
561
+ evicts by wall-clock timestamp, where `libsignal` triggers at `max_ooo × 11/10 + 1` and
562
+ evicts by message index. `libsignal`'s rule is deterministic and index-anchored; the
563
+ SDK's introduces a clock dependency into ratchet state.
564
+
565
+ ### 4.3 The Triple Ratchet is faithful
566
+
567
+ The post-quantum secret enters as the HKDF **salt** at message-key expansion, with
568
+ the classical message key as IKM and the `WhisperMessageKeys` label
569
+ (`internal/session/cipher.ts:453-510`) — the same combination order and the same
570
+ label as [`triple_ratchet.rs`][tr]. There is no root-key braiding in either
571
+ implementation.
572
+
573
+ Note that `internal/protocol/triple-ratchet/` contains a second, unused hybrid KDF
574
+ using the label `'Signal Triple Ratchet V1'`. It is exported but not called from
575
+ the message path, and it is incompatible with what the SDK actually puts on the
576
+ wire. It is documented in the PR that accompanied this file as cleanup work.
577
+
578
+ ---
579
+
580
+ ## 5. Sesame
581
+
582
+ Sesame has no reference implementation to compare against — `libsignal` does not
583
+ implement it; device and session management lives in the Signal Messenger service and its
584
+ clients. Everything below is measured against the pinned specification text
585
+ (revision 2) alone.
586
+
587
+ Faithful: the user-record and device-record structure (§3.1), the per-device
588
+ session fan-out on send including the sender's own other devices (§3.3), the
589
+ bounded send loop (§3.3, §6.5), discard-all-changes-on-error handled
590
+ transactionally (§3.3, §3.4, §6.7), and creating a session on receive only from an
591
+ initiating message (§3.4). The per-user identity model is one of the two the
592
+ specification explicitly permits (§3.1).
593
+
594
+ ### 5.1 Deleted devices are removed rather than marked stale
595
+
596
+ §3.1 and §3.3 require a removed device's record to be marked stale and retained
597
+ for MAXLATENCY, so that messages already in flight from that device still
598
+ decrypt. The SDK removes the record immediately
599
+ (`internal/sesame/manager.ts:2098-2102`).
600
+
601
+ **Consequence, stated plainly: a message sent by a device that was removed moments
602
+ earlier becomes permanently undecryptable.** The specification's staleness window
603
+ exists precisely to prevent this. This is the most substantive contradiction of
604
+ the Sesame text in the codebase.
605
+
606
+ Relatedly, the SDK reuses the word `stale` for a different concept — a device
607
+ *list* that needs refetching (`internal/sesame/types.ts:476-483`) — rather than
608
+ the specification's meaning of a deleted user or device.
609
+
610
+ ### 5.2 Session expiry applies only to unacknowledged sessions
611
+
612
+ §4.2 is unconditional: at MAXSEND past its timestamp, a session must no longer be
613
+ used for encryption. The SDK applies that bound only to sessions that have never
614
+ received a reply (`internal/sesame/types.ts:175-199`). A session that received one
615
+ message on its first day remains a valid encryption session indefinitely.
616
+
617
+ The configuration field is honestly renamed to `maxUnacknowledgedSessionAge` to
618
+ reflect this. The gap worth naming is that the §4.2 invariant check
619
+ (`internal/sesame/validation.ts:93-101`) is still validated against that renamed
620
+ quantity, so it is enforcing the specification's arithmetic over a value that no
621
+ longer carries the specification's meaning.
622
+
623
+ ### 5.3 Device limit
624
+
625
+ A hard cap of 5 devices per user (`internal/sesame/types.ts:45-50`, enforced at
626
+ `internal/sesame/manager.ts:285-290`). §6.5 recommends *a* limit without fixing
627
+ one; `libsignal` permits device IDs up to 127. This is a product decision, and a
628
+ source comment attributing it to the Signal Protocol is inaccurate.
629
+
630
+ ### 5.4 Extensions: provisioning, transfer, device names
631
+
632
+ None of these exist in Sesame rev. 2, which says nothing about how devices come to
633
+ exist, are named, or migrate.
634
+
635
+ **QR device provisioning** (`device/provisioning.ts`). Ephemeral X25519 ECDH →
636
+ HKDF → AES-256-GCM, with a `signalprotocol://link-device` QR scheme, strict prefix
637
+ and key validation, a 5-minute TTL, and rollback on both server and local failure.
638
+ The construction is sound. The property worth naming: the provisioning key is not
639
+ bound to the primary device's long-term identity, so the channel is authenticated
640
+ only by out-of-band display of the QR code.
641
+
642
+ **Device transfer** (`device/transfer.ts`). Clones the identity private key and
643
+ live ratchet state to a new device. This is useful and it **violates the
644
+ invariant Sesame is built on** — one device record, one device, its own sessions.
645
+ After a transfer, two physical devices hold the same identity private key and the
646
+ same ratchet state for every peer. Peer messages decrypted by one desynchronize
647
+ the other, and duplicating ratchet state weakens the forward-secrecy guarantee
648
+ that compromise of one endpoint is bounded to that endpoint. Archived sessions are
649
+ deliberately dropped on restore, which also discards the convergence state §3.4
650
+ depends on.
651
+
652
+ **Encrypted device names** (`device/device-name-crypto.ts`). A three-field
653
+ protobuf with a synthetic IV derived by HMAC and AES-256-CTR — the standard SIV
654
+ pattern, correctly constructed. No specification counterpart.
655
+
656
+ **Identity-change gating.** Unseen identities are TOFU-pinned; a changed identity
657
+ sets `pendingVerification` and blocks sending until the application accepts the
658
+ rotation (`internal/sesame/manager.ts:561-566`, `:1682-1714`). Sesame rev. 2 has
659
+ no such concept. This is a genuine improvement.
660
+
661
+ **Not implemented:** proof of possession. Device registration does not require the
662
+ device to sign a server-issued nonce with the identity private key, so
663
+ registration places more trust in the relay than §6.3's discussion assumes. A
664
+ deployment that needs this must add it at the application layer.
665
+
666
+ ---
667
+
668
+ ## 6. Sealed sender
669
+
670
+ ### 6.1 Version 2 is faithful
671
+
672
+ All four HKDF labels are byte-identical, the KEM construction and its
673
+ direction-swapped IKM orderings match, the authentication tag is the same 16-byte
674
+ raw HKDF output, AES-256-GCM-SIV is used with a zero nonce and no AAD as
675
+ `libsignal` does, and the multi-recipient binary format — version bytes
676
+ `0x22`/`0x23`, varint count, 17-byte ServiceIds, the packed device ID and 14-bit
677
+ registration ID, the `0x3FFF` mask — matches ([`sealed_sender.rs:1023-1153`][ss],
678
+ `:1306-1360`). Certificate validation order and semantics match as well, including
679
+ the non-short-circuiting trust-root loop that avoids revealing which root
680
+ validated.
681
+
682
+ ### 6.2 Version 1 diverges in three places
683
+
684
+ **The 96-byte HKDF output is split in a different order.** `libsignal` derives
685
+ `(chain_key, cipher_key, mac_key)` ([`sealed_sender.rs:711-746`][ss]); the SDK
686
+ derives `(cipher, mac, chain)`
687
+ (`internal/protocol/sealed-sender/encryption.ts:164-166`). The construction is
688
+ self-consistent and secure — the keys are independent HKDF output either way — but
689
+ every v1 key sits in a different slot than `libsignal`'s. This is an
690
+ implementation divergence rather than a design decision, and the SDK's own pinned
691
+ specification document records the same order, so the two are at least consistent
692
+ with each other.
693
+
694
+ **Public keys in the v1 salt and in certificates omit the `0x05` type byte.**
695
+ `libsignal` uses the 33-byte serialized form; the SDK uses raw 32 bytes and
696
+ enforces that length
697
+ (`internal/protocol/sealed-sender/certificate.ts:306-309`). Notably the SDK's own
698
+ v2 path *does* apply the `0x05` prefix, so the two sealed-sender versions are
699
+ internally inconsistent about this.
700
+
701
+ **The inner envelope is a hand-rolled varint format**
702
+ (`internal/protocol/sealed-sender/encryption.ts:46-86`) rather than the
703
+ `UnidentifiedSenderMessage.Message` protobuf. It does carry the message-type
704
+ field `libsignal` uses to dispatch between prekey, regular, sender-key, and
705
+ plaintext payloads ([`sealed_sender.rs:2055-2075`][ss]), as a leading byte
706
+ using `libsignal`'s enum values, so the framing differs but the dispatch does
707
+ not. Through 0.1.0-alpha.7 the field was absent and the unseal path
708
+ reconstructed the envelope with a fixed type, which made sealed group messages
709
+ undecryptable as group messages.
710
+
711
+ **`PLAINTEXT_CONTENT` (8) is a known wire value that this SDK rejects.**
712
+ `libsignal` uses it to carry a `DecryptionErrorMessage` when no session exists
713
+ to encrypt one under ([`sealed_sender.rs:2055-2075`][ss]). This SDK delivers
714
+ decryption-error signals over a dedicated relay channel instead — the
715
+ `retryRequests` table and `sendRetryRequest`, per Sesame §4.1 — so no send path
716
+ produces the type and no decrypt path consumes it. It is therefore rejected at
717
+ the envelope parse (`internal/protocol/sealed-sender/types.ts`) rather than
718
+ mapped to an envelope type with no handler. The enum retains the member so the
719
+ wire values stay a faithful record, and `envelopeTypeForContent` throws on it so
720
+ that adding a member without a route fails loudly. A peer that sends one gets a
721
+ clean parse failure, not a payload routed into the pairwise ratchet.
722
+
723
+ Note the cost when debugging interop. The parsers throw a single generic error
724
+ for every malformed envelope, so a peer implementation that legitimately sends
725
+ `PLAINTEXT_CONTENT` fails with `Sealed sender verification failed` — the same
726
+ string a MAC mismatch produces. The uniformity is deliberate and the parse runs
727
+ after authentication, so nothing here is an oracle; but if sealed messages from
728
+ one particular peer stack fail with that error while messages from this SDK
729
+ succeed, check the leading content-type byte before treating it as a
730
+ cryptographic failure.
731
+
732
+ ### 6.3 The delivery token follows `libsignal`, not an SDK invention
733
+
734
+ Despite the module name, `deriveAccessKey`
735
+ (`internal/protocol/sealed-sender/delivery-token.ts:52-91`) is `libsignal`'s
736
+ `ProfileKey::derive_access_key` — AES-256-GCM over 16 zero bytes with a zero
737
+ nonce, truncated to 16 bytes — and it reproduces the values `libsignal`
738
+ publishes for that derivation. It is a 16-byte value derived from the
739
+ recipient's profile key
740
+ that proves to the relay that the sender knows that profile key, gating anonymous
741
+ delivery to contacts. It never enters the sealed-sender wire format; it is
742
+ presented out of band.
743
+
744
+ The SDK's own documentation previously described a different, 12-byte HKDF
745
+ construction that no code implements. That description is wrong and is corrected
746
+ in the PR accompanying this file.
747
+
748
+ Certificate signatures use Ed25519 rather than XEdDSA, per §1.2, so SDK
749
+ certificates cannot validate against a Signal Messenger trust root or vice versa. The
750
+ revocation list is empty where `libsignal` revokes one key ID, which is
751
+ appropriate for a different trust root but worth noting.
752
+
753
+ ---
754
+
755
+ ## 7. Sender keys and groups
756
+
757
+ ### 7.1 Sender key message format
758
+
759
+ Protobuf field numbers and types match [`wire.proto`][wp] exactly, the
760
+ `[version byte] ‖ protobuf ‖ [64-byte signature]` framing with version `0x33`
761
+ matches, the `0x01`/`0x02` chain seeds and the `WhisperGroup` info string match,
762
+ AES-256-CBC with the derived IV matches, and the capacity constants match.
763
+
764
+ Three things do not:
765
+
766
+ **`distributionUuid` carries a UTF-8 string, not 16 UUID bytes.** The SDK writes
767
+ the 36-character textual form of a random UUIDv4
768
+ (`internal/protocol/sender-keys/manager.ts:279`, `:932`); `libsignal` writes
769
+ exactly the 16 raw bytes and rejects anything else on parse. The value is now
770
+ the same *kind* of thing `libsignal` uses — an opaque random identifier
771
+ unrelated to the group — but the encoding still differs, so the frames remain
772
+ mutually unparseable. Related: `chain_id` is an FNV-1a hash of that string
773
+ rather than a random 31-bit value.
774
+
775
+ Until recently the SDK wrote `groupId:userId:deviceId:timestamp` here, which was
776
+ a metadata leak rather than a format deviation: `distributionUuid` sits outside
777
+ the ciphertext, so every relay on the path could read the plaintext group and
778
+ sender off each message. That is fixed; the sender-keys specification now
779
+ requires the identifier to be opaque.
780
+
781
+ **Signatures are Ed25519, not XEdDSA**, per §1.2 — and `libsignal` serializes the
782
+ signing key as 33 bytes where the SDK uses 32.
783
+
784
+ ### 7.2 Message-key derivation omits HKDF-Extract
785
+
786
+ This one is worth stating precisely because the field numbers and labels above
787
+ make the format look compatible.
788
+
789
+ `libsignal` derives sender message keys with
790
+ `Hkdf::<Sha256>::new(None, &seed).expand(b"WhisperGroup", 48)`
791
+ ([`sender_keys.rs:36-38`][sk]). `Hkdf::new` performs HKDF-**Extract** first:
792
+ `PRK = HMAC-SHA256(salt = zeros[32], seed)`. Only then does it expand.
793
+
794
+ The SDK calls `hkdfExpand(seed, info, 48)` directly
795
+ (`internal/protocol/sender-keys/manager.ts:1062-1066`), where `hkdfExpand`
796
+ (`internal/crypto/kdf/hkdf.ts:86-116`) is pure RFC 5869 Expand using the seed
797
+ itself as the PRK. The extract step is missing.
798
+
799
+ The derived IV and cipher key therefore differ from `libsignal`'s for the same
800
+ chain key. This was confirmed numerically, not merely by inspection: for a chain
801
+ key of 32 repeated `0x42` bytes, the SDK derives IV
802
+ `2a56b9eb80b3c1ffebd97221b2175960` where `libsignal` derives
803
+ `890d51ea73e564722351dc0d5a09142c`.
804
+
805
+ This appears unintentional. It is not a weakness — omitting Extract from a
806
+ uniformly random HMAC output is cryptographically fine — but the repository's own
807
+ sender-keys note claims equivalence with `libsignal` at this step, and that claim
808
+ is incorrect. Flagged for correction.
809
+
810
+ ### 7.3 Groups are an independent design
811
+
812
+ The zero-knowledge primitives underneath are real and faithful (§7.4). The group
813
+ system built on them is not the Signal Private Group System.
814
+
815
+ What is faithful: role and access-control enum values match `libsignal`'s exactly,
816
+ group ID derivation from the master key is correct, the `open-e2ee:group:`
817
+ identifier namespace is package-owned, authentication genuinely uses zkgroup
818
+ credentials, and member identifiers and profile keys are encrypted with real
819
+ `UidCiphertext` and `ProfileKeyCiphertext`.
820
+
821
+ What differs, and it is structural:
822
+
823
+ **The enforcement contract is this SDK's own.** Like the Signal Private Group
824
+ System, the client submits change actions carrying zero-knowledge
825
+ presentations, and the **server** validates every action against the group's
826
+ access control before signing and persisting the accepted result. The
827
+ enforcement rules are the SDK's own specified S1–S14 contract rather than
828
+ Signal Messenger's server implementation, and the shipped enforcing server
829
+ (`internal/groups/server-engine.ts`, with an installable Convex component)
830
+ implements that contract. Clients verify the
831
+ server's signature, group binding, strict version sequence, and pre-state
832
+ authorization on every applied change.
833
+
834
+ **Profile-key credential issuance is not blinded.** The issuance endpoint
835
+ receives the raw 32-byte profile key, so the issuing server sees every user's
836
+ profile key in plaintext at issuance time. The Signal Private Group System
837
+ issues profile-key credentials over a *blinded* commitment, so its server
838
+ never learns the key. The blinding primitives exist in this codebase
839
+ (`internal/protocol/zk/credentials/issuance.ts`) but are not wired into this
840
+ path; §12.1 of the in-tree group specification carries the same caveat.
841
+ A deployer must treat the issuance server as learning profile keys — and
842
+ therefore profile names and avatars — until blinded issuance ships.
843
+
844
+ **Serialization is JSON**, not protobuf, both for group state
845
+ (`internal/groups/manager.ts:1229-1236`) and for the blob payloads inside the
846
+ AES-256-GCM-SIV envelope (`internal/groups/encrypted-state.ts:70-81`). Every
847
+ encrypted group title and description is undecryptable by Signal Messenger even with the
848
+ correct master key.
849
+
850
+ **Invite links** use `https://join.open-e2ee.dev/#` with a 49-byte raw payload
851
+ (`internal/groups/invite-link.ts:36`, `:78-85`), where `libsignal` uses
852
+ `https://signal.group/#` with a protobuf. This is labelled accurately in source as
853
+ the package's own format.
854
+
855
+ ### 7.4 The zero-knowledge layer is a faithful port
856
+
857
+ Stated directly, because "zk" in a codebase often means something weaker: this is
858
+ a genuine zero-knowledge credential system, not HMAC tokens, not signatures, not a
859
+ placeholder.
860
+
861
+ `internal/protocol/zk/` implements the Sigma protocol over Ristretto255 with
862
+ Fiat–Shamir, matching `poksho`'s protocol label
863
+ `POKSHO_Ristretto_SHOHMACSHA256` exactly, and the Chase–Perrin–Zaverucha algebraic
864
+ MAC credential system matching `zkcredential`'s five domain labels byte for byte.
865
+ The Lizard encoding, `UidStruct` derivation, `AuthCredentialWithPni` flow, and
866
+ redemption window all match `libsignal`. The strongest evidence is a test that
867
+ asserts the 416-byte serialized system parameters against a hex string taken from
868
+ `libsignal`'s own Rust test, and passes.
869
+
870
+ One deviation: server secret parameters are derived as four separately labelled
871
+ key derivations rather than `libsignal`'s single seeded derivation
872
+ (`internal/protocol/zk/groups/server-params.ts:43-54`), so the same randomness
873
+ would yield different server keys. Independently of that structural difference,
874
+ each deployment generates its **own** random 32-byte seed, which is what makes
875
+ the trust root the deploying operator's rather than Signal Messenger's.
876
+ Credentials are not interchangeable with Signal Messenger's.
877
+
878
+ Credential serialization is also ad hoc and carries no version byte, where
879
+ `libsignal` uses a leading version byte. That is a forward-compatibility gap
880
+ rather than a security one.
881
+
882
+ ---
883
+
884
+ ## Unverified and needs review
885
+
886
+ Listed rather than asserted, because these could not be confirmed in source
887
+ within this review.
888
+
889
+ - **Whether a sealed-sender-wrapped prekey message decrypts end to end.** The
890
+ unseal path reconstructs the envelope with a fixed message type
891
+ (`client/sealed-sender-ops.ts:263-265`), and an adjacent comment suggests the
892
+ Sesame layer re-derives the initiation state from the ciphertext. That path was
893
+ not traced and the integration tests were not executed. If Sesame does not
894
+ self-detect, first-contact sealed messages would be affected.
895
+ - **Whether the session-identity-key check the sealed-sender note requires is
896
+ enforced downstream.** The decrypt path compares the certificate's identity key
897
+ against the decrypted static key but does not consult the session store. In
898
+ `libsignal` the equivalent guarantee arrives later via the identity store.
899
+ - **Whether `@noble/post-quantum`'s ML-KEM-1024 is byte-identical to libcrux's.**
900
+ The repository claims pinned known-answer-test coverage; those tests were not
901
+ executed as part of this review.
902
+ - **Lizard encoding correctness against `libsignal`'s vectors.** The forward and
903
+ inverse Elligator maps are hand-implemented in TypeScript. Structure and labels
904
+ are correct and unit tests exist, but the outputs were not diffed against
905
+ `libsignal`'s. A subtle error here would silently corrupt every `UidStruct`.
906
+ - **SPQR state-machine transition equivalence.** State names, message types, and
907
+ chunk counts match `libsignal`'s; the eleven-state transition table was not diffed
908
+ transition by transition.
909
+ - **Whether the SPQR decoder enforces a bound on stored points.** `libsignal` caps
910
+ stored points per polynomial; no equivalent bound was located in the SDK's
911
+ decoder.
912
+ - **Whether SPQR state mutations are rolled back when message authentication
913
+ fails.** `libsignal` commits the new state only after the MAC and decryption
914
+ succeed; the SDK's receive path mutates state during decode, and the caller's
915
+ rollback behaviour was not traced.
916
+ - **Whether an equivalent of `libsignal`'s `promote_matching_session` exists.**
917
+ `libsignal` matches archived sessions on `(version, base key)`; the SDK's map is
918
+ keyed on base key alone.
919
+
920
+ ---
921
+
922
+ ## Reporting an error in this document
923
+
924
+ If something here is wrong — a citation that does not say what it is claimed to
925
+ say, a deviation that has since been fixed, or a deviation that is missing —
926
+ email security@open-e2ee.dev or open an issue. A deviations document that has
927
+ drifted from the code is worse than none, because it invites exactly the
928
+ assumption it exists to prevent.
929
+
930
+ [ik]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/identity_key.rs
931
+ [fp]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/fingerprint.rs
932
+ [sess]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/session.rs
933
+ [pq]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/pqxdh.rs
934
+ [rat]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/ratchet.rs
935
+ [rk]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/ratchet/keys.rs
936
+ [dr]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/double_ratchet.rs
937
+ [proto]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/protocol.rs
938
+ [wp]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/proto/wire.proto
939
+ [consts]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/consts.rs
940
+ [st]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/state/session.rs
941
+ [ss]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/sealed_sender.rs
942
+ [sk]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/sender_keys.rs
943
+ [tr]: https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/triple_ratchet.rs
944
+ [xeddsa]: https://signal.org/docs/specifications/xeddsa/