@open-e2ee/signal-protocol-sdk 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADAPTERS.md +13 -31
- package/ARCHITECTURE.md +5 -7
- package/CHANGELOG.md +258 -0
- package/README.md +36 -48
- package/SECURITY.md +2 -2
- package/client/README.md +9 -0
- package/device/README.md +16 -7
- package/dist/client/client.d.ts +25 -16
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +115 -95
- package/dist/client/client.js.map +1 -1
- package/dist/client/config.d.ts +10 -17
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/event-hooks.js +27 -0
- package/dist/client/event-hooks.js.map +1 -1
- package/dist/client/group-outbox.d.ts +31 -1
- package/dist/client/group-outbox.d.ts.map +1 -1
- package/dist/client/group-outbox.js +67 -58
- package/dist/client/group-outbox.js.map +1 -1
- package/dist/client/group-receive-authorization.d.ts +5 -0
- package/dist/client/group-receive-authorization.d.ts.map +1 -0
- package/dist/client/group-receive-authorization.js +32 -0
- package/dist/client/group-receive-authorization.js.map +1 -0
- package/dist/client/group-sender-key-operations.d.ts +15 -0
- package/dist/client/group-sender-key-operations.d.ts.map +1 -0
- package/dist/client/group-sender-key-operations.js +31 -0
- package/dist/client/group-sender-key-operations.js.map +1 -0
- package/dist/client/groups.d.ts +3 -1
- package/dist/client/groups.d.ts.map +1 -1
- package/dist/client/groups.js +5 -2
- package/dist/client/groups.js.map +1 -1
- package/dist/client/hosted-anonymous-delivery.d.ts +9 -1
- package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
- package/dist/client/hosted-anonymous-delivery.js +61 -22
- package/dist/client/hosted-anonymous-delivery.js.map +1 -1
- package/dist/client/hosted-transport.d.ts +7 -0
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js +44 -6
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/key-rotation.d.ts.map +1 -1
- package/dist/client/key-rotation.js +2 -4
- package/dist/client/key-rotation.js.map +1 -1
- package/dist/client/prekeys.d.ts.map +1 -1
- package/dist/client/prekeys.js +1 -1
- package/dist/client/prekeys.js.map +1 -1
- package/dist/client/relay-device-refusal.d.ts +32 -0
- package/dist/client/relay-device-refusal.d.ts.map +1 -0
- package/dist/client/relay-device-refusal.js +36 -0
- package/dist/client/relay-device-refusal.js.map +1 -0
- package/dist/client/relay-subscription.d.ts +2 -0
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +3 -1
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/relay-work.d.ts +26 -0
- package/dist/client/relay-work.d.ts.map +1 -1
- package/dist/client/relay-work.js +37 -0
- package/dist/client/relay-work.js.map +1 -1
- package/dist/client/sealed-sender.d.ts.map +1 -1
- package/dist/client/sealed-sender.js +12 -17
- package/dist/client/sealed-sender.js.map +1 -1
- package/dist/client/sender-key-distribution.d.ts.map +1 -1
- package/dist/client/sender-key-distribution.js +4 -1
- package/dist/client/sender-key-distribution.js.map +1 -1
- package/dist/client/sessions.d.ts.map +1 -1
- package/dist/client/sessions.js +2 -4
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +94 -6
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +483 -184
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/types.d.ts +7 -0
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/index.d.ts +27 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -17
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/pq/kyber.d.ts +1 -1
- package/dist/internal/crypto/pq/kyber.js +1 -1
- package/dist/internal/encoding/proto/sender-key-message.d.ts +2 -2
- package/dist/internal/encoding/proto/sender-key-message.d.ts.map +1 -1
- package/dist/internal/encoding/proto/sender-key-message.js +5 -2
- package/dist/internal/encoding/proto/sender-key-message.js.map +1 -1
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js +5 -2
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/groups/wire.d.ts +0 -2
- package/dist/internal/groups/wire.d.ts.map +1 -1
- package/dist/internal/groups/wire.js +0 -6
- package/dist/internal/groups/wire.js.map +1 -1
- package/dist/internal/manager/manager.d.ts +8 -7
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +34 -37
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +0 -17
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.js +0 -4
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/certificate.d.ts +2 -32
- package/dist/internal/protocol/sealed-sender/certificate.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/certificate.js +4 -85
- package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/index.d.ts +2 -2
- package/dist/internal/protocol/sealed-sender/index.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/index.js +2 -6
- package/dist/internal/protocol/sealed-sender/index.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts +0 -19
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/proto/index.js +1 -48
- package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts +9 -13
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +90 -95
- 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.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/index.js +2 -2
- package/dist/internal/protocol/spqr/index.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts +0 -2
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js +4 -12
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js +1 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/serialize.js +1 -4
- package/dist/internal/protocol/spqr/serialize.js.map +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.js +2 -3
- package/dist/internal/protocol/spqr/spqr.js.map +1 -1
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
- package/dist/internal/protocol/x3dh/x3dh.js +1 -1
- package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/credentials.d.ts +3 -54
- package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/credentials.js +4 -91
- package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/endorsements.d.ts +3 -64
- package/dist/internal/protocol/zk/credentials/endorsements.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/endorsements.js +4 -134
- package/dist/internal/protocol/zk/credentials/endorsements.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/index.d.ts +3 -3
- package/dist/internal/protocol/zk/credentials/index.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/index.js +3 -3
- package/dist/internal/protocol/zk/credentials/index.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/issuance.d.ts +3 -26
- package/dist/internal/protocol/zk/credentials/issuance.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/issuance.js +3 -80
- package/dist/internal/protocol/zk/credentials/issuance.js.map +1 -1
- package/dist/internal/protocol/zk/credentials/presentation.d.ts +4 -73
- package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
- package/dist/internal/protocol/zk/credentials/presentation.js +4 -152
- package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
- package/dist/internal/protocol/zk/groups/auth-credential.d.ts +1 -61
- package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/auth-credential.js +2 -196
- package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -1
- package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts +1 -86
- package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/group-send-endorsement.js +1 -152
- package/dist/internal/protocol/zk/groups/group-send-endorsement.js.map +1 -1
- package/dist/internal/protocol/zk/groups/index.d.ts +4 -4
- package/dist/internal/protocol/zk/groups/index.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/index.js +4 -4
- package/dist/internal/protocol/zk/groups/index.js.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +2 -57
- package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-credential.js +2 -174
- package/dist/internal/protocol/zk/groups/profile-key-credential.js.map +1 -1
- package/dist/internal/protocol/zk/groups/server-params.d.ts +8 -72
- package/dist/internal/protocol/zk/groups/server-params.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/server-params.js +8 -108
- package/dist/internal/protocol/zk/groups/server-params.js.map +1 -1
- package/dist/internal/protocol/zk/proofs/sign.d.ts +1 -2
- package/dist/internal/protocol/zk/proofs/sign.d.ts.map +1 -1
- package/dist/internal/protocol/zk/proofs/sign.js +2 -11
- package/dist/internal/protocol/zk/proofs/sign.js.map +1 -1
- package/dist/internal/sesame/device-registry.d.ts +24 -4
- package/dist/internal/sesame/device-registry.d.ts.map +1 -1
- package/dist/internal/sesame/device-registry.js +55 -28
- package/dist/internal/sesame/device-registry.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +79 -11
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +381 -280
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/session/cipher.d.ts +0 -5
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js +3 -9
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/internal/session/ratchet.d.ts.map +1 -1
- package/dist/internal/session/ratchet.js +0 -2
- package/dist/internal/session/ratchet.js.map +1 -1
- package/dist/internal/session/record-locks.d.ts +46 -0
- package/dist/internal/session/record-locks.d.ts.map +1 -0
- package/dist/internal/session/record-locks.js +72 -0
- package/dist/internal/session/record-locks.js.map +1 -0
- package/dist/local/store/expo/adapter.d.ts +8 -2
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +24 -3
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/driver.d.ts +7 -0
- package/dist/local/store/expo/driver.d.ts.map +1 -1
- package/dist/local/store/expo/driver.js +16 -0
- package/dist/local/store/expo/driver.js.map +1 -1
- package/dist/local/store/key-value/adapter.d.ts +3 -3
- package/dist/local/store/key-value/adapter.d.ts.map +1 -1
- package/dist/local/store/key-value/adapter.js +91 -53
- package/dist/local/store/key-value/adapter.js.map +1 -1
- package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -1
- package/dist/local/store/key-value/backend-conformance.js +25 -0
- package/dist/local/store/key-value/backend-conformance.js.map +1 -1
- package/dist/local/store/key-value/batch.d.ts +3 -1
- package/dist/local/store/key-value/batch.d.ts.map +1 -1
- package/dist/local/store/key-value/batch.js +9 -1
- package/dist/local/store/key-value/batch.js.map +1 -1
- package/dist/local/store/key-value/storage.d.ts +6 -0
- package/dist/local/store/key-value/storage.d.ts.map +1 -1
- package/dist/local/store/key-value/transactional-backend.d.ts +1 -1
- package/dist/local/store/key-value/transactional-backend.js +1 -1
- package/dist/local/store/memory/adapter.d.ts +13 -3
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +122 -73
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/reliability.d.ts +16 -0
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/reliability.js +58 -28
- package/dist/local/store/reliability.js.map +1 -1
- package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/local/store/sqlite/migrations.js +18 -0
- package/dist/local/store/sqlite/migrations.js.map +1 -1
- package/dist/local/store/sqlite/models/skipped-sender-key.d.ts +3 -3
- package/dist/local/store/sqlite/models/skipped-sender-key.d.ts.map +1 -1
- package/dist/local/store/sqlite/models/skipped-sender-key.js +13 -17
- package/dist/local/store/sqlite/models/skipped-sender-key.js.map +1 -1
- package/dist/local/store/sqlite/store.d.ts +3 -3
- package/dist/local/store/sqlite/store.d.ts.map +1 -1
- package/dist/local/store/sqlite/store.js +53 -23
- package/dist/local/store/sqlite/store.js.map +1 -1
- package/dist/local/store/web/adapter.d.ts +3 -3
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +122 -73
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/vault/electron-safe-storage.d.ts.map +1 -1
- package/dist/local/vault/electron-safe-storage.js +15 -2
- package/dist/local/vault/electron-safe-storage.js.map +1 -1
- package/dist/profile/index.d.ts +2 -1
- package/dist/profile/index.d.ts.map +1 -1
- package/dist/profile/index.js +2 -1
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/own-profile-key.d.ts +42 -0
- package/dist/profile/own-profile-key.d.ts.map +1 -0
- package/dist/profile/own-profile-key.js +64 -0
- package/dist/profile/own-profile-key.js.map +1 -0
- package/dist/profile/profile-key.d.ts +1 -34
- package/dist/profile/profile-key.d.ts.map +1 -1
- package/dist/profile/profile-key.js +3 -63
- package/dist/profile/profile-key.js.map +1 -1
- package/dist/profile/update-service.js +1 -1
- package/dist/profile/update-service.js.map +1 -1
- package/dist/remote/relay/index.d.ts +4 -7
- package/dist/remote/relay/index.d.ts.map +1 -1
- package/dist/remote/relay/index.js +5 -7
- package/dist/remote/relay/index.js.map +1 -1
- package/dist/remote/relay/types.d.ts +3 -3
- package/dist/types/api.d.ts +29 -8
- package/dist/types/api.d.ts.map +1 -1
- package/dist/username/link.d.ts.map +1 -1
- package/dist/username/link.js +1 -5
- package/dist/username/link.js.map +1 -1
- package/dist/utils/bounded-fan-out.d.ts +99 -0
- package/dist/utils/bounded-fan-out.d.ts.map +1 -0
- package/dist/utils/bounded-fan-out.js +180 -0
- package/dist/utils/bounded-fan-out.js.map +1 -0
- package/dist/utils/keyed-lock.d.ts +16 -0
- package/dist/utils/keyed-lock.d.ts.map +1 -0
- package/dist/utils/keyed-lock.js +39 -0
- package/dist/utils/keyed-lock.js.map +1 -0
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +3 -3
- package/dist/zk/credentials.d.ts +2 -2
- package/dist/zk/credentials.js +2 -2
- package/dist/zk/groups.d.ts +3 -3
- package/dist/zk/groups.d.ts.map +1 -1
- package/dist/zk/groups.js +3 -3
- package/dist/zk/groups.js.map +1 -1
- package/docs/ASSURANCE.md +69 -28
- package/docs/CLIENT_COMPOSITION.md +9 -3
- package/docs/DEVIATIONS.md +45 -27
- package/docs/GETTING_STARTED.md +42 -320
- package/docs/INTERFACES.md +7 -7
- package/docs/PACKAGE_SURFACE.md +14 -16
- package/docs/RECIPES.md +6 -112
- package/groups/README.md +9 -1
- package/hooks/README.md +11 -2
- package/local/store/README.md +26 -6
- package/local/store/expo/README.md +18 -5
- package/local/store/key-value/README.md +5 -3
- package/local/store/node/README.md +2 -1
- package/local/store/web-sqlite/README.md +28 -8
- package/local/vault/README.md +21 -2
- package/package.json +1 -30
- package/remote/README.md +12 -78
- package/remote/object-store/convex-r2/README.md +20 -42
- package/remote/relay/README.md +21 -18
- package/zk/README.md +6 -7
- package/dist/client/dual-store.d.ts +0 -70
- package/dist/client/dual-store.d.ts.map +0 -1
- package/dist/client/dual-store.js +0 -123
- package/dist/client/dual-store.js.map +0 -1
- package/dist/client/multi-device.d.ts +0 -74
- package/dist/client/multi-device.d.ts.map +0 -1
- package/dist/client/multi-device.js +0 -105
- package/dist/client/multi-device.js.map +0 -1
- package/dist/groups/server.d.ts +0 -10
- package/dist/groups/server.d.ts.map +0 -1
- package/dist/groups/server.js +0 -6
- package/dist/groups/server.js.map +0 -1
- package/dist/internal/encoding/index.d.ts +0 -2
- package/dist/internal/encoding/index.d.ts.map +0 -1
- package/dist/internal/encoding/index.js +0 -2
- package/dist/internal/encoding/index.js.map +0 -1
- package/dist/internal/groups/server-engine.d.ts +0 -118
- package/dist/internal/groups/server-engine.d.ts.map +0 -1
- package/dist/internal/groups/server-engine.js +0 -1268
- package/dist/internal/groups/server-engine.js.map +0 -1
- package/dist/internal/protocol/index.d.ts +0 -24
- package/dist/internal/protocol/index.d.ts.map +0 -1
- package/dist/internal/protocol/index.js +0 -9
- package/dist/internal/protocol/index.js.map +0 -1
- package/dist/internal/protocol/sealed-sender/trust-root.d.ts +0 -56
- package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +0 -1
- package/dist/internal/protocol/sealed-sender/trust-root.js +0 -90
- package/dist/internal/protocol/sealed-sender/trust-root.js.map +0 -1
- package/dist/internal/protocol/triple-ratchet/index.d.ts +0 -21
- package/dist/internal/protocol/triple-ratchet/index.d.ts.map +0 -1
- package/dist/internal/protocol/triple-ratchet/index.js +0 -19
- package/dist/internal/protocol/triple-ratchet/index.js.map +0 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +0 -233
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +0 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.js +0 -254
- package/dist/internal/protocol/triple-ratchet/ratchet.js.map +0 -1
- package/dist/internal/protocol/zk/proofs/index.d.ts +0 -13
- package/dist/internal/protocol/zk/proofs/index.d.ts.map +0 -1
- package/dist/internal/protocol/zk/proofs/index.js +0 -7
- package/dist/internal/protocol/zk/proofs/index.js.map +0 -1
- package/dist/local/store/sqlite/index.d.ts +0 -20
- package/dist/local/store/sqlite/index.d.ts.map +0 -1
- package/dist/local/store/sqlite/index.js +0 -18
- package/dist/local/store/sqlite/index.js.map +0 -1
- package/dist/remote/object-store/convex-r2/server/index.d.ts +0 -2
- package/dist/remote/object-store/convex-r2/server/index.d.ts.map +0 -1
- package/dist/remote/object-store/convex-r2/server/index.js +0 -2
- package/dist/remote/object-store/convex-r2/server/index.js.map +0 -1
- package/dist/remote/object-store/convex-r2/server.d.ts +0 -129
- package/dist/remote/object-store/convex-r2/server.d.ts.map +0 -1
- package/dist/remote/object-store/convex-r2/server.js +0 -244
- package/dist/remote/object-store/convex-r2/server.js.map +0 -1
- package/dist/remote/relay/memory/adapter.d.ts +0 -252
- package/dist/remote/relay/memory/adapter.d.ts.map +0 -1
- package/dist/remote/relay/memory/adapter.js +0 -1058
- package/dist/remote/relay/memory/adapter.js.map +0 -1
- package/dist/remote/relay/memory/failures.d.ts +0 -58
- package/dist/remote/relay/memory/failures.d.ts.map +0 -1
- package/dist/remote/relay/memory/failures.js +0 -124
- package/dist/remote/relay/memory/failures.js.map +0 -1
- package/dist/remote/relay/memory/group-server.d.ts +0 -13
- package/dist/remote/relay/memory/group-server.d.ts.map +0 -1
- package/dist/remote/relay/memory/group-server.js +0 -19
- package/dist/remote/relay/memory/group-server.js.map +0 -1
- package/dist/remote/relay/memory/index.d.ts +0 -11
- package/dist/remote/relay/memory/index.d.ts.map +0 -1
- package/dist/remote/relay/memory/index.js +0 -7
- package/dist/remote/relay/memory/index.js.map +0 -1
- package/examples/browser/README.md +0 -35
- package/examples/browser/index.html +0 -27
- package/examples/browser/src/exchange.ts +0 -69
- package/examples/browser/src/main.ts +0 -63
- package/examples/browser/src/style.css +0 -9
- package/examples/browser/src/worker.ts +0 -10
- package/examples/browser/vite.config.ts +0 -9
- package/remote/relay/memory/README.md +0 -72
- package/scripts/oe-groups.mjs +0 -166
|
@@ -20,47 +20,10 @@
|
|
|
20
20
|
* @see https://signal.org/docs/ -- Signal Protocol Specifications
|
|
21
21
|
* @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
23
|
+
import { ServerRootPublicKey, EndorsementResponse, Endorsement } from '../credentials/endorsements.js';
|
|
24
24
|
import type { ServiceId } from './uid-struct.js';
|
|
25
|
-
import type { UidEncCiphertext } from './uid-encryption.js';
|
|
26
25
|
import { type GroupSecretParams } from './group-params.js';
|
|
27
26
|
export {};
|
|
28
|
-
/**
|
|
29
|
-
* A key pair used to sign endorsements for a particular expiration.
|
|
30
|
-
*
|
|
31
|
-
* Derived daily from a {@link ServerRootKeyPair} by absorbing the
|
|
32
|
-
* day-aligned expiration timestamp. Intended to be cheaply cached --
|
|
33
|
-
* regeneration is not expensive, but these are reused frequently
|
|
34
|
-
* enough that caching is worthwhile.
|
|
35
|
-
*/
|
|
36
|
-
export interface GroupSendDerivedKeyPair {
|
|
37
|
-
/** The derived server key pair for endorsement issuance/verification. */
|
|
38
|
-
readonly keyPair: ServerDerivedKeyPair;
|
|
39
|
-
/** Day-aligned expiration timestamp in epoch seconds. */
|
|
40
|
-
readonly expiration: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Derive the appropriate key pair for the given expiration.
|
|
44
|
-
*
|
|
45
|
-
* @param rootKeyPair - The server's root key pair
|
|
46
|
-
* @param expiration - Day-aligned epoch seconds timestamp
|
|
47
|
-
* @returns The derived key pair bound to the expiration
|
|
48
|
-
* @throws Error if expiration is not day-aligned
|
|
49
|
-
*/
|
|
50
|
-
export declare function deriveForExpiration(rootKeyPair: ServerRootKeyPair, expiration: number): GroupSendDerivedKeyPair;
|
|
51
|
-
/**
|
|
52
|
-
* Compute the default expiration for endorsements issued at `currentTime`.
|
|
53
|
-
*
|
|
54
|
-
* Returns the end of the next UTC day. If that is less than 25 hours away, it
|
|
55
|
-
* returns the end of the following day.
|
|
56
|
-
*
|
|
57
|
-
* Endorsements therefore stay valid for at least 25 hours,
|
|
58
|
-
* providing a comfortable buffer for clock skew and timezone issues.
|
|
59
|
-
*
|
|
60
|
-
* @param currentTime - Current time in epoch seconds
|
|
61
|
-
* @returns Day-aligned expiration timestamp in epoch seconds
|
|
62
|
-
*/
|
|
63
|
-
export declare function defaultExpiration(currentTime: number): number;
|
|
64
27
|
/**
|
|
65
28
|
* A response from the group server containing endorsements for all group
|
|
66
29
|
* members.
|
|
@@ -75,19 +38,6 @@ export interface GroupSendEndorsementsResponse {
|
|
|
75
38
|
/** Day-aligned expiration in epoch seconds for all endorsements. */
|
|
76
39
|
readonly expiration: number;
|
|
77
40
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Issue endorsements for all group members.
|
|
80
|
-
*
|
|
81
|
-
* Takes an array of UID encryption ciphertexts, one per member. Sorts them
|
|
82
|
-
* deterministically, extracts the E_A1 points, and issues endorsements over
|
|
83
|
-
* those points using the derived key pair.
|
|
84
|
-
*
|
|
85
|
-
* @param memberCiphertexts - Encrypted UIDs of group members
|
|
86
|
-
* @param derivedKeyPair - Key pair derived for the target expiration
|
|
87
|
-
* @param randomness - 32 bytes of randomness for the batch proof
|
|
88
|
-
* @returns Response containing endorsements and expiration
|
|
89
|
-
*/
|
|
90
|
-
export declare function issueEndorsements(memberCiphertexts: UidEncCiphertext[], derivedKeyPair: GroupSendDerivedKeyPair, randomness: Uint8Array): GroupSendEndorsementsResponse;
|
|
91
41
|
/**
|
|
92
42
|
* An endorsement as extracted from a {@link GroupSendEndorsementsResponse}.
|
|
93
43
|
*
|
|
@@ -191,33 +141,6 @@ export interface GroupSendFullToken {
|
|
|
191
141
|
* @returns A full token ready for verification
|
|
192
142
|
*/
|
|
193
143
|
export declare function createFullToken(token: GroupSendToken, expiration: number): GroupSendFullToken;
|
|
194
|
-
/**
|
|
195
|
-
* Verify that a full token is valid for sending to the given ServiceIds
|
|
196
|
-
* at the current time.
|
|
197
|
-
*
|
|
198
|
-
* The chat server calls this to authorize a group send. Verification:
|
|
199
|
-
* 1. Checks that the token has not expired
|
|
200
|
-
* 2. Asserts the expiration matches the derived key pair
|
|
201
|
-
* 3. Sums the M1 points of all recipient ServiceIds
|
|
202
|
-
* 4. Verifies the token against the summed point using the derived key
|
|
203
|
-
*
|
|
204
|
-
* @param fullToken - The full token to verify
|
|
205
|
-
* @param serviceIds - ServiceIds the sender claims to be sending to
|
|
206
|
-
* @param now - Current time in epoch seconds
|
|
207
|
-
* @param derivedKeyPair - Key pair derived for the token's expiration
|
|
208
|
-
* @returns true if the token is valid
|
|
209
|
-
* @throws VerificationFailure if verification fails
|
|
210
|
-
*/
|
|
211
|
-
export declare function verifyFullToken(fullToken: GroupSendFullToken, serviceIds: ServiceId[], now: number, derivedKeyPair: GroupSendDerivedKeyPair): boolean;
|
|
212
|
-
/**
|
|
213
|
-
* Serialize a {@link GroupSendEndorsementsResponse} to bytes.
|
|
214
|
-
*
|
|
215
|
-
* Format: [expiration (8 bytes BE)] [endorsement response bytes]
|
|
216
|
-
*
|
|
217
|
-
* @param response - The response to serialize
|
|
218
|
-
* @returns The serialized bytes
|
|
219
|
-
*/
|
|
220
|
-
export declare function serializeEndorsementsResponse(response: GroupSendEndorsementsResponse): Uint8Array;
|
|
221
144
|
/**
|
|
222
145
|
* Deserialize a {@link GroupSendEndorsementsResponse} from bytes.
|
|
223
146
|
*
|
|
@@ -235,12 +158,4 @@ export declare function deserializeEndorsementsResponse(bytes: Uint8Array): Grou
|
|
|
235
158
|
* @returns The serialized bytes (24 bytes)
|
|
236
159
|
*/
|
|
237
160
|
export declare function serializeFullToken(fullToken: GroupSendFullToken): Uint8Array;
|
|
238
|
-
/**
|
|
239
|
-
* Deserialize a {@link GroupSendFullToken} from bytes.
|
|
240
|
-
*
|
|
241
|
-
* @param bytes - The serialized bytes (24 bytes)
|
|
242
|
-
* @returns The deserialized full token
|
|
243
|
-
* @throws Error if the bytes are malformed
|
|
244
|
-
*/
|
|
245
|
-
export declare function deserializeFullToken(bytes: Uint8Array): GroupSendFullToken;
|
|
246
161
|
//# sourceMappingURL=group-send-endorsement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-send-endorsement.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/group-send-endorsement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"group-send-endorsement.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/group-send-endorsement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,mBAAmB,EAA+C,mBAAmB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAIjJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,KAAK,iBAAiB,EAAmB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,CAAC;AAiCV;;;;;;;GAOG;AACH,MAAM,WAAW,6BAA6B;IAC5C,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAqCD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,cAAc,CAAC;CAC/D;AA4DD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,6BAA6B,EACvC,UAAU,EAAE,SAAS,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,mBAAmB,GACjC,mBAAmB,EAAE,CAiCvB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,WAAW,EAAE,GAAG,WAAW,CAE5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,GAAG,WAAW,CAE3F;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B;AAMD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,wBAAwB;IACxB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAE7F;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,UAAU,GAAG,6BAA6B,CAShG;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,UAAU,CAM5E"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* @see https://signal.org/docs/ -- Signal Protocol Specifications
|
|
21
21
|
* @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
|
|
22
22
|
*/
|
|
23
|
-
import { ClientDecryptionKey, EndorsementResponse, Endorsement
|
|
23
|
+
import { ClientDecryptionKey, EndorsementResponse, Endorsement } from '../credentials/endorsements.js';
|
|
24
24
|
import { VerificationFailure } from '../credentials/issuance.js';
|
|
25
25
|
import { ShoHmacSha256 } from '../proofs/sho.js';
|
|
26
26
|
import { seedM1, calcM1 } from './uid-struct.js';
|
|
@@ -48,44 +48,6 @@ function tagInfo(expiration) {
|
|
|
48
48
|
sho.absorbAndRatchet(buf);
|
|
49
49
|
return sho;
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Derive the appropriate key pair for the given expiration.
|
|
53
|
-
*
|
|
54
|
-
* @param rootKeyPair - The server's root key pair
|
|
55
|
-
* @param expiration - Day-aligned epoch seconds timestamp
|
|
56
|
-
* @returns The derived key pair bound to the expiration
|
|
57
|
-
* @throws Error if expiration is not day-aligned
|
|
58
|
-
*/
|
|
59
|
-
export function deriveForExpiration(rootKeyPair, expiration) {
|
|
60
|
-
if (expiration % SECONDS_PER_DAY !== 0) {
|
|
61
|
-
throw new Error(`deriveForExpiration: expiration must be day-aligned (multiple of ${SECONDS_PER_DAY}), got ${expiration}`);
|
|
62
|
-
}
|
|
63
|
-
const keyPair = rootKeyPair.deriveKey(tagInfo(expiration));
|
|
64
|
-
return { keyPair, expiration };
|
|
65
|
-
}
|
|
66
|
-
// ---------------------------------------------------------------------------
|
|
67
|
-
// Default expiration
|
|
68
|
-
// ---------------------------------------------------------------------------
|
|
69
|
-
/**
|
|
70
|
-
* Compute the default expiration for endorsements issued at `currentTime`.
|
|
71
|
-
*
|
|
72
|
-
* Returns the end of the next UTC day. If that is less than 25 hours away, it
|
|
73
|
-
* returns the end of the following day.
|
|
74
|
-
*
|
|
75
|
-
* Endorsements therefore stay valid for at least 25 hours,
|
|
76
|
-
* providing a comfortable buffer for clock skew and timezone issues.
|
|
77
|
-
*
|
|
78
|
-
* @param currentTime - Current time in epoch seconds
|
|
79
|
-
* @returns Day-aligned expiration timestamp in epoch seconds
|
|
80
|
-
*/
|
|
81
|
-
export function defaultExpiration(currentTime) {
|
|
82
|
-
const startOfDay = currentTime - (currentTime % SECONDS_PER_DAY);
|
|
83
|
-
let expiration = startOfDay + 2 * SECONDS_PER_DAY;
|
|
84
|
-
if (expiration - currentTime < SECONDS_PER_DAY + SECONDS_PER_HOUR) {
|
|
85
|
-
expiration += SECONDS_PER_DAY;
|
|
86
|
-
}
|
|
87
|
-
return expiration;
|
|
88
|
-
}
|
|
89
51
|
// ---------------------------------------------------------------------------
|
|
90
52
|
// Point sorting (deterministic ordering)
|
|
91
53
|
// ---------------------------------------------------------------------------
|
|
@@ -115,39 +77,6 @@ function sortPointsByKeys(points, sortKeys) {
|
|
|
115
77
|
return 0;
|
|
116
78
|
});
|
|
117
79
|
}
|
|
118
|
-
// ---------------------------------------------------------------------------
|
|
119
|
-
// Issue endorsements (server-side)
|
|
120
|
-
// ---------------------------------------------------------------------------
|
|
121
|
-
/**
|
|
122
|
-
* Issue endorsements for all group members.
|
|
123
|
-
*
|
|
124
|
-
* Takes an array of UID encryption ciphertexts, one per member. Sorts them
|
|
125
|
-
* deterministically, extracts the E_A1 points, and issues endorsements over
|
|
126
|
-
* those points using the derived key pair.
|
|
127
|
-
*
|
|
128
|
-
* @param memberCiphertexts - Encrypted UIDs of group members
|
|
129
|
-
* @param derivedKeyPair - Key pair derived for the target expiration
|
|
130
|
-
* @param randomness - 32 bytes of randomness for the batch proof
|
|
131
|
-
* @returns Response containing endorsements and expiration
|
|
132
|
-
*/
|
|
133
|
-
export function issueEndorsements(memberCiphertexts, derivedKeyPair, randomness) {
|
|
134
|
-
// Extract E_A1 (first point of each ciphertext) with original indices
|
|
135
|
-
const indexedPoints = memberCiphertexts.map((ct, i) => [
|
|
136
|
-
i,
|
|
137
|
-
ct.E_A1,
|
|
138
|
-
]);
|
|
139
|
-
// Compute sort keys before sorting
|
|
140
|
-
const sortKeys = indexedPoints.map(([_i, point]) => point.add(point).toBytes());
|
|
141
|
-
sortPointsByKeys(indexedPoints, sortKeys);
|
|
142
|
-
// Extract just the sorted points for issuance
|
|
143
|
-
const sortedPoints = indexedPoints.map(([_i, point]) => point);
|
|
144
|
-
// Issue endorsements over the sorted points
|
|
145
|
-
const response = EndorsementResponse.issue(sortedPoints, derivedKeyPair.keyPair, randomness);
|
|
146
|
-
return {
|
|
147
|
-
response,
|
|
148
|
-
expiration: derivedKeyPair.expiration,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
80
|
/**
|
|
152
81
|
* Create a {@link ReceivedEndorsement} wrapping the given endorsement.
|
|
153
82
|
*
|
|
@@ -290,70 +219,6 @@ export function removeEndorsement(combined, unwanted) {
|
|
|
290
219
|
export function createFullToken(token, expiration) {
|
|
291
220
|
return { token, expiration };
|
|
292
221
|
}
|
|
293
|
-
/**
|
|
294
|
-
* Verify that a full token is valid for sending to the given ServiceIds
|
|
295
|
-
* at the current time.
|
|
296
|
-
*
|
|
297
|
-
* The chat server calls this to authorize a group send. Verification:
|
|
298
|
-
* 1. Checks that the token has not expired
|
|
299
|
-
* 2. Asserts the expiration matches the derived key pair
|
|
300
|
-
* 3. Sums the M1 points of all recipient ServiceIds
|
|
301
|
-
* 4. Verifies the token against the summed point using the derived key
|
|
302
|
-
*
|
|
303
|
-
* @param fullToken - The full token to verify
|
|
304
|
-
* @param serviceIds - ServiceIds the sender claims to be sending to
|
|
305
|
-
* @param now - Current time in epoch seconds
|
|
306
|
-
* @param derivedKeyPair - Key pair derived for the token's expiration
|
|
307
|
-
* @returns true if the token is valid
|
|
308
|
-
* @throws VerificationFailure if verification fails
|
|
309
|
-
*/
|
|
310
|
-
export function verifyFullToken(fullToken, serviceIds, now, derivedKeyPair) {
|
|
311
|
-
if (now > fullToken.expiration) {
|
|
312
|
-
throw new VerificationFailure();
|
|
313
|
-
}
|
|
314
|
-
if (fullToken.expiration !== derivedKeyPair.expiration) {
|
|
315
|
-
throw new Error('verifyFullToken: wrong key pair used for this token ' +
|
|
316
|
-
`(token expiration: ${fullToken.expiration}, ` +
|
|
317
|
-
`key pair expiration: ${derivedKeyPair.expiration})`);
|
|
318
|
-
}
|
|
319
|
-
// Sum M1 points for all recipient ServiceIds
|
|
320
|
-
const uidShoSeed = seedM1();
|
|
321
|
-
let userIdSum = null;
|
|
322
|
-
for (const serviceId of serviceIds) {
|
|
323
|
-
const m1 = calcM1(uidShoSeed.clone(), serviceId);
|
|
324
|
-
if (userIdSum === null) {
|
|
325
|
-
userIdSum = m1;
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
userIdSum = userIdSum.add(m1);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
if (userIdSum === null) {
|
|
332
|
-
throw new Error('verifyFullToken: serviceIds must not be empty');
|
|
333
|
-
}
|
|
334
|
-
// ServerDerivedKeyPair.verify throws VerificationFailure on mismatch
|
|
335
|
-
derivedKeyPair.keyPair.verify(userIdSum, fullToken.token.token);
|
|
336
|
-
return true;
|
|
337
|
-
}
|
|
338
|
-
// ---------------------------------------------------------------------------
|
|
339
|
-
// Serialization helpers
|
|
340
|
-
// ---------------------------------------------------------------------------
|
|
341
|
-
/**
|
|
342
|
-
* Serialize a {@link GroupSendEndorsementsResponse} to bytes.
|
|
343
|
-
*
|
|
344
|
-
* Format: [expiration (8 bytes BE)] [endorsement response bytes]
|
|
345
|
-
*
|
|
346
|
-
* @param response - The response to serialize
|
|
347
|
-
* @returns The serialized bytes
|
|
348
|
-
*/
|
|
349
|
-
export function serializeEndorsementsResponse(response) {
|
|
350
|
-
const responseBytes = response.response.toBytes();
|
|
351
|
-
const result = new Uint8Array(8 + responseBytes.length);
|
|
352
|
-
const view = new DataView(result.buffer);
|
|
353
|
-
view.setBigUint64(0, BigInt(response.expiration), false);
|
|
354
|
-
result.set(responseBytes, 8);
|
|
355
|
-
return result;
|
|
356
|
-
}
|
|
357
222
|
/**
|
|
358
223
|
* Deserialize a {@link GroupSendEndorsementsResponse} from bytes.
|
|
359
224
|
*
|
|
@@ -386,20 +251,4 @@ export function serializeFullToken(fullToken) {
|
|
|
386
251
|
result.set(fullToken.token.token, 8);
|
|
387
252
|
return result;
|
|
388
253
|
}
|
|
389
|
-
/**
|
|
390
|
-
* Deserialize a {@link GroupSendFullToken} from bytes.
|
|
391
|
-
*
|
|
392
|
-
* @param bytes - The serialized bytes (24 bytes)
|
|
393
|
-
* @returns The deserialized full token
|
|
394
|
-
* @throws Error if the bytes are malformed
|
|
395
|
-
*/
|
|
396
|
-
export function deserializeFullToken(bytes) {
|
|
397
|
-
if (bytes.length < 24) {
|
|
398
|
-
throw new Error('deserializeFullToken: expected at least 24 bytes, got ' + bytes.length);
|
|
399
|
-
}
|
|
400
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
401
|
-
const expiration = Number(view.getBigUint64(0, false));
|
|
402
|
-
const token = bytes.slice(8, 24);
|
|
403
|
-
return { token: { token }, expiration };
|
|
404
|
-
}
|
|
405
254
|
//# sourceMappingURL=group-send-endorsement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-send-endorsement.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/group-send-endorsement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"group-send-endorsement.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/group-send-endorsement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAA+C,mBAAmB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEjJ,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAkB,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAA0B,eAAe,EAAE,MAAM,g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,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAA6B;IAC9D,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1D,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -12,8 +12,8 @@ export { ProfileKeyEncryptionDomain, type ProfileKeyEncKeyPair, type ProfileKeyE
|
|
|
12
12
|
export { type GroupMasterKey, type GroupSecretParams, type GroupPublicParams, groupMasterKey, deriveGroupSecretParams, generateGroupSecretParams, getGroupPublicParams, encryptServiceId, decryptServiceId, encryptProfileKey, decryptProfileKey, encryptBlob, encryptBlobWithPadding, decryptBlob, decryptBlobWithPadding, GROUP_MASTER_KEY_LEN, GROUP_IDENTIFIER_LEN, RANDOMNESS_LEN, SECONDS_PER_DAY, } from './group-params.js';
|
|
13
13
|
export { lizardEncode, lizardDecode, fromUniformBytesSingleElligator, decode253Bits, } from './lizard.js';
|
|
14
14
|
export { type UuidCiphertext, type ProfileKeyCiphertext, encryptUuid, decryptUuid, encryptProfileKeyCiphertext, decryptProfileKeyCiphertext, } from './client-zk-group-cipher.js';
|
|
15
|
-
export { type
|
|
16
|
-
export { type AuthCredentialWithPniResponse, type AuthCredentialWithPni, type AuthCredentialPresentation,
|
|
17
|
-
export { type ProfileKeyCredentialRequest, type ProfileKeyCredentialRequestContext, type ExpiringProfileKeyCredentialResponse, type ExpiringProfileKeyCredential, type ProfileKeyCredentialPresentation, createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest,
|
|
18
|
-
export { type
|
|
15
|
+
export { type ServerPublicParams, serverVerifySignature, SIGNATURE_LEN } from './server-params.js';
|
|
16
|
+
export { type AuthCredentialWithPniResponse, type AuthCredentialWithPni, type AuthCredentialPresentation, receiveAuthCredential, presentAuthCredential } from './auth-credential.js';
|
|
17
|
+
export { type ProfileKeyCredentialRequest, type ProfileKeyCredentialRequestContext, type ExpiringProfileKeyCredentialResponse, type ExpiringProfileKeyCredential, type ProfileKeyCredentialPresentation, createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest, receiveProfileKeyCredential, presentProfileKeyCredential, deserializeProfileKeyCredentialResponse, serializeProfileKeyCredentialPresentation } from './profile-key-credential.js';
|
|
18
|
+
export { type GroupSendEndorsementsResponse, type ReceivedEndorsement, type GroupSendToken, type GroupSendFullToken, receiveEndorsements, combineEndorsements, removeEndorsement, createFullToken, deserializeEndorsementsResponse, serializeFullToken } from './group-send-endorsement.js';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC;AACV,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,SAAS,EACd,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,gBAAgB,IAAI,mBAAmB,EACvC,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,wBAAwB,GAC/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,iBAAiB,IAAI,mBAAmB,EACxC,iBAAiB,IAAI,mBAAmB,EACxC,kBAAkB,IAAI,+BAA+B,GACtD,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,+BAA+B,EAC/B,aAAa,GACd,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,WAAW,EACX,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC;AACV,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,SAAS,EACd,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,gBAAgB,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yCAAyC,EAAE,MAAM,0BAA0B,CAAC;AAGjc,OAAO,EAAE,KAAK,6BAA6B,EAAE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -5,8 +5,8 @@ export { ProfileKeyEncryptionDomain, deriveProfileKeyEncKeyPair, encryptProfileK
|
|
|
5
5
|
export { groupMasterKey, deriveGroupSecretParams, generateGroupSecretParams, getGroupPublicParams, encryptServiceId, decryptServiceId, encryptProfileKey, decryptProfileKey, encryptBlob, encryptBlobWithPadding, decryptBlob, decryptBlobWithPadding, GROUP_MASTER_KEY_LEN, GROUP_IDENTIFIER_LEN, RANDOMNESS_LEN, SECONDS_PER_DAY, } from './group-params.js';
|
|
6
6
|
export { lizardEncode, lizardDecode, fromUniformBytesSingleElligator, decode253Bits, } from './lizard.js';
|
|
7
7
|
export { encryptUuid, decryptUuid, encryptProfileKeyCiphertext, decryptProfileKeyCiphertext, } from './client-zk-group-cipher.js';
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export { createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest,
|
|
11
|
-
export {
|
|
8
|
+
export { serverVerifySignature, SIGNATURE_LEN } from './server-params.js';
|
|
9
|
+
export { receiveAuthCredential, presentAuthCredential } from './auth-credential.js';
|
|
10
|
+
export { createProfileKeyCredentialRequest, serializeProfileKeyCredentialRequest, receiveProfileKeyCredential, presentProfileKeyCredential, deserializeProfileKeyCredentialResponse, serializeProfileKeyCredentialPresentation } from './profile-key-credential.js';
|
|
11
|
+
export { receiveEndorsements, combineEndorsements, removeEndorsement, createFullToken, deserializeEndorsementsResponse, serializeFullToken } from './group-send-endorsement.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,cAAc,EACd,cAAc,EACd,eAAe,EAEf,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAyB,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,mBAAmB,EAGnB,mBAAmB,EACnB,gBAAgB,IAAI,mBAAmB,EACvC,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,wBAAwB,GAC/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B,EAG1B,0BAA0B,EAC1B,iBAAiB,IAAI,mBAAmB,EACxC,iBAAiB,IAAI,mBAAmB,EACxC,kBAAkB,IAAI,+BAA+B,GACtD,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAIL,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,+BAA+B,EAC/B,aAAa,GACd,MAAM,UAAU,CAAC;AAElB,OAAO,EAGL,WAAW,EACX,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,cAAc,EACd,cAAc,EACd,eAAe,EAEf,sBAAsB,EACtB,MAAM,EACN,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAyB,mBAAmB,EAAE,MAA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indingKeyPair, type BlindedAttribute, type BlindedIssuanceProof, type BlindingPublicKey } from '../credentials/issuance.js';
|
|
24
24
|
import { type PresentationProof } from '../credentials/presentation.js';
|
|
25
|
-
import type { Credential,
|
|
25
|
+
import type { Credential, CredentialPublicKey } from '../credentials/credentials.js';
|
|
26
26
|
import { type UidStruct, type ServiceId } from './uid-struct.js';
|
|
27
27
|
import { type ProfileKeyStruct } from './profile-key-struct.js';
|
|
28
28
|
import { type UidEncCiphertext } from './uid-encryption.js';
|
|
29
29
|
import { type ProfileKeyEncCiphertext } from './profile-key-encryption.js';
|
|
30
|
-
import type { GroupSecretParams
|
|
30
|
+
import type { GroupSecretParams } from './group-params.js';
|
|
31
31
|
export {};
|
|
32
32
|
/** Public request sent to the authenticated credential issuer. */
|
|
33
33
|
export interface ProfileKeyCredentialRequest {
|
|
@@ -98,27 +98,6 @@ export interface ProfileKeyCredentialPresentation {
|
|
|
98
98
|
/** Day-aligned epoch timestamp matching the credential. */
|
|
99
99
|
readonly redemptionTime: number;
|
|
100
100
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Issue an ExpiringProfileKeyCredential for an authenticated ACI, blinded
|
|
103
|
-
* ProfileKey request, and redemption time.
|
|
104
|
-
*
|
|
105
|
-
* Called by the server. Produces an issuance proof that the client can verify
|
|
106
|
-
* to extract the credential.
|
|
107
|
-
*
|
|
108
|
-
* The issuer sees the authenticated ACI and redemption time. It never receives
|
|
109
|
-
* the raw profile key or the client's blinding secret.
|
|
110
|
-
*
|
|
111
|
-
* CRITICAL: Use different randomness for each issuance. Reusing randomness
|
|
112
|
-
* effectively reveals the server's private key.
|
|
113
|
-
*
|
|
114
|
-
* @param credentialKeyPair - The server's profile key credential signing key pair
|
|
115
|
-
* @param aci - The user's ACI ServiceId
|
|
116
|
-
* @param request - Client-created blinded profile-key request
|
|
117
|
-
* @param redemptionTime - Day-aligned epoch timestamp (seconds)
|
|
118
|
-
* @param randomness - At least 32 bytes of cryptographically secure randomness
|
|
119
|
-
* @returns The issuance response to send to the client
|
|
120
|
-
*/
|
|
121
|
-
export declare function issueProfileKeyCredential(credentialKeyPair: CredentialKeyPair, aci: ServiceId, request: ProfileKeyCredentialRequest, redemptionTime: number, randomness: Uint8Array): ExpiringProfileKeyCredentialResponse;
|
|
122
101
|
/**
|
|
123
102
|
* Receive and verify an ExpiringProfileKeyCredential issuance response.
|
|
124
103
|
*
|
|
@@ -165,38 +144,8 @@ export declare function receiveProfileKeyCredential(publicKey: CredentialPublicK
|
|
|
165
144
|
* @returns The presentation to send to the server
|
|
166
145
|
*/
|
|
167
146
|
export declare function presentProfileKeyCredential(publicKey: CredentialPublicKey, credential: ExpiringProfileKeyCredential, groupSecretParams: GroupSecretParams, randomness: Uint8Array): ProfileKeyCredentialPresentation;
|
|
168
|
-
/**
|
|
169
|
-
* Verify a ProfileKeyCredentialPresentation against the server's key pair and
|
|
170
|
-
* the group's public parameters.
|
|
171
|
-
*
|
|
172
|
-
* Called by the server. Checks that:
|
|
173
|
-
* 1. The presentation proof is valid (ZK verification)
|
|
174
|
-
* 2. The credential has not expired (redemptionTime >= currentTime)
|
|
175
|
-
*
|
|
176
|
-
* @param credentialKeyPair - The server's profile key credential signing key pair
|
|
177
|
-
* @param groupPublicParams - The group's public parameters
|
|
178
|
-
* @param presentation - The client's presentation proof
|
|
179
|
-
* @param currentTime - Current time in epoch seconds for expiry check
|
|
180
|
-
* @returns true if the presentation is valid
|
|
181
|
-
* @throws {VerificationFailure} If the presentation proof is invalid or expired
|
|
182
|
-
*/
|
|
183
|
-
export declare function verifyProfileKeyCredentialPresentation(credentialKeyPair: CredentialKeyPair, groupPublicParams: GroupPublicParams, presentation: ProfileKeyCredentialPresentation, currentTime: number): boolean;
|
|
184
147
|
/** Serialize the fixed-width blinded request. */
|
|
185
148
|
export declare function serializeProfileKeyCredentialRequest(request: ProfileKeyCredentialRequest): Uint8Array;
|
|
186
|
-
/** Deserialize and validate the fixed-width blinded request. */
|
|
187
|
-
export declare function deserializeProfileKeyCredentialRequest(bytes: Uint8Array): ProfileKeyCredentialRequest;
|
|
188
|
-
/**
|
|
189
|
-
* Serialize an ExpiringProfileKeyCredentialResponse to bytes.
|
|
190
|
-
*
|
|
191
|
-
* Format:
|
|
192
|
-
* [redemptionTime: 8 bytes BE u64]
|
|
193
|
-
* [credential.t: 32 bytes scalar LE]
|
|
194
|
-
* [credential.U: 32 bytes point]
|
|
195
|
-
* [credential.S1: 32 bytes point]
|
|
196
|
-
* [credential.S2: 32 bytes point]
|
|
197
|
-
* [pokshoProof: remaining bytes]
|
|
198
|
-
*/
|
|
199
|
-
export declare function serializeProfileKeyCredentialResponse(response: ExpiringProfileKeyCredentialResponse): Uint8Array;
|
|
200
149
|
/**
|
|
201
150
|
* Deserialize an ExpiringProfileKeyCredentialResponse from bytes.
|
|
202
151
|
*/
|
|
@@ -213,8 +162,4 @@ export declare function deserializeProfileKeyCredentialResponse(bytes: Uint8Arra
|
|
|
213
162
|
* [profileKey.E_A1: 32] [profileKey.E_A2: 32]
|
|
214
163
|
*/
|
|
215
164
|
export declare function serializeProfileKeyCredentialPresentation(presentation: ProfileKeyCredentialPresentation): Uint8Array;
|
|
216
|
-
/**
|
|
217
|
-
* Deserialize a ProfileKeyCredentialPresentation from bytes.
|
|
218
|
-
*/
|
|
219
|
-
export declare function deserializeProfileKeyCredentialPresentation(bytes: Uint8Array): ProfileKeyCredentialPresentation;
|
|
220
165
|
//# sourceMappingURL=profile-key-credential.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-key-credential.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/profile-key-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAEL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"profile-key-credential.d.ts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