@open-e2ee/signal-protocol-sdk 0.1.0-alpha.4 → 0.1.0-alpha.6
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.
- package/ADAPTERS.md +15 -15
- package/CHANGELOG.md +109 -0
- package/README.md +4 -2
- package/blocking/README.md +5 -5
- package/client/README.md +2 -2
- package/dist/blocking/index.d.ts +2 -2
- package/dist/blocking/index.d.ts.map +1 -1
- package/dist/blocking/index.js +1 -1
- package/dist/blocking/index.js.map +1 -1
- package/dist/blocking/manager.d.ts +7 -7
- package/dist/blocking/manager.d.ts.map +1 -1
- package/dist/blocking/manager.js +3 -3
- package/dist/blocking/manager.js.map +1 -1
- package/dist/blocking/types.d.ts +4 -4
- package/dist/blocking/types.d.ts.map +1 -1
- package/dist/blocking/types.js +1 -1
- package/dist/client/client.d.ts +3 -3
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +11 -11
- package/dist/client/client.js.map +1 -1
- package/dist/client/compose.d.ts +7 -7
- package/dist/client/compose.d.ts.map +1 -1
- package/dist/client/config.d.ts +15 -15
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/content-adapter.d.ts +4 -4
- package/dist/client/content-adapter.d.ts.map +1 -1
- package/dist/client/content-adapter.js +1 -1
- package/dist/client/content-adapter.js.map +1 -1
- package/dist/client/dual-store.d.ts +5 -5
- package/dist/client/dual-store.d.ts.map +1 -1
- package/dist/client/dual-store.js.map +1 -1
- package/dist/client/endorsement-manager.d.ts.map +1 -1
- package/dist/client/endorsement-manager.js +2 -2
- package/dist/client/endorsement-manager.js.map +1 -1
- package/dist/client/event-hooks.d.ts +1 -1
- package/dist/client/headless.d.ts +11 -11
- package/dist/client/headless.d.ts.map +1 -1
- package/dist/client/headless.js +8 -8
- package/dist/client/headless.js.map +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/key-rotation-core.d.ts +11 -11
- package/dist/client/key-rotation-core.d.ts.map +1 -1
- package/dist/client/key-rotation-core.js +22 -22
- package/dist/client/key-rotation-core.js.map +1 -1
- package/dist/client/media.d.ts +2 -2
- package/dist/client/media.js +5 -5
- package/dist/client/media.js.map +1 -1
- package/dist/client/messages.js +2 -2
- package/dist/client/messages.js.map +1 -1
- package/dist/client/relay-subscription.d.ts +2 -2
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +18 -1
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/retry.js +1 -1
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sealed-sender-ops.d.ts +1 -1
- package/dist/client/sealed-sender-ops.d.ts.map +1 -1
- package/dist/client/sealed-sender-ops.js +4 -4
- package/dist/client/sealed-sender-ops.js.map +1 -1
- package/dist/client/sessions.d.ts.map +1 -1
- package/dist/client/sessions.js +3 -0
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +14 -10
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +31 -23
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/types.d.ts +8 -8
- package/dist/client/types.d.ts.map +1 -1
- package/dist/device/connection.js +2 -2
- package/dist/device/connection.js.map +1 -1
- package/dist/device/device-id.d.ts.map +1 -1
- package/dist/device/device-id.js +4 -4
- package/dist/device/device-id.js.map +1 -1
- package/dist/device/provisioning.d.ts +5 -5
- package/dist/device/provisioning.d.ts.map +1 -1
- package/dist/device/provisioning.js +9 -9
- package/dist/device/provisioning.js.map +1 -1
- package/dist/device/transfer.d.ts.map +1 -1
- package/dist/device/transfer.js +14 -14
- package/dist/device/transfer.js.map +1 -1
- package/dist/files/index.d.ts +1 -1
- package/dist/files/index.js +1 -1
- package/dist/hooks/use-connection-presence.d.ts +5 -5
- package/dist/hooks/use-connection-presence.d.ts.map +1 -1
- package/dist/hooks/use-connection-presence.js +5 -5
- package/dist/hooks/use-connection-presence.js.map +1 -1
- package/dist/hooks/use-group-membership.d.ts +2 -2
- package/dist/hooks/use-key-rotation.js +2 -2
- package/dist/hooks/use-key-rotation.js.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.js +4 -4
- package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
- package/dist/internal/crypto/index.js +1 -1
- package/dist/internal/crypto/index.js.map +1 -1
- package/dist/internal/crypto/kdf/hkdf.d.ts +1 -1
- package/dist/internal/crypto/kdf/hkdf.d.ts.map +1 -1
- package/dist/internal/crypto/kdf/hkdf.js +2 -2
- package/dist/internal/crypto/kdf/hkdf.js.map +1 -1
- package/dist/internal/crypto/key-prefix.d.ts +1 -1
- package/dist/internal/crypto/key-prefix.js +1 -1
- package/dist/internal/crypto/pq/kyber.d.ts +1 -1
- package/dist/internal/crypto/pq/kyber.js +1 -1
- package/dist/internal/crypto/symmetric/aes-gcm-siv.d.ts +1 -1
- package/dist/internal/crypto/symmetric/aes-gcm-siv.js +1 -1
- package/dist/internal/crypto/symmetric/mac.d.ts +3 -3
- package/dist/internal/crypto/symmetric/mac.js +3 -3
- package/dist/internal/crypto/utils.d.ts +2 -2
- package/dist/internal/crypto/utils.js +2 -2
- package/dist/internal/encoding/proto/envelope.d.ts +21 -21
- package/dist/internal/encoding/proto/envelope.d.ts.map +1 -1
- package/dist/internal/encoding/proto/envelope.js +25 -25
- package/dist/internal/encoding/proto/envelope.js.map +1 -1
- package/dist/internal/encoding/proto/index.d.ts +2 -2
- package/dist/internal/encoding/proto/index.d.ts.map +1 -1
- package/dist/internal/encoding/proto/index.js +3 -3
- package/dist/internal/encoding/proto/index.js.map +1 -1
- package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts +5 -5
- package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts.map +1 -1
- package/dist/internal/encoding/proto/pq-ratchet-serialize.js +4 -4
- package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -1
- package/dist/internal/encoding/proto/signal-message.d.ts +33 -33
- package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
- package/dist/internal/encoding/proto/signal-message.js +58 -58
- package/dist/internal/encoding/proto/signal-message.js.map +1 -1
- package/dist/internal/groups/group-id.d.ts +1 -1
- package/dist/internal/groups/group-id.js +1 -1
- package/dist/internal/groups/group-id.js.map +1 -1
- package/dist/internal/groups-v2/access-control.d.ts +8 -1
- package/dist/internal/groups-v2/access-control.d.ts.map +1 -1
- package/dist/internal/groups-v2/access-control.js +8 -1
- package/dist/internal/groups-v2/access-control.js.map +1 -1
- package/dist/internal/groups-v2/change-actions.d.ts +8 -3
- package/dist/internal/groups-v2/change-actions.d.ts.map +1 -1
- package/dist/internal/groups-v2/change-actions.js +8 -3
- package/dist/internal/groups-v2/change-actions.js.map +1 -1
- package/dist/internal/groups-v2/index.d.ts +7 -2
- package/dist/internal/groups-v2/index.d.ts.map +1 -1
- package/dist/internal/groups-v2/index.js.map +1 -1
- package/dist/internal/groups-v2/manager.d.ts +4 -2
- package/dist/internal/groups-v2/manager.d.ts.map +1 -1
- package/dist/internal/groups-v2/manager.js +5 -3
- package/dist/internal/groups-v2/manager.js.map +1 -1
- package/dist/internal/groups-v2/types.d.ts +10 -3
- package/dist/internal/groups-v2/types.d.ts.map +1 -1
- package/dist/internal/groups-v2/types.js.map +1 -1
- package/dist/internal/manager/manager.d.ts +3 -3
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +28 -17
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.d.ts +1 -1
- package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.js +10 -10
- package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +3 -3
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.js +3 -3
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js +3 -3
- package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/decryption.js +2 -2
- package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.d.ts +1 -1
- package/dist/internal/protocol/sealed-sender/types.js +1 -1
- package/dist/internal/protocol/sender-keys/index.d.ts +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts +4 -4
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +5 -5
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/spqr/index.d.ts +1 -1
- package/dist/internal/protocol/spqr/index.js +1 -1
- package/dist/internal/protocol/spqr/message.d.ts +1 -1
- package/dist/internal/protocol/spqr/message.js +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.js +2 -2
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.d.ts +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.js +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +5 -5
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts +10 -10
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.js +14 -14
- package/dist/internal/protocol/spqr/spqr.js.map +1 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +3 -3
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.js +5 -5
- package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/username/generate.d.ts +1 -1
- package/dist/internal/protocol/username/generate.js +1 -1
- package/dist/internal/protocol/username/hash.d.ts +1 -1
- package/dist/internal/protocol/username/hash.js +1 -1
- package/dist/internal/protocol/username/link.d.ts +1 -1
- package/dist/internal/protocol/username/link.js +1 -1
- package/dist/internal/protocol/username/proof.d.ts +1 -1
- package/dist/internal/protocol/username/proof.js +1 -1
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
- package/dist/internal/protocol/x3dh/x3dh.js +6 -6
- package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
- package/dist/internal/protocol/zk/groups/client-zk-group-cipher.d.ts +2 -2
- package/dist/internal/protocol/zk/groups/client-zk-group-cipher.js +2 -2
- package/dist/internal/sesame/device-registry.d.ts +18 -13
- package/dist/internal/sesame/device-registry.d.ts.map +1 -1
- package/dist/internal/sesame/device-registry.js +13 -9
- package/dist/internal/sesame/device-registry.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +1 -1
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +16 -16
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/session/builder.js +3 -3
- package/dist/internal/session/builder.js.map +1 -1
- package/dist/internal/session/cipher.d.ts +2 -2
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js +30 -30
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/internal/session/decryption.d.ts +1 -1
- package/dist/internal/session/decryption.js +10 -10
- package/dist/internal/session/decryption.js.map +1 -1
- package/dist/internal/session/factory.d.ts.map +1 -1
- package/dist/internal/session/factory.js +3 -3
- package/dist/internal/session/factory.js.map +1 -1
- package/dist/internal/session/handshake.d.ts.map +1 -1
- package/dist/internal/session/handshake.js +3 -3
- package/dist/internal/session/handshake.js.map +1 -1
- package/dist/internal/session/keys.d.ts +1 -1
- package/dist/internal/session/ratchet.d.ts.map +1 -1
- package/dist/internal/session/ratchet.js +4 -4
- package/dist/internal/session/ratchet.js.map +1 -1
- package/dist/internal/session/types.d.ts +2 -2
- package/dist/internal/session/types.d.ts.map +1 -1
- package/dist/internal/session/validation.d.ts.map +1 -1
- package/dist/internal/session/validation.js +3 -3
- package/dist/internal/session/validation.js.map +1 -1
- package/dist/keys/generation.d.ts +1 -1
- package/dist/keys/generation.js +1 -1
- package/dist/keys/types.d.ts +1 -1
- package/dist/keys/types.d.ts.map +1 -1
- package/dist/layers.d.ts +2 -2
- package/dist/layers.d.ts.map +1 -1
- package/dist/layers.js +4 -4
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts +11 -11
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +9 -9
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/database-key.d.ts +2 -2
- package/dist/local/store/expo/database-key.d.ts.map +1 -1
- package/dist/local/store/expo/database-key.js +5 -5
- package/dist/local/store/expo/database-key.js.map +1 -1
- package/dist/local/store/expo/db.d.ts +9 -9
- package/dist/local/store/expo/db.d.ts.map +1 -1
- package/dist/local/store/expo/db.js +3 -3
- package/dist/local/store/expo/db.js.map +1 -1
- package/dist/local/store/expo/index.d.ts +7 -7
- package/dist/local/store/expo/index.d.ts.map +1 -1
- package/dist/local/store/expo/index.js +3 -3
- package/dist/local/store/expo/index.js.map +1 -1
- package/dist/local/store/expo/key-storage.d.ts +1 -1
- package/dist/local/store/expo/key-storage.d.ts.map +1 -1
- package/dist/local/store/expo/key-storage.js +4 -4
- package/dist/local/store/expo/key-storage.js.map +1 -1
- package/dist/local/store/expo/models/local-identity.d.ts +1 -1
- package/dist/local/store/expo/models/local-identity.js +1 -1
- package/dist/local/store/expo/models/sender-key.d.ts +3 -3
- package/dist/local/store/expo/models/sender-key.d.ts.map +1 -1
- package/dist/local/store/expo/models/sender-key.js +3 -3
- package/dist/local/store/expo/models/sender-key.js.map +1 -1
- package/dist/local/store/expo/schema.d.ts +1 -1
- package/dist/local/store/expo/schema.js +1 -1
- package/dist/local/store/expo/secure-store-options.d.ts +2 -2
- package/dist/local/store/expo/secure-store-options.d.ts.map +1 -1
- package/dist/local/store/expo/secure-store-options.js +1 -1
- package/dist/local/store/expo/secure-store-options.js.map +1 -1
- package/dist/local/store/index.d.ts +9 -9
- package/dist/local/store/index.d.ts.map +1 -1
- package/dist/local/store/index.js +8 -8
- package/dist/local/store/index.js.map +1 -1
- package/dist/local/store/mock/adapter.d.ts +10 -4
- package/dist/local/store/mock/adapter.d.ts.map +1 -1
- package/dist/local/store/mock/adapter.js +119 -49
- package/dist/local/store/mock/adapter.js.map +1 -1
- package/dist/local/store/mock/failures.d.ts +34 -0
- package/dist/local/store/mock/failures.d.ts.map +1 -0
- package/dist/local/store/mock/failures.js +75 -0
- package/dist/local/store/mock/failures.js.map +1 -0
- package/dist/local/store/mock/index.d.ts +4 -3
- package/dist/local/store/mock/index.d.ts.map +1 -1
- package/dist/local/store/mock/index.js +5 -4
- package/dist/local/store/mock/index.js.map +1 -1
- package/dist/local/store/node/adapter.d.ts +4 -4
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/adapter.js +2 -2
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/node/database-key.js +1 -1
- package/dist/local/store/node/database.d.ts.map +1 -1
- package/dist/local/store/node/database.js +2 -2
- package/dist/local/store/node/database.js.map +1 -1
- package/dist/local/store/node/index.d.ts +4 -4
- package/dist/local/store/node/index.d.ts.map +1 -1
- package/dist/local/store/node/index.js +3 -3
- package/dist/local/store/node/index.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts +5 -5
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +14 -14
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/react-native/index.d.ts +4 -4
- package/dist/local/store/react-native/index.d.ts.map +1 -1
- package/dist/local/store/react-native/index.js +3 -3
- package/dist/local/store/react-native/index.js.map +1 -1
- package/dist/local/store/react-native/storage.d.ts +2 -2
- package/dist/local/store/web/adapter.d.ts +4 -4
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +21 -9
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/store/web/index.d.ts +4 -4
- package/dist/local/store/web/index.d.ts.map +1 -1
- package/dist/local/store/web/index.js +3 -3
- package/dist/local/store/web/index.js.map +1 -1
- package/dist/local/vault/expo-secure-store.d.ts +2 -2
- package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
- package/dist/local/vault/expo-secure-store.js +5 -5
- package/dist/local/vault/expo-secure-store.js.map +1 -1
- package/dist/local/vault/index.d.ts +3 -3
- package/dist/local/vault/index.d.ts.map +1 -1
- package/dist/local/vault/index.js +1 -1
- package/dist/local/vault/index.js.map +1 -1
- package/dist/logger.d.ts +4 -4
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +5 -5
- package/dist/logger.js.map +1 -1
- package/dist/media/index.d.ts +7 -7
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +2 -2
- package/dist/profile/cipher.d.ts +1 -1
- package/dist/profile/cipher.js +1 -1
- package/dist/profile/contact-state.d.ts +1 -1
- package/dist/profile/contact-state.d.ts.map +1 -1
- package/dist/profile/contact-state.js +3 -3
- package/dist/profile/contact-state.js.map +1 -1
- package/dist/profile/crypto.d.ts +1 -1
- package/dist/profile/crypto.js +1 -1
- package/dist/profile/profile-key.d.ts.map +1 -1
- package/dist/profile/profile-key.js +3 -3
- package/dist/profile/profile-key.js.map +1 -1
- package/dist/profile/update-service.d.ts +2 -2
- package/dist/profile/update-service.d.ts.map +1 -1
- package/dist/profile/update-service.js +2 -2
- package/dist/profile/update-service.js.map +1 -1
- package/dist/remote/object-store/convex-r2/server.d.ts +1 -1
- package/dist/remote/object-store/convex-r2/storage.d.ts +2 -2
- package/dist/remote/object-store/convex-r2/storage.d.ts.map +1 -1
- package/dist/remote/object-store/index.d.ts +1 -1
- package/dist/remote/object-store/index.d.ts.map +1 -1
- package/dist/remote/object-store/s3/storage.d.ts +3 -3
- package/dist/remote/object-store/s3/storage.d.ts.map +1 -1
- package/dist/remote/object-store/s3/storage.js +1 -1
- package/dist/remote/object-store/types.d.ts +1 -1
- package/dist/remote/object-store/types.d.ts.map +1 -1
- package/dist/remote/relay/convex/index.d.ts +10 -10
- package/dist/remote/relay/convex/index.d.ts.map +1 -1
- package/dist/remote/relay/convex/index.js +6 -6
- package/dist/remote/relay/convex/index.js.map +1 -1
- package/dist/remote/relay/convex/relay.d.ts +13 -13
- package/dist/remote/relay/convex/relay.d.ts.map +1 -1
- package/dist/remote/relay/convex/relay.js +12 -12
- package/dist/remote/relay/convex/relay.js.map +1 -1
- package/dist/remote/relay/convex/types.d.ts +7 -7
- package/dist/remote/relay/convex/types.js +1 -1
- package/dist/remote/relay/index.d.ts +7 -7
- package/dist/remote/relay/index.d.ts.map +1 -1
- package/dist/remote/relay/index.js +6 -6
- package/dist/remote/relay/index.js.map +1 -1
- package/dist/remote/relay/mock/adapter.d.ts +17 -6
- package/dist/remote/relay/mock/adapter.d.ts.map +1 -1
- package/dist/remote/relay/mock/adapter.js +173 -54
- package/dist/remote/relay/mock/adapter.js.map +1 -1
- package/dist/remote/relay/mock/failures.d.ts +58 -0
- package/dist/remote/relay/mock/failures.d.ts.map +1 -0
- package/dist/remote/relay/mock/failures.js +123 -0
- package/dist/remote/relay/mock/failures.js.map +1 -0
- package/dist/remote/relay/mock/index.d.ts +4 -3
- package/dist/remote/relay/mock/index.d.ts.map +1 -1
- package/dist/remote/relay/mock/index.js +5 -4
- package/dist/remote/relay/mock/index.js.map +1 -1
- package/dist/remote/relay/types.d.ts +12 -12
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/remote/relay/types.js +3 -3
- package/dist/safety/protobuf.d.ts +1 -1
- package/dist/safety/protobuf.d.ts.map +1 -1
- package/dist/types/api.d.ts +8 -8
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +2 -2
- package/dist/types/errors.js.map +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/protocol-config.d.ts +20 -4
- package/dist/types/protocol-config.d.ts.map +1 -1
- package/dist/types/protocol-config.js +17 -2
- package/dist/types/protocol-config.js.map +1 -1
- package/dist/types/protocol-constants.d.ts +1 -1
- package/dist/types/protocol-constants.js +1 -1
- package/dist/utils/binary-transfer.d.ts +1 -1
- package/dist/utils/errors.d.ts +2 -2
- package/dist/utils/errors.js +2 -2
- package/dist/utils/retry.d.ts +4 -3
- package/dist/utils/retry.d.ts.map +1 -1
- package/dist/utils/retry.js +20 -1
- package/dist/utils/retry.js.map +1 -1
- package/dist/zk/groups.d.ts +1 -1
- package/dist/zk/groups.js +1 -1
- package/docs/CLIENT_COMPOSITION.md +7 -5
- package/docs/DEVIATIONS.md +97 -80
- package/docs/GETTING_STARTED.md +12 -8
- package/docs/INTERFACES.md +22 -22
- package/docs/PACKAGE_SURFACE.md +12 -12
- package/docs/PROTOCOL_POLICY.md +2 -2
- package/docs/RECIPES.md +6 -2
- package/docs/api/classes/EndorsementManager.md +1 -1
- package/docs/api/classes/{SignalBlockingManager.md → SignalProtocolBlockingManager.md} +5 -5
- package/docs/api/classes/SignalProtocolClient.md +4 -4
- package/docs/api/functions/createDefaultSignalProtocolContentAdapter.md +13 -0
- package/docs/api/functions/{createDefaultSignalLogger.md → createDefaultSignalProtocolLogger.md} +5 -5
- package/docs/api/functions/{resolveSignalLogger.md → resolveSignalProtocolLogger.md} +5 -5
- package/docs/api/interfaces/BlockedRecipientEntry.md +1 -1
- package/docs/api/interfaces/ILogger.md +1 -1
- package/docs/api/interfaces/IProtocolStore.md +1 -1
- package/docs/api/interfaces/ISenderKeyStore.md +1 -1
- package/docs/api/interfaces/ISesameStore.md +1 -1
- package/docs/api/interfaces/ISignalProtocolClient.md +2 -2
- package/docs/api/interfaces/{ISignalLocalSecretVault.md → ISignalProtocolLocalSecretVault.md} +4 -4
- package/docs/api/interfaces/{ISignalLocalStore.md → ISignalProtocolLocalStore.md} +4 -4
- package/docs/api/interfaces/{ISignalRelayServer.md → ISignalProtocolRelayServer.md} +3 -3
- package/docs/api/interfaces/{InspectedSignalContent.md → InspectedSignalProtocolContent.md} +2 -2
- package/docs/api/interfaces/MLKEMBraidAgentState.md +1 -1
- package/docs/api/interfaces/MessageHeader.md +1 -1
- package/docs/api/interfaces/PreKeyMaintenanceStore.md +2 -1
- package/docs/api/interfaces/SealedSenderConfig.md +1 -1
- package/docs/api/interfaces/{SignalBlockingHooks.md → SignalProtocolBlockingHooks.md} +2 -2
- package/docs/api/interfaces/SignalProtocolBlockingManagerOptions.md +31 -0
- package/docs/api/interfaces/{SignalBlockingMirror.md → SignalProtocolBlockingMirror.md} +2 -2
- package/docs/api/interfaces/{SignalBlockingStore.md → SignalProtocolBlockingStore.md} +2 -2
- package/docs/api/interfaces/SignalProtocolClientAdapterConfig.md +3 -3
- package/docs/api/interfaces/SignalProtocolClientCompositionOptions.md +2 -2
- package/docs/api/interfaces/SignalProtocolClientConfig.md +10 -10
- package/docs/api/interfaces/SignalProtocolClientHooks.md +1 -1
- package/docs/api/interfaces/SignalProtocolClientIdentityConfig.md +1 -1
- package/docs/api/interfaces/SignalProtocolClientMediaConfig.md +2 -2
- package/docs/api/interfaces/SignalProtocolConfig.md +1 -1
- package/docs/api/interfaces/{SignalContentAdapter.md → SignalProtocolContentAdapter.md} +4 -4
- package/docs/api/interfaces/{SignalRemoteObjectStore.md → SignalProtocolRemoteObjectStore.md} +2 -2
- package/docs/api/namespaces/blocking/README.md +10 -10
- package/docs/api/namespaces/encoding/functions/bytesToUrlSafeBase64.md +2 -2
- package/docs/api/namespaces/keys/functions/generateKemOneTimePreKeys.md +1 -1
- package/docs/api/namespaces/media/functions/prepareMediaAttachmentUpload.md +1 -1
- package/docs/api/namespaces/media/functions/resolveMediaAttachment.md +1 -1
- package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentOptions.md +1 -1
- package/docs/api/namespaces/media/interfaces/ExecuteMediaAttachmentJobOptions.md +1 -1
- package/docs/api/namespaces/media/interfaces/PrepareMediaAttachmentUploadOptions.md +1 -1
- package/docs/api/namespaces/media/interfaces/ResolveMediaAttachmentOptions.md +1 -1
- package/docs/api/namespaces/media/variables/downloadMediaAttachment.md +1 -1
- package/docs/api/type-aliases/GroupId.md +1 -1
- package/docs/api/variables/MAX_RECEIVER_CHAINS.md +1 -1
- package/docs/api/variables/ONE_TIME_PREKEY_BATCH_SIZE.md +1 -1
- package/docs/api/variables/{defaultSignalLogger.md → defaultSignalProtocolLogger.md} +5 -5
- package/files/README.md +1 -1
- package/local/store/README.md +10 -10
- package/local/store/expo/README.md +5 -5
- package/local/store/mock/README.md +32 -1
- package/local/store/node/README.md +1 -1
- package/local/store/react-native/README.md +1 -1
- package/local/store/web/README.md +1 -1
- package/local/vault/README.md +3 -3
- package/package.json +1 -1
- package/remote/README.md +19 -19
- package/remote/object-store/README.md +3 -3
- package/remote/object-store/convex-r2/README.md +1 -1
- package/remote/object-store/s3/README.md +1 -1
- package/remote/relay/README.md +2 -2
- package/remote/relay/convex/README.md +4 -4
- package/remote/relay/mock/README.md +38 -1
- package/types/README.md +1 -1
- package/docs/api/functions/createDefaultSignalContentAdapter.md +0 -13
- package/docs/api/interfaces/SignalBlockingManagerOptions.md +0 -31
package/docs/DEVIATIONS.md
CHANGED
|
@@ -9,24 +9,24 @@
|
|
|
9
9
|
This SDK implements the same cryptographic core as the published Signal Protocol
|
|
10
10
|
specifications — X3DH/PQXDH key agreement, the Double Ratchet, the ML-KEM Braid
|
|
11
11
|
post-quantum ratchet, Sesame multi-device session management, sealed sender, and
|
|
12
|
-
Signal's zero-knowledge group credential system. In many places it is faithful
|
|
12
|
+
the Signal Protocol's zero-knowledge group credential system. In many places it is faithful
|
|
13
13
|
down to the byte: the same KDF labels, the same chain-key constants, the same
|
|
14
14
|
protobuf field numbers, the same iteration counts.
|
|
15
15
|
|
|
16
16
|
It is **not wire-compatible with Signal Messenger or with `libsignal`**, and it
|
|
17
17
|
is not intended to be. Messages produced by this SDK cannot be decrypted by a
|
|
18
|
-
Signal client, identities cannot be exchanged, safety numbers computed here
|
|
19
|
-
cannot be compared against safety numbers shown in Signal, and sessions cannot be
|
|
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
20
|
migrated in either direction. This is a distinct wire profile —
|
|
21
|
-
`IndependentProfileV1` — that shares Signal's cryptographic design and
|
|
21
|
+
`IndependentProfileV1` — that shares the Signal Protocol's cryptographic design and
|
|
22
22
|
deliberately does not share its encoding.
|
|
23
23
|
|
|
24
24
|
That distinction matters in a specific way. Reading "implements X3DH and the
|
|
25
25
|
Double Ratchet" reasonably leads someone to expect interoperability. There is
|
|
26
|
-
none. Reading "
|
|
27
|
-
expect that a user could verify a contact by comparing a number
|
|
28
|
-
against the same contact's number in Signal. They
|
|
29
|
-
computed over different inputs and will never match.
|
|
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
30
|
|
|
31
31
|
This document is the complete, honest account of where and why the profile
|
|
32
32
|
differs. Each entry names the implementing file, the specification section or
|
|
@@ -39,8 +39,8 @@ Deviations fall into three kinds:
|
|
|
39
39
|
- **Deviation** — does something different from the specification or from
|
|
40
40
|
`libsignal`, deliberately.
|
|
41
41
|
- **Extension** — adds a mechanism the specification does not describe.
|
|
42
|
-
- **Independent design** — shares a name and a goal with a Signal system, but is
|
|
43
|
-
the SDK's own construction rather than a port of
|
|
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
44
|
|
|
45
45
|
A fourth label, **faithful**, appears in the table where an area follows the
|
|
46
46
|
specification closely enough that its presence in this document is only to
|
|
@@ -58,23 +58,23 @@ model and what is out of scope.
|
|
|
58
58
|
| Area | Specification followed | Deviation or extension | Why | Consequence |
|
|
59
59
|
|---|---|---|---|---|
|
|
60
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 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'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,
|
|
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
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
|
|
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 ACIs | Wire-incompatible; a Signal client would silently ignore the added fields |
|
|
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
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'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
|
|
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
|
|
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
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
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 | The slice order and the missing prefix are unintentional; the envelope is a deliberate simplification | Self-consistent and secure, but every v1 key sits in a different slot than `libsignal`'s. The envelope also drops the message-type field |
|
|
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
|
|
74
|
-
| **Delivery token** | `libsignal` `profile_key.rs` | **Faithful.** `deriveAccessKey`
|
|
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
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 v2** | Signal Private Group System | **Independent design.** Real zkgroup primitives underneath, but the client is the state authority: it re-encrypts and uploads whole group state, and server signatures are not verified | Ships a working group system without a validating server | The relay **cannot validate group changes**, so it cannot enforce roles or membership. This is a materially weaker trust model than Signal
|
|
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 uses SDK-specific labels | Server keys are the SDK's own trust root, not Signal's | The zero-knowledge properties are real. Credentials are not interchangeable with Signal's |
|
|
76
|
+
| **Groups v2** | Signal Private Group System | **Independent design.** Real zkgroup primitives underneath, but the client is the state authority: it re-encrypts and uploads whole group state, and server signatures are not verified | Ships a working group system without a validating server | The relay **cannot validate group changes**, so it cannot enforce roles or membership. This is a materially weaker trust model than the Signal Private Group System, where the server validates every change against zero-knowledge presentations |
|
|
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 uses SDK-specific labels | Server keys are the SDK's own trust root, not Signal Messenger's | The zero-knowledge properties are real. Credentials are not interchangeable with Signal Messenger's |
|
|
78
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
79
|
|
|
80
80
|
---
|
|
@@ -157,7 +157,7 @@ or which identity it belongs to. Binding all three defeats cross-algorithm
|
|
|
157
157
|
substitution (presenting an X25519 signature as an ML-KEM one) and cross-key-ID
|
|
158
158
|
substitution. This is strictly stronger than the specification requires.
|
|
159
159
|
|
|
160
|
-
**Cost.** Wire incompatibility, and a signature format that no Signal
|
|
160
|
+
**Cost.** Wire incompatibility, and a signature format that no Signal Messenger
|
|
161
161
|
implementation can verify.
|
|
162
162
|
|
|
163
163
|
The same Ed25519-instead-of-XEdDSA choice applies to sealed sender certificates
|
|
@@ -169,10 +169,10 @@ this codebase. Where the frozen upstream specification snapshots mention them,
|
|
|
169
169
|
that is upstream text; the SDK's own documentation consistently states that
|
|
170
170
|
ordinary Ed25519 is used instead.
|
|
171
171
|
|
|
172
|
-
### 1.3 Safety numbers are not comparable to Signal's
|
|
172
|
+
### 1.3 Safety numbers are not comparable to Signal Messenger's
|
|
173
173
|
|
|
174
174
|
State this without hedging: **a safety number produced by this SDK will never
|
|
175
|
-
match the safety number Signal shows for the same two users.** A user cannot
|
|
175
|
+
match the safety number Signal Messenger shows for the same two users.** A user cannot
|
|
176
176
|
verify a contact by reading a number out of one application and comparing it
|
|
177
177
|
against the other.
|
|
178
178
|
|
|
@@ -193,7 +193,7 @@ SDK's low-level single-key path, which is otherwise byte-identical to
|
|
|
193
193
|
`libsignal`. The SDK orders by user identifier — `localId.localeCompare(remoteId)`
|
|
194
194
|
(`safety/core.ts:177`) — where `libsignal` orders by the encoded digit strings
|
|
195
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, and
|
|
196
|
+
parties always agree with each other; they simply do not agree with Signal Messenger, and
|
|
197
197
|
roughly half the time the halves come out in the opposite order. `localeCompare`
|
|
198
198
|
is additionally locale-sensitive, so two devices with different default locales
|
|
199
199
|
can in principle disagree with each other on the ordering of the same pair of
|
|
@@ -209,7 +209,7 @@ cross-verification swap and constant-time comparison match as well.
|
|
|
209
209
|
The QR format version is the SDK's own: `3` for the composite path
|
|
210
210
|
(`safety/core.ts:46`), where `libsignal` knows only versions 1 and 2 and returns
|
|
211
211
|
`VersionMismatch` for anything else. Using a distinct version in the same
|
|
212
|
-
protobuf namespace is the correct fail-closed choice — a Signal client rejects
|
|
212
|
+
protobuf namespace is the correct fail-closed choice — a Signal Messenger client rejects
|
|
213
213
|
the code rather than misreading it.
|
|
214
214
|
|
|
215
215
|
The SDK also offers an emoji fingerprint (`safety/core.ts:308-392`) and
|
|
@@ -223,7 +223,7 @@ number and should not be presented to users as an equal-strength alternative.
|
|
|
223
223
|
Registration IDs are generated in the closed range `[1, 16383]`
|
|
224
224
|
(`keys/generation.ts:43-46`). The wire format reserves exactly 14 bits, and
|
|
225
225
|
`libsignal` rejects any ID where `id & 0x3FFF != id`
|
|
226
|
-
([`sealed_sender.rs:1508-1515`][ss]);
|
|
226
|
+
([`sealed_sender.rs:1508-1515`][ss]); `libsignal`'s own helper generates `[1, 16380]`.
|
|
227
227
|
|
|
228
228
|
Through 0.1.0-alpha.3 the range was `[1, 16384]`, an off-by-one: 16384 is
|
|
229
229
|
`0x4000` and does not fit in 14 bits, and the SDK's multi-recipient sealed sender
|
|
@@ -259,33 +259,49 @@ remote X25519 point is validated before any DH is computed
|
|
|
259
259
|
far more strictly than `libsignal` requires
|
|
260
260
|
(`internal/session/handshake.ts:107-138`).
|
|
261
261
|
|
|
262
|
-
### 2.1
|
|
262
|
+
### 2.1 The info strings name this application and this KEM
|
|
263
263
|
|
|
264
264
|
The SDK uses ML-KEM-1024 (FIPS 203) where `libsignal` uses round-3 Kyber1024,
|
|
265
265
|
tagged `0x0A` rather than `0x08` (`internal/crypto/pq/kyber.ts:79`). That much is
|
|
266
266
|
deliberate: the standardized algorithm is preferred over the round-3 draft, and a
|
|
267
267
|
single unambiguous tag is preferred over carrying a legacy fallback.
|
|
268
268
|
|
|
269
|
-
The info
|
|
269
|
+
The info strings are the SDK's own (`types/protocol-config.ts:363-386`):
|
|
270
270
|
|
|
271
271
|
```text
|
|
272
|
-
|
|
272
|
+
OpenE2EE_X25519_SHA-256_ML-KEM-1024 (PQXDH)
|
|
273
|
+
OpenE2EE (X3DH)
|
|
273
274
|
```
|
|
274
275
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
1
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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.
|
|
289
305
|
|
|
290
306
|
### 2.2 Associated data binds identity commitments
|
|
291
307
|
|
|
@@ -309,8 +325,8 @@ Ed25519 signing component unbound — the component that authenticates every pre
|
|
|
309
325
|
the peer will ever publish. Hashing the commitment covers both.
|
|
310
326
|
|
|
311
327
|
**Cost.** This is the single largest wire deviation in the message path. The
|
|
312
|
-
truncation to 8 bytes matches
|
|
313
|
-
and domain-separated, but a Signal client and this SDK cannot exchange a single
|
|
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
|
|
314
330
|
message.
|
|
315
331
|
|
|
316
332
|
### 2.3 One-time prekey deletion is deferred
|
|
@@ -380,7 +396,7 @@ field 6.
|
|
|
380
396
|
have: `recipientIdentityType` on both message types, and `kemOneTimePreKeyId` /
|
|
381
397
|
`kemOneTimeCiphertext` on prekey messages
|
|
382
398
|
(`internal/encoding/proto/signal-message.ts:80`, `:226-228`). High numbering
|
|
383
|
-
avoids collision with future upstream fields. A Signal client would parse the
|
|
399
|
+
avoids collision with future upstream fields. A Signal Messenger client would parse the
|
|
384
400
|
message and silently ignore them, losing the identity-type binding.
|
|
385
401
|
|
|
386
402
|
**Deviation.** `libsignal` binds addresses as a 17-byte fixed-width ServiceId plus
|
|
@@ -388,7 +404,7 @@ a 1-byte device ID ([`protocol.rs:246-260`][proto]). The SDK binds a
|
|
|
388
404
|
format-version byte, a varint-length-prefixed UTF-8 user ID, and a 4-byte
|
|
389
405
|
big-endian device ID (`internal/encoding/proto/signal-message.ts:84-92`). The
|
|
390
406
|
encoding is unambiguous, but it authenticates an application-defined identifier
|
|
391
|
-
rather than a Signal ACI or PNI — which is the correct thing for this SDK to bind
|
|
407
|
+
rather than a Signal Messenger ACI or PNI — which is the correct thing for this SDK to bind
|
|
392
408
|
and an incompatible thing to put on the wire.
|
|
393
409
|
|
|
394
410
|
The SDK is also stricter than `libsignal` on decode, requiring fields that
|
|
@@ -446,7 +462,7 @@ storage.
|
|
|
446
462
|
|
|
447
463
|
**Session records serialize as JSON, not protobuf** (`types/session.ts:1002-1028`).
|
|
448
464
|
This is acknowledged in the source as a simplicity and debuggability choice.
|
|
449
|
-
Consequences worth naming: stored sessions are not portable to or from any Signal
|
|
465
|
+
Consequences worth naming: stored sessions are not portable to or from any Signal Messenger
|
|
450
466
|
client, and key material sits in immutable JavaScript strings that cannot be
|
|
451
467
|
zeroed, where `libsignal`'s byte vectors can be.
|
|
452
468
|
|
|
@@ -458,7 +474,7 @@ padding — a `0x80` terminator followed by zeros
|
|
|
458
474
|
rejects malformed padding with a deliberately generic error to avoid a padding
|
|
459
475
|
oracle.
|
|
460
476
|
|
|
461
|
-
`libsignal` does not bucket-pad at this layer; in Signal, that lives in the client
|
|
477
|
+
`libsignal` does not bucket-pad at this layer; in Signal Messenger, that lives in the client
|
|
462
478
|
applications. Doing it in the library means length hiding is on by default rather
|
|
463
479
|
than a thing each integrator must remember.
|
|
464
480
|
|
|
@@ -472,7 +488,7 @@ past each boundary rather than on it.
|
|
|
472
488
|
|
|
473
489
|
## 4. SPQR and the ML-KEM Braid
|
|
474
490
|
|
|
475
|
-
This is the same protocol as
|
|
491
|
+
This is the same protocol as the SparsePostQuantumRatchet v1 protocol, implemented
|
|
476
492
|
independently and pinned against `SparsePostQuantumRatchet v1.5.1` (commit
|
|
477
493
|
`f2589fef`). The fidelity is high and specific:
|
|
478
494
|
|
|
@@ -483,10 +499,10 @@ independently and pinned against `SparsePostQuantumRatchet v1.5.1` (commit
|
|
|
483
499
|
(`internal/protocol/spqr/ml-kem-braid/kdf.ts:32-92`).
|
|
484
500
|
- **The Reed–Solomon erasure layer matches**: GF(2^16) with primitive polynomial
|
|
485
501
|
`0x1100b`, 32-byte chunks, 16 polynomials, degree bound 35. Reed–Solomon is
|
|
486
|
-
present in
|
|
502
|
+
present in `libsignal`; it is not an SDK addition.
|
|
487
503
|
- **The production wire framing is byte-compatible**:
|
|
488
504
|
`VERSION ‖ LEB128(epoch) ‖ LEB128(chain_index) ‖ MSG_TYPE ‖ [LEB128(chunk_index) ‖ CHUNK]`
|
|
489
|
-
(`internal/encoding/proto/pq-ratchet-serialize.ts`), matching
|
|
505
|
+
(`internal/encoding/proto/pq-ratchet-serialize.ts`), matching `libsignal`'s
|
|
490
506
|
`serialize.rs`, with the same message-type values and the same epoch offset.
|
|
491
507
|
- **ML-KEM-768 with the same incremental split** (32-byte seed, 1152-byte vector,
|
|
492
508
|
960/128-byte ciphertext parts).
|
|
@@ -500,18 +516,18 @@ One divergence breaks interoperability completely. The SDK computes
|
|
|
500
516
|
hek = SHA3-256(ek_seed || ek_vector)
|
|
501
517
|
```
|
|
502
518
|
|
|
503
|
-
|
|
519
|
+
`libsignal`, via libcrux, builds the encapsulation key as
|
|
504
520
|
`t̂ ‖ ρ` before hashing — the reverse order.
|
|
505
521
|
|
|
506
522
|
The SDK follows the **normative text of the published ML-KEM Braid
|
|
507
|
-
specification**, which states seed-first ordering.
|
|
523
|
+
specification**, which states seed-first ordering. `libsignal` follows FIPS 203,
|
|
508
524
|
which serializes vector-first. The specification and the reference implementation
|
|
509
525
|
disagree, and the SDK chose the specification.
|
|
510
526
|
|
|
511
527
|
The value feeds the Fujisaki–Okamoto transform, so the consequences cascade:
|
|
512
|
-
different header bytes, so
|
|
528
|
+
different header bytes, so `libsignal`'s header validation rejects the SDK's output;
|
|
513
529
|
different ciphertext; different shared secret; different epoch secret; different
|
|
514
|
-
authenticator ratchet. **A braid session between this SDK and Signal's
|
|
530
|
+
authenticator ratchet. **A braid session between this SDK and Signal Messenger's
|
|
515
531
|
implementation cannot complete a single epoch.**
|
|
516
532
|
|
|
517
533
|
Two further consequences a reader should not have to infer:
|
|
@@ -521,7 +537,7 @@ Two further consequences a reader should not have to infer:
|
|
|
521
537
|
is a permutation of the same material — but a FIPS conformance claim would not
|
|
522
538
|
hold for this path. Direct (non-braid) mode uses stock ML-KEM-768.
|
|
523
539
|
- The SDK resolves the same spec-versus-code conflict in the *opposite* direction
|
|
524
|
-
elsewhere: for `KDF_AUTH`, it follows
|
|
540
|
+
elsewhere: for `KDF_AUTH`, it follows the `libsignal` Rust reference rather than the
|
|
525
541
|
written specification. The two choices are individually defensible and
|
|
526
542
|
collectively inconsistent about which artifact is authoritative.
|
|
527
543
|
|
|
@@ -533,17 +549,17 @@ braid session persisted under the former ordering.
|
|
|
533
549
|
|
|
534
550
|
**Extension.** An opt-in direct mode (`protocol.braid: 'disabled'`) uses stock
|
|
535
551
|
ML-KEM-768 and adds wire message types `0x80`–`0x82`
|
|
536
|
-
(`internal/encoding/proto/pq-ratchet-serialize.ts:38-45`).
|
|
552
|
+
(`internal/encoding/proto/pq-ratchet-serialize.ts:38-45`). `libsignal`'s parser rejects
|
|
537
553
|
anything above `6`, so these are visible only within the SDK; they occupy a byte
|
|
538
|
-
range
|
|
554
|
+
range `libsignal` has not claimed. This mode has no Signal Protocol analogue.
|
|
539
555
|
|
|
540
556
|
**Independent design.** Persisted SPQR state uses a flat message with 20 fields
|
|
541
|
-
where
|
|
557
|
+
where `libsignal` uses an 11-variant `oneof` over nested structures. Serialized SPQR
|
|
542
558
|
state is not portable in either direction.
|
|
543
559
|
|
|
544
560
|
**Deviation.** Skipped-key eviction in the SPQR chain triggers at the cap and
|
|
545
|
-
evicts by wall-clock timestamp, where
|
|
546
|
-
evicts by message index.
|
|
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
|
|
547
563
|
SDK's introduces a clock dependency into ratchet state.
|
|
548
564
|
|
|
549
565
|
### 4.3 The Triple Ratchet is faithful
|
|
@@ -564,7 +580,7 @@ wire. It is documented in the PR that accompanied this file as cleanup work.
|
|
|
564
580
|
## 5. Sesame
|
|
565
581
|
|
|
566
582
|
Sesame has no reference implementation to compare against — `libsignal` does not
|
|
567
|
-
implement it; device and session management lives in the Signal service and its
|
|
583
|
+
implement it; device and session management lives in the Signal Messenger service and its
|
|
568
584
|
clients. Everything below is measured against the pinned specification text
|
|
569
585
|
(revision 2) alone.
|
|
570
586
|
|
|
@@ -689,13 +705,14 @@ internally inconsistent about this.
|
|
|
689
705
|
([`sealed_sender.rs:2055-2075`][ss]); the unseal path reconstructs the envelope
|
|
690
706
|
with a fixed type instead.
|
|
691
707
|
|
|
692
|
-
### 6.3 The delivery token
|
|
708
|
+
### 6.3 The delivery token follows `libsignal`, not an SDK invention
|
|
693
709
|
|
|
694
710
|
Despite the module name, `deriveAccessKey`
|
|
695
711
|
(`internal/protocol/sealed-sender/delivery-token.ts:52-91`) is `libsignal`'s
|
|
696
712
|
`ProfileKey::derive_access_key` — AES-256-GCM over 16 zero bytes with a zero
|
|
697
|
-
nonce, truncated to 16 bytes — and it reproduces `libsignal`
|
|
698
|
-
|
|
713
|
+
nonce, truncated to 16 bytes — and it reproduces the values `libsignal`
|
|
714
|
+
publishes for that derivation. It is a 16-byte value derived from the
|
|
715
|
+
recipient's profile key
|
|
699
716
|
that proves to the relay that the sender knows that profile key, gating anonymous
|
|
700
717
|
delivery to contacts. It never enters the sealed-sender wire format; it is
|
|
701
718
|
presented out of band.
|
|
@@ -705,7 +722,7 @@ construction that no code implements. That description is wrong and is corrected
|
|
|
705
722
|
in the PR accompanying this file.
|
|
706
723
|
|
|
707
724
|
Certificate signatures use Ed25519 rather than XEdDSA, per §1.2, so SDK
|
|
708
|
-
certificates cannot validate against a Signal trust root or vice versa. The
|
|
725
|
+
certificates cannot validate against a Signal Messenger trust root or vice versa. The
|
|
709
726
|
revocation list is empty where `libsignal` revokes one key ID, which is
|
|
710
727
|
appropriate for a different trust root but worth noting.
|
|
711
728
|
|
|
@@ -760,11 +777,11 @@ is incorrect. Flagged for correction.
|
|
|
760
777
|
### 7.3 Groups v2 is an independent design
|
|
761
778
|
|
|
762
779
|
The zero-knowledge primitives underneath are real and faithful (§7.4). The group
|
|
763
|
-
system built on them is not Signal
|
|
780
|
+
system built on them is not the Signal Private Group System.
|
|
764
781
|
|
|
765
|
-
What is faithful: role and access-control enum values match
|
|
782
|
+
What is faithful: role and access-control enum values match `libsignal`'s exactly,
|
|
766
783
|
group ID derivation from the master key is correct, the `__signal_group__v2__!`
|
|
767
|
-
identifier encoding
|
|
784
|
+
identifier encoding follows `libsignal`, authentication genuinely uses zkgroup
|
|
768
785
|
credentials, and member identifiers and profile keys are encrypted with real
|
|
769
786
|
`UidCiphertext` and `ProfileKeyCiphertext`.
|
|
770
787
|
|
|
@@ -772,7 +789,7 @@ What differs, and it is structural:
|
|
|
772
789
|
|
|
773
790
|
**The client is the state authority.** The SDK's client applies a change,
|
|
774
791
|
re-encrypts the entire group state, and uploads it
|
|
775
|
-
(`internal/groups-v2/manager.ts:1176-1193`). Signal's client submits only a set of
|
|
792
|
+
(`internal/groups-v2/manager.ts:1176-1193`). Signal Messenger's client submits only a set of
|
|
776
793
|
change actions, each carrying zero-knowledge presentations, and the **server**
|
|
777
794
|
validates every action and signs the result.
|
|
778
795
|
|
|
@@ -783,21 +800,21 @@ no zero-knowledge presentations for it to check. Any authenticated member can
|
|
|
783
800
|
rewrite roles, membership, and the ban list. Server signatures are returned but
|
|
784
801
|
never verified on receipt.
|
|
785
802
|
|
|
786
|
-
This is a materially weaker trust model than Signal
|
|
803
|
+
This is a materially weaker trust model than the Signal Private Group System, and
|
|
787
804
|
anyone deploying group messaging on this SDK needs to know it: group membership
|
|
788
805
|
and roles are enforced by cooperating clients, not by the server, and not
|
|
789
806
|
cryptographically against a malicious member. It is a reasonable position for an
|
|
790
807
|
SDK that ships without a validating server component, and it is not what a reader
|
|
791
|
-
of Signal
|
|
808
|
+
of the Signal Private Group System documentation would assume.
|
|
792
809
|
|
|
793
810
|
**Serialization is JSON**, not protobuf, both for group state
|
|
794
811
|
(`internal/groups-v2/manager.ts:1229-1236`) and for the blob payloads inside the
|
|
795
812
|
AES-256-GCM-SIV envelope (`internal/groups-v2/encrypted-state.ts:70-81`). Every
|
|
796
|
-
encrypted group title and description is undecryptable by Signal even with the
|
|
813
|
+
encrypted group title and description is undecryptable by Signal Messenger even with the
|
|
797
814
|
correct master key.
|
|
798
815
|
|
|
799
816
|
**Invite links** use `https://join.open-e2ee.dev/#` with a 49-byte raw payload
|
|
800
|
-
(`internal/groups-v2/invite-link.ts:36`, `:78-85`), where
|
|
817
|
+
(`internal/groups-v2/invite-link.ts:36`, `:78-85`), where `libsignal` uses
|
|
801
818
|
`https://signal.group/#` with a protobuf. This is labelled accurately in source as
|
|
802
819
|
the package's own format.
|
|
803
820
|
|
|
@@ -820,7 +837,7 @@ One deviation: server secret parameters are derived under four SDK-specific labe
|
|
|
820
837
|
rather than `libsignal`'s single seeded derivation
|
|
821
838
|
(`internal/protocol/zk/groups/server-params.ts:43-54`). The same randomness
|
|
822
839
|
therefore yields different server keys, and credentials are not interchangeable
|
|
823
|
-
with Signal's. That follows from the SDK being its own trust root.
|
|
840
|
+
with Signal Messenger's. That follows from the SDK being its own trust root.
|
|
824
841
|
|
|
825
842
|
Credential serialization is also ad hoc and carries no version byte, where
|
|
826
843
|
`libsignal` uses a leading version byte. That is a forward-compatibility gap
|
|
@@ -851,9 +868,9 @@ within this review.
|
|
|
851
868
|
are correct and unit tests exist, but the outputs were not diffed against
|
|
852
869
|
`libsignal`'s. A subtle error here would silently corrupt every `UidStruct`.
|
|
853
870
|
- **SPQR state-machine transition equivalence.** State names, message types, and
|
|
854
|
-
chunk counts match
|
|
871
|
+
chunk counts match `libsignal`'s; the eleven-state transition table was not diffed
|
|
855
872
|
transition by transition.
|
|
856
|
-
- **Whether the SPQR decoder enforces a bound on stored points.**
|
|
873
|
+
- **Whether the SPQR decoder enforces a bound on stored points.** `libsignal` caps
|
|
857
874
|
stored points per polynomial; no equivalent bound was located in the SDK's
|
|
858
875
|
decoder.
|
|
859
876
|
- **Whether SPQR state mutations are rolled back when message authentication
|
package/docs/GETTING_STARTED.md
CHANGED
|
@@ -107,7 +107,9 @@ This is the target DX the package is moving toward. It is shown here so app
|
|
|
107
107
|
developers can understand the intended mental model while the current stable API
|
|
108
108
|
still uses `storage`, `remoteObjectStore`, hooks, and transition-only media helpers.
|
|
109
109
|
|
|
110
|
+
<!-- mock-snippet:skip target-message-api-not-yet-shipped -->
|
|
110
111
|
```ts
|
|
112
|
+
// Real protocol and cryptography; simulated in-memory infrastructure.
|
|
111
113
|
import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
112
114
|
import { createInMemoryDeviceStorage } from "@open-e2ee/signal-protocol-sdk/device/storage/memory";
|
|
113
115
|
import { mockRelay } from "@open-e2ee/signal-protocol-sdk/remote/relay/mock";
|
|
@@ -180,8 +182,8 @@ const signal = await createSignalProtocolClient({
|
|
|
180
182
|
```
|
|
181
183
|
|
|
182
184
|
Attachments use the same message API. On Expo, pass the picker URI; the Signal
|
|
183
|
-
client copies or persists the bytes through `deviceStorage.files`
|
|
184
|
-
so retry can continue after restart:
|
|
185
|
+
Protocol client copies or persists the bytes through `deviceStorage.files`
|
|
186
|
+
before upload so retry can continue after restart:
|
|
185
187
|
|
|
186
188
|
```ts
|
|
187
189
|
await signal.messages.send({
|
|
@@ -226,7 +228,9 @@ Use mock adapters for local examples and development:
|
|
|
226
228
|
the demo sends while Bob is offline, inspects the relay-visible ciphertext, and
|
|
227
229
|
then starts Bob's subscription to show the decrypted plaintext entering the app.
|
|
228
230
|
|
|
231
|
+
<!-- mock-snippet:run getting-started-stable-local-clients expect="bob decrypted: alice: hello" -->
|
|
229
232
|
```ts
|
|
233
|
+
// Real protocol and cryptography; simulated in-memory infrastructure.
|
|
230
234
|
import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
231
235
|
import { mockStore } from "@open-e2ee/signal-protocol-sdk/local/store/mock";
|
|
232
236
|
import { mockRelay } from "@open-e2ee/signal-protocol-sdk/remote/relay/mock";
|
|
@@ -315,11 +319,11 @@ import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
|
315
319
|
import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
|
|
316
320
|
import {
|
|
317
321
|
convexRelay,
|
|
318
|
-
type
|
|
322
|
+
type ConvexSignalProtocolRelayApi,
|
|
319
323
|
} from "@open-e2ee/signal-protocol-sdk/remote/relay/convex";
|
|
320
324
|
import { api } from "../convex/_generated/api";
|
|
321
325
|
|
|
322
|
-
const signalApi = api.signal satisfies
|
|
326
|
+
const signalApi = api.signal satisfies ConvexSignalProtocolRelayApi;
|
|
323
327
|
|
|
324
328
|
// The relay handles server-side public keys, devices, and encrypted envelopes.
|
|
325
329
|
const relay = convexRelay({
|
|
@@ -522,8 +526,8 @@ partial-byte store. Native background download code should implement the same
|
|
|
522
526
|
`MediaAttachmentTransfer` interface.
|
|
523
527
|
|
|
524
528
|
For background-safe uploads, use the durable client operation. The current API
|
|
525
|
-
persists bounded recovery metadata through the existing Signal storage
|
|
526
|
-
the target message-first API moves that responsibility behind
|
|
529
|
+
persists bounded recovery metadata through the existing Signal Protocol storage
|
|
530
|
+
adapter; the target message-first API moves that responsibility behind
|
|
527
531
|
`deviceStorage.messages`. The operation tries the upload when it is due and
|
|
528
532
|
returns either a completed pointer or a pending job id for later recovery:
|
|
529
533
|
|
|
@@ -560,8 +564,8 @@ await signal.media.processPending({
|
|
|
560
564
|
```
|
|
561
565
|
|
|
562
566
|
On receive, ask the media planner what work this device should do. Your app
|
|
563
|
-
supplies the IDs it has already processed or cached; the Signal package
|
|
564
|
-
the safe next step without taking ownership of your app database:
|
|
567
|
+
supplies the IDs it has already processed or cached; the Signal Protocol package
|
|
568
|
+
returns the safe next step without taking ownership of your app database:
|
|
565
569
|
|
|
566
570
|
```ts
|
|
567
571
|
const mediaWork = media.planMediaAttachmentProcessing({
|
package/docs/INTERFACES.md
CHANGED
|
@@ -12,30 +12,30 @@ policy.
|
|
|
12
12
|
|
|
13
13
|
```text
|
|
14
14
|
SignalProtocolClient
|
|
15
|
-
├──
|
|
16
|
-
├──
|
|
17
|
-
├──
|
|
15
|
+
├── ISignalProtocolLocalStore device-local protocol state
|
|
16
|
+
├── ISignalProtocolRelayServer authenticated device, prekey, and envelope service
|
|
17
|
+
├── SignalProtocolRemoteObjectStore brokered encrypted-object operations (optional)
|
|
18
18
|
├── media callbacks application-owned attachment bytes and caches
|
|
19
19
|
└── lifecycle hooks application reactions and observability
|
|
20
20
|
|
|
21
21
|
Local-store bootstrap
|
|
22
|
-
└──
|
|
22
|
+
└── ISignalProtocolLocalSecretVault small platform-managed bootstrap secrets
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
The interfaces are public contracts, but they do not make an implementation
|
|
26
26
|
secure by themselves. Each adapter must preserve the ownership and atomicity
|
|
27
27
|
requirements described below.
|
|
28
28
|
|
|
29
|
-
## `
|
|
29
|
+
## `ISignalProtocolLocalStore`
|
|
30
30
|
|
|
31
|
-
`
|
|
31
|
+
`ISignalProtocolLocalStore` persists the current device's identities, prekeys, sessions,
|
|
32
32
|
sender keys, contact trust, retry records, and operational metadata.
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
|
-
import type {
|
|
35
|
+
import type { ISignalProtocolLocalStore } from "@open-e2ee/signal-protocol-sdk/local/store";
|
|
36
36
|
import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
37
37
|
|
|
38
|
-
const storage:
|
|
38
|
+
const storage: ISignalProtocolLocalStore = appProtocolStore;
|
|
39
39
|
|
|
40
40
|
const client = await createSignalProtocolClient({
|
|
41
41
|
identity: { userId },
|
|
@@ -56,16 +56,16 @@ A production implementation must:
|
|
|
56
56
|
Available adapters and their status are documented in the
|
|
57
57
|
[local-store guide](../local/store/README.md).
|
|
58
58
|
|
|
59
|
-
## `
|
|
59
|
+
## `ISignalProtocolLocalSecretVault`
|
|
60
60
|
|
|
61
|
-
`
|
|
61
|
+
`ISignalProtocolLocalSecretVault` is a deliberately small interface for bootstrap
|
|
62
62
|
secrets that must live outside the main local store, such as a database
|
|
63
63
|
encryption key.
|
|
64
64
|
|
|
65
65
|
```ts
|
|
66
|
-
import type {
|
|
66
|
+
import type { ISignalProtocolLocalSecretVault } from "@open-e2ee/signal-protocol-sdk";
|
|
67
67
|
|
|
68
|
-
const vault:
|
|
68
|
+
const vault: ISignalProtocolLocalSecretVault = {
|
|
69
69
|
getSecret: (name) => platformSecrets.getBytes(name),
|
|
70
70
|
setSecret: (name, value) => platformSecrets.setBytes(name, value),
|
|
71
71
|
deleteSecret: (name) => platformSecrets.delete(name),
|
|
@@ -77,23 +77,23 @@ device migration, uninstall persistence, and deletion behavior depend on the
|
|
|
77
77
|
selected platform service and host configuration. See the
|
|
78
78
|
[secret-vault guide](../local/vault/README.md).
|
|
79
79
|
|
|
80
|
-
## `
|
|
80
|
+
## `ISignalProtocolRelayServer`
|
|
81
81
|
|
|
82
|
-
`
|
|
82
|
+
`ISignalProtocolRelayServer` represents the authenticated application backend used for
|
|
83
83
|
device registration, account identity state, public prekeys, encrypted-envelope
|
|
84
84
|
delivery, provisioning, key rotation, and encrypted group coordination.
|
|
85
85
|
|
|
86
86
|
```ts
|
|
87
|
-
import type {
|
|
87
|
+
import type { ISignalProtocolRelayServer } from "@open-e2ee/signal-protocol-sdk/remote/relay";
|
|
88
88
|
import {
|
|
89
89
|
convexRelay,
|
|
90
|
-
type
|
|
90
|
+
type ConvexSignalProtocolRelayApi,
|
|
91
91
|
} from "@open-e2ee/signal-protocol-sdk/remote/relay/convex";
|
|
92
92
|
import { api } from "../convex/_generated/api";
|
|
93
93
|
|
|
94
|
-
const signalApi = api.signal satisfies
|
|
94
|
+
const signalApi = api.signal satisfies ConvexSignalProtocolRelayApi;
|
|
95
95
|
|
|
96
|
-
const relay:
|
|
96
|
+
const relay: ISignalProtocolRelayServer = convexRelay({
|
|
97
97
|
convex,
|
|
98
98
|
api: signalApi,
|
|
99
99
|
currentUserId: userId,
|
|
@@ -110,17 +110,17 @@ The relay stores public protocol material, ciphertext, and required routing
|
|
|
110
110
|
metadata. It must not require device private keys or decrypted message content.
|
|
111
111
|
See the [relay guide](../remote/relay/README.md).
|
|
112
112
|
|
|
113
|
-
## `
|
|
113
|
+
## `SignalProtocolRemoteObjectStore`
|
|
114
114
|
|
|
115
|
-
`
|
|
115
|
+
`SignalProtocolRemoteObjectStore` supplies short-lived upload and download operations
|
|
116
116
|
for already encrypted objects. It is provider-neutral and optional.
|
|
117
117
|
|
|
118
118
|
```ts
|
|
119
119
|
import type {
|
|
120
|
-
|
|
120
|
+
SignalProtocolRemoteObjectStore,
|
|
121
121
|
} from "@open-e2ee/signal-protocol-sdk/remote/object-store";
|
|
122
122
|
|
|
123
|
-
const remoteObjectStore:
|
|
123
|
+
const remoteObjectStore: SignalProtocolRemoteObjectStore = {
|
|
124
124
|
createUpload: (request) => appObjectBroker.createUpload(request),
|
|
125
125
|
createDownload: (request) => appObjectBroker.createDownload(request),
|
|
126
126
|
completeUpload: (request) => appObjectBroker.completeUpload(request),
|