@open-e2ee/signal-protocol-sdk 0.1.0-alpha.1
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 +195 -0
- package/ARCHITECTURE.md +206 -0
- package/CHANGELOG.md +13 -0
- package/LICENSE +661 -0
- package/NOTICE +27 -0
- package/README.md +152 -0
- package/SECURITY.md +125 -0
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/TROUBLESHOOTING.md +203 -0
- package/blocking/README.md +42 -0
- package/client/README.md +169 -0
- package/device/README.md +166 -0
- package/dist/blocking/index.d.ts +4 -0
- package/dist/blocking/index.d.ts.map +1 -0
- package/dist/blocking/index.js +2 -0
- package/dist/blocking/index.js.map +1 -0
- package/dist/blocking/manager.d.ts +27 -0
- package/dist/blocking/manager.d.ts.map +1 -0
- package/dist/blocking/manager.js +61 -0
- package/dist/blocking/manager.js.map +1 -0
- package/dist/blocking/types.d.ts +43 -0
- package/dist/blocking/types.d.ts.map +1 -0
- package/dist/blocking/types.js +9 -0
- package/dist/blocking/types.js.map +1 -0
- package/dist/client/client.d.ts +1281 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +2296 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/compose.d.ts +105 -0
- package/dist/client/compose.d.ts.map +1 -0
- package/dist/client/compose.js +41 -0
- package/dist/client/compose.js.map +1 -0
- package/dist/client/config.d.ts +707 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/config.js +19 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/constants.d.ts +48 -0
- package/dist/client/constants.d.ts.map +1 -0
- package/dist/client/constants.js +40 -0
- package/dist/client/constants.js.map +1 -0
- package/dist/client/content-adapter.d.ts +106 -0
- package/dist/client/content-adapter.d.ts.map +1 -0
- package/dist/client/content-adapter.js +423 -0
- package/dist/client/content-adapter.js.map +1 -0
- package/dist/client/dual-store.d.ts +70 -0
- package/dist/client/dual-store.d.ts.map +1 -0
- package/dist/client/dual-store.js +123 -0
- package/dist/client/dual-store.js.map +1 -0
- package/dist/client/endorsement-manager.d.ts +143 -0
- package/dist/client/endorsement-manager.d.ts.map +1 -0
- package/dist/client/endorsement-manager.js +259 -0
- package/dist/client/endorsement-manager.js.map +1 -0
- package/dist/client/event-hooks.d.ts +330 -0
- package/dist/client/event-hooks.d.ts.map +1 -0
- package/dist/client/event-hooks.js +59 -0
- package/dist/client/event-hooks.js.map +1 -0
- package/dist/client/files.d.ts +73 -0
- package/dist/client/files.d.ts.map +1 -0
- package/dist/client/files.js +192 -0
- package/dist/client/files.js.map +1 -0
- package/dist/client/groups.d.ts +204 -0
- package/dist/client/groups.d.ts.map +1 -0
- package/dist/client/groups.js +340 -0
- package/dist/client/groups.js.map +1 -0
- package/dist/client/headless.d.ts +99 -0
- package/dist/client/headless.d.ts.map +1 -0
- package/dist/client/headless.js +163 -0
- package/dist/client/headless.js.map +1 -0
- package/dist/client/index.d.ts +33 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/key-rotation-core.d.ts +167 -0
- package/dist/client/key-rotation-core.d.ts.map +1 -0
- package/dist/client/key-rotation-core.js +459 -0
- package/dist/client/key-rotation-core.js.map +1 -0
- package/dist/client/key-rotation.d.ts +45 -0
- package/dist/client/key-rotation.d.ts.map +1 -0
- package/dist/client/key-rotation.js +174 -0
- package/dist/client/key-rotation.js.map +1 -0
- package/dist/client/media.d.ts +173 -0
- package/dist/client/media.d.ts.map +1 -0
- package/dist/client/media.js +476 -0
- package/dist/client/media.js.map +1 -0
- package/dist/client/messages.d.ts +131 -0
- package/dist/client/messages.d.ts.map +1 -0
- package/dist/client/messages.js +546 -0
- package/dist/client/messages.js.map +1 -0
- package/dist/client/multi-device.d.ts +73 -0
- package/dist/client/multi-device.d.ts.map +1 -0
- package/dist/client/multi-device.js +104 -0
- package/dist/client/multi-device.js.map +1 -0
- package/dist/client/prekeys.d.ts +133 -0
- package/dist/client/prekeys.d.ts.map +1 -0
- package/dist/client/prekeys.js +608 -0
- package/dist/client/prekeys.js.map +1 -0
- package/dist/client/relay-subscription.d.ts +83 -0
- package/dist/client/relay-subscription.d.ts.map +1 -0
- package/dist/client/relay-subscription.js +353 -0
- package/dist/client/relay-subscription.js.map +1 -0
- package/dist/client/retry-utils.d.ts +42 -0
- package/dist/client/retry-utils.d.ts.map +1 -0
- package/dist/client/retry-utils.js +107 -0
- package/dist/client/retry-utils.js.map +1 -0
- package/dist/client/retry.d.ts +121 -0
- package/dist/client/retry.d.ts.map +1 -0
- package/dist/client/retry.js +499 -0
- package/dist/client/retry.js.map +1 -0
- package/dist/client/sealed-sender-ops.d.ts +61 -0
- package/dist/client/sealed-sender-ops.d.ts.map +1 -0
- package/dist/client/sealed-sender-ops.js +173 -0
- package/dist/client/sealed-sender-ops.js.map +1 -0
- package/dist/client/sessions.d.ts +108 -0
- package/dist/client/sessions.d.ts.map +1 -0
- package/dist/client/sessions.js +367 -0
- package/dist/client/sessions.js.map +1 -0
- package/dist/client/signal-service-cipher.d.ts +331 -0
- package/dist/client/signal-service-cipher.d.ts.map +1 -0
- package/dist/client/signal-service-cipher.js +1506 -0
- package/dist/client/signal-service-cipher.js.map +1 -0
- package/dist/client/state.d.ts +147 -0
- package/dist/client/state.d.ts.map +1 -0
- package/dist/client/state.js +226 -0
- package/dist/client/state.js.map +1 -0
- package/dist/client/types.d.ts +423 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +42 -0
- package/dist/client/types.js.map +1 -0
- package/dist/device/connection.d.ts +46 -0
- package/dist/device/connection.d.ts.map +1 -0
- package/dist/device/connection.js +239 -0
- package/dist/device/connection.js.map +1 -0
- package/dist/device/constants.d.ts +69 -0
- package/dist/device/constants.d.ts.map +1 -0
- package/dist/device/constants.js +64 -0
- package/dist/device/constants.js.map +1 -0
- package/dist/device/device-id.d.ts +45 -0
- package/dist/device/device-id.d.ts.map +1 -0
- package/dist/device/device-id.js +87 -0
- package/dist/device/device-id.js.map +1 -0
- package/dist/device/device-name-crypto.d.ts +39 -0
- package/dist/device/device-name-crypto.d.ts.map +1 -0
- package/dist/device/device-name-crypto.js +165 -0
- package/dist/device/device-name-crypto.js.map +1 -0
- package/dist/device/index.d.ts +31 -0
- package/dist/device/index.d.ts.map +1 -0
- package/dist/device/index.js +35 -0
- package/dist/device/index.js.map +1 -0
- package/dist/device/lifecycle/index.d.ts +25 -0
- package/dist/device/lifecycle/index.d.ts.map +1 -0
- package/dist/device/lifecycle/index.js +3 -0
- package/dist/device/lifecycle/index.js.map +1 -0
- package/dist/device/lifecycle/manager.d.ts +273 -0
- package/dist/device/lifecycle/manager.d.ts.map +1 -0
- package/dist/device/lifecycle/manager.js +1229 -0
- package/dist/device/lifecycle/manager.js.map +1 -0
- package/dist/device/lifecycle/types.d.ts +372 -0
- package/dist/device/lifecycle/types.d.ts.map +1 -0
- package/dist/device/lifecycle/types.js +10 -0
- package/dist/device/lifecycle/types.js.map +1 -0
- package/dist/device/lifecycle/utils.d.ts +37 -0
- package/dist/device/lifecycle/utils.d.ts.map +1 -0
- package/dist/device/lifecycle/utils.js +79 -0
- package/dist/device/lifecycle/utils.js.map +1 -0
- package/dist/device/provisioning.d.ts +249 -0
- package/dist/device/provisioning.d.ts.map +1 -0
- package/dist/device/provisioning.js +439 -0
- package/dist/device/provisioning.js.map +1 -0
- package/dist/device/transfer.d.ts +231 -0
- package/dist/device/transfer.d.ts.map +1 -0
- package/dist/device/transfer.js +628 -0
- package/dist/device/transfer.js.map +1 -0
- package/dist/device/types.d.ts +275 -0
- package/dist/device/types.d.ts.map +1 -0
- package/dist/device/types.js +42 -0
- package/dist/device/types.js.map +1 -0
- package/dist/encoding/base64.d.ts +14 -0
- package/dist/encoding/base64.d.ts.map +1 -0
- package/dist/encoding/base64.js +2 -0
- package/dist/encoding/base64.js.map +1 -0
- package/dist/encoding/hex.d.ts +14 -0
- package/dist/encoding/hex.d.ts.map +1 -0
- package/dist/encoding/hex.js +2 -0
- package/dist/encoding/hex.js.map +1 -0
- package/dist/encoding/index.d.ts +17 -0
- package/dist/encoding/index.d.ts.map +1 -0
- package/dist/encoding/index.js +3 -0
- package/dist/encoding/index.js.map +1 -0
- package/dist/files/index.d.ts +16 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +15 -0
- package/dist/files/index.js.map +1 -0
- package/dist/groups/index.d.ts +12 -0
- package/dist/groups/index.d.ts.map +1 -0
- package/dist/groups/index.js +9 -0
- package/dist/groups/index.js.map +1 -0
- package/dist/hooks/index.d.ts +20 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-connection-presence.d.ts +68 -0
- package/dist/hooks/use-connection-presence.d.ts.map +1 -0
- package/dist/hooks/use-connection-presence.js +300 -0
- package/dist/hooks/use-connection-presence.js.map +1 -0
- package/dist/hooks/use-group-membership.d.ts +66 -0
- package/dist/hooks/use-group-membership.d.ts.map +1 -0
- package/dist/hooks/use-group-membership.js +156 -0
- package/dist/hooks/use-group-membership.js.map +1 -0
- package/dist/hooks/use-key-rotation.d.ts +119 -0
- package/dist/hooks/use-key-rotation.d.ts.map +1 -0
- package/dist/hooks/use-key-rotation.js +198 -0
- package/dist/hooks/use-key-rotation.js.map +1 -0
- package/dist/hooks/use-session-health.d.ts +51 -0
- package/dist/hooks/use-session-health.d.ts.map +1 -0
- package/dist/hooks/use-session-health.js +59 -0
- package/dist/hooks/use-session-health.js.map +1 -0
- package/dist/hooks/use-single-flight.d.ts +29 -0
- package/dist/hooks/use-single-flight.d.ts.map +1 -0
- package/dist/hooks/use-single-flight.js +59 -0
- package/dist/hooks/use-single-flight.js.map +1 -0
- package/dist/index.d.ts +203 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/crypto/ec/ed25519.d.ts +78 -0
- package/dist/internal/crypto/ec/ed25519.d.ts.map +1 -0
- package/dist/internal/crypto/ec/ed25519.js +108 -0
- package/dist/internal/crypto/ec/ed25519.js.map +1 -0
- package/dist/internal/crypto/ec/index.d.ts +5 -0
- package/dist/internal/crypto/ec/index.d.ts.map +1 -0
- package/dist/internal/crypto/ec/index.js +4 -0
- package/dist/internal/crypto/ec/index.js.map +1 -0
- package/dist/internal/crypto/ec/x25519-validation.d.ts +70 -0
- package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -0
- package/dist/internal/crypto/ec/x25519-validation.js +137 -0
- package/dist/internal/crypto/ec/x25519-validation.js.map +1 -0
- package/dist/internal/crypto/ec/x25519.d.ts +91 -0
- package/dist/internal/crypto/ec/x25519.d.ts.map +1 -0
- package/dist/internal/crypto/ec/x25519.js +124 -0
- package/dist/internal/crypto/ec/x25519.js.map +1 -0
- package/dist/internal/crypto/hash/index.d.ts +4 -0
- package/dist/internal/crypto/hash/index.d.ts.map +1 -0
- package/dist/internal/crypto/hash/index.js +3 -0
- package/dist/internal/crypto/hash/index.js.map +1 -0
- package/dist/internal/crypto/hash/sha256.d.ts +24 -0
- package/dist/internal/crypto/hash/sha256.d.ts.map +1 -0
- package/dist/internal/crypto/hash/sha256.js +23 -0
- package/dist/internal/crypto/hash/sha256.js.map +1 -0
- package/dist/internal/crypto/hash/sha512.d.ts +16 -0
- package/dist/internal/crypto/hash/sha512.d.ts.map +1 -0
- package/dist/internal/crypto/hash/sha512.js +27 -0
- package/dist/internal/crypto/hash/sha512.js.map +1 -0
- package/dist/internal/crypto/index.d.ts +60 -0
- package/dist/internal/crypto/index.d.ts.map +1 -0
- package/dist/internal/crypto/index.js +107 -0
- package/dist/internal/crypto/index.js.map +1 -0
- package/dist/internal/crypto/kdf/hkdf.d.ts +300 -0
- package/dist/internal/crypto/kdf/hkdf.d.ts.map +1 -0
- package/dist/internal/crypto/kdf/hkdf.js +452 -0
- package/dist/internal/crypto/kdf/hkdf.js.map +1 -0
- package/dist/internal/crypto/kdf/index.d.ts +4 -0
- package/dist/internal/crypto/kdf/index.d.ts.map +1 -0
- package/dist/internal/crypto/kdf/index.js +3 -0
- package/dist/internal/crypto/kdf/index.js.map +1 -0
- package/dist/internal/crypto/kdf/pbkdf2.d.ts +42 -0
- package/dist/internal/crypto/kdf/pbkdf2.d.ts.map +1 -0
- package/dist/internal/crypto/kdf/pbkdf2.js +44 -0
- package/dist/internal/crypto/kdf/pbkdf2.js.map +1 -0
- package/dist/internal/crypto/key-prefix.d.ts +82 -0
- package/dist/internal/crypto/key-prefix.d.ts.map +1 -0
- package/dist/internal/crypto/key-prefix.js +116 -0
- package/dist/internal/crypto/key-prefix.js.map +1 -0
- package/dist/internal/crypto/pq/index.d.ts +3 -0
- package/dist/internal/crypto/pq/index.d.ts.map +1 -0
- package/dist/internal/crypto/pq/index.js +2 -0
- package/dist/internal/crypto/pq/index.js.map +1 -0
- package/dist/internal/crypto/pq/kyber.d.ts +232 -0
- package/dist/internal/crypto/pq/kyber.d.ts.map +1 -0
- package/dist/internal/crypto/pq/kyber.js +317 -0
- package/dist/internal/crypto/pq/kyber.js.map +1 -0
- package/dist/internal/crypto/random.d.ts +22 -0
- package/dist/internal/crypto/random.d.ts.map +1 -0
- package/dist/internal/crypto/random.js +45 -0
- package/dist/internal/crypto/random.js.map +1 -0
- package/dist/internal/crypto/symmetric/aes-ctr.d.ts +73 -0
- package/dist/internal/crypto/symmetric/aes-ctr.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/aes-ctr.js +98 -0
- package/dist/internal/crypto/symmetric/aes-ctr.js.map +1 -0
- package/dist/internal/crypto/symmetric/aes-gcm-siv.d.ts +77 -0
- package/dist/internal/crypto/symmetric/aes-gcm-siv.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/aes-gcm-siv.js +111 -0
- package/dist/internal/crypto/symmetric/aes-gcm-siv.js.map +1 -0
- package/dist/internal/crypto/symmetric/aes.d.ts +211 -0
- package/dist/internal/crypto/symmetric/aes.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/aes.js +386 -0
- package/dist/internal/crypto/symmetric/aes.js.map +1 -0
- package/dist/internal/crypto/symmetric/hmac.d.ts +32 -0
- package/dist/internal/crypto/symmetric/hmac.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/hmac.js +20 -0
- package/dist/internal/crypto/symmetric/hmac.js.map +1 -0
- package/dist/internal/crypto/symmetric/index.d.ts +9 -0
- package/dist/internal/crypto/symmetric/index.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/index.js +8 -0
- package/dist/internal/crypto/symmetric/index.js.map +1 -0
- package/dist/internal/crypto/symmetric/mac.d.ts +154 -0
- package/dist/internal/crypto/symmetric/mac.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/mac.js +292 -0
- package/dist/internal/crypto/symmetric/mac.js.map +1 -0
- package/dist/internal/crypto/symmetric/padding.d.ts +55 -0
- package/dist/internal/crypto/symmetric/padding.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/padding.js +90 -0
- package/dist/internal/crypto/symmetric/padding.js.map +1 -0
- package/dist/internal/crypto/symmetric/streaming-aead.d.ts +89 -0
- package/dist/internal/crypto/symmetric/streaming-aead.d.ts.map +1 -0
- package/dist/internal/crypto/symmetric/streaming-aead.js +253 -0
- package/dist/internal/crypto/symmetric/streaming-aead.js.map +1 -0
- package/dist/internal/crypto/utils.d.ts +119 -0
- package/dist/internal/crypto/utils.d.ts.map +1 -0
- package/dist/internal/crypto/utils.js +366 -0
- package/dist/internal/crypto/utils.js.map +1 -0
- package/dist/internal/crypto/validation.d.ts +45 -0
- package/dist/internal/crypto/validation.d.ts.map +1 -0
- package/dist/internal/crypto/validation.js +37 -0
- package/dist/internal/crypto/validation.js.map +1 -0
- package/dist/internal/encoding/index.d.ts +2 -0
- package/dist/internal/encoding/index.d.ts.map +1 -0
- package/dist/internal/encoding/index.js +2 -0
- package/dist/internal/encoding/index.js.map +1 -0
- package/dist/internal/encoding/proto/envelope.d.ts +120 -0
- package/dist/internal/encoding/proto/envelope.d.ts.map +1 -0
- package/dist/internal/encoding/proto/envelope.js +160 -0
- package/dist/internal/encoding/proto/envelope.js.map +1 -0
- package/dist/internal/encoding/proto/index.d.ts +25 -0
- package/dist/internal/encoding/proto/index.d.ts.map +1 -0
- package/dist/internal/encoding/proto/index.js +30 -0
- package/dist/internal/encoding/proto/index.js.map +1 -0
- package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts +118 -0
- package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts.map +1 -0
- package/dist/internal/encoding/proto/pq-ratchet-serialize.js +383 -0
- package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -0
- package/dist/internal/encoding/proto/primitives.d.ts +98 -0
- package/dist/internal/encoding/proto/primitives.d.ts.map +1 -0
- package/dist/internal/encoding/proto/primitives.js +179 -0
- package/dist/internal/encoding/proto/primitives.js.map +1 -0
- package/dist/internal/encoding/proto/sender-key-message.d.ts +147 -0
- package/dist/internal/encoding/proto/sender-key-message.d.ts.map +1 -0
- package/dist/internal/encoding/proto/sender-key-message.js +220 -0
- package/dist/internal/encoding/proto/sender-key-message.js.map +1 -0
- package/dist/internal/encoding/proto/signal-message.d.ts +174 -0
- package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -0
- package/dist/internal/encoding/proto/signal-message.js +372 -0
- package/dist/internal/encoding/proto/signal-message.js.map +1 -0
- package/dist/internal/groups/group-id.d.ts +74 -0
- package/dist/internal/groups/group-id.d.ts.map +1 -0
- package/dist/internal/groups/group-id.js +63 -0
- package/dist/internal/groups/group-id.js.map +1 -0
- package/dist/internal/groups/index.d.ts +15 -0
- package/dist/internal/groups/index.d.ts.map +1 -0
- package/dist/internal/groups/index.js +2 -0
- package/dist/internal/groups/index.js.map +1 -0
- package/dist/internal/groups-v2/access-control.d.ts +101 -0
- package/dist/internal/groups-v2/access-control.d.ts.map +1 -0
- package/dist/internal/groups-v2/access-control.js +184 -0
- package/dist/internal/groups-v2/access-control.js.map +1 -0
- package/dist/internal/groups-v2/change-actions.d.ts +35 -0
- package/dist/internal/groups-v2/change-actions.d.ts.map +1 -0
- package/dist/internal/groups-v2/change-actions.js +358 -0
- package/dist/internal/groups-v2/change-actions.js.map +1 -0
- package/dist/internal/groups-v2/encrypted-state.d.ts +121 -0
- package/dist/internal/groups-v2/encrypted-state.d.ts.map +1 -0
- package/dist/internal/groups-v2/encrypted-state.js +455 -0
- package/dist/internal/groups-v2/encrypted-state.js.map +1 -0
- package/dist/internal/groups-v2/index.d.ts +14 -0
- package/dist/internal/groups-v2/index.d.ts.map +1 -0
- package/dist/internal/groups-v2/index.js +11 -0
- package/dist/internal/groups-v2/index.js.map +1 -0
- package/dist/internal/groups-v2/invite-link.d.ts +55 -0
- package/dist/internal/groups-v2/invite-link.d.ts.map +1 -0
- package/dist/internal/groups-v2/invite-link.js +111 -0
- package/dist/internal/groups-v2/invite-link.js.map +1 -0
- package/dist/internal/groups-v2/manager.d.ts +351 -0
- package/dist/internal/groups-v2/manager.d.ts.map +1 -0
- package/dist/internal/groups-v2/manager.js +1093 -0
- package/dist/internal/groups-v2/manager.js.map +1 -0
- package/dist/internal/groups-v2/types.d.ts +371 -0
- package/dist/internal/groups-v2/types.d.ts.map +1 -0
- package/dist/internal/groups-v2/types.js +61 -0
- package/dist/internal/groups-v2/types.js.map +1 -0
- package/dist/internal/manager/index.d.ts +16 -0
- package/dist/internal/manager/index.d.ts.map +1 -0
- package/dist/internal/manager/index.js +2 -0
- package/dist/internal/manager/index.js.map +1 -0
- package/dist/internal/manager/manager.d.ts +378 -0
- package/dist/internal/manager/manager.d.ts.map +1 -0
- package/dist/internal/manager/manager.js +1079 -0
- package/dist/internal/manager/manager.js.map +1 -0
- package/dist/internal/protocol/double-ratchet/chains.d.ts +135 -0
- package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -0
- package/dist/internal/protocol/double-ratchet/chains.js +417 -0
- package/dist/internal/protocol/double-ratchet/chains.js.map +1 -0
- package/dist/internal/protocol/double-ratchet/index.d.ts +20 -0
- package/dist/internal/protocol/double-ratchet/index.d.ts.map +1 -0
- package/dist/internal/protocol/double-ratchet/index.js +21 -0
- package/dist/internal/protocol/double-ratchet/index.js.map +1 -0
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +231 -0
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -0
- package/dist/internal/protocol/double-ratchet/ratchet.js +198 -0
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -0
- package/dist/internal/protocol/index.d.ts +24 -0
- package/dist/internal/protocol/index.d.ts.map +1 -0
- package/dist/internal/protocol/index.js +9 -0
- package/dist/internal/protocol/index.js.map +1 -0
- package/dist/internal/protocol/pqxdh/index.d.ts +19 -0
- package/dist/internal/protocol/pqxdh/index.d.ts.map +1 -0
- package/dist/internal/protocol/pqxdh/index.js +16 -0
- package/dist/internal/protocol/pqxdh/index.js.map +1 -0
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts +141 -0
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -0
- package/dist/internal/protocol/pqxdh/pqxdh.js +399 -0
- package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/certificate.d.ts +94 -0
- package/dist/internal/protocol/sealed-sender/certificate.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/certificate.js +254 -0
- package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts +46 -0
- package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/decryption-v2.js +184 -0
- package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/decryption.d.ts +59 -0
- package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/decryption.js +268 -0
- package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/delivery-token.d.ts +48 -0
- package/dist/internal/protocol/sealed-sender/delivery-token.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/delivery-token.js +71 -0
- package/dist/internal/protocol/sealed-sender/delivery-token.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts +56 -0
- package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/encryption-v2.js +169 -0
- package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/encryption.d.ts +66 -0
- package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/encryption.js +174 -0
- package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/index.d.ts +23 -0
- package/dist/internal/protocol/sealed-sender/index.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/index.js +61 -0
- package/dist/internal/protocol/sealed-sender/index.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts +129 -0
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/proto/index.js +267 -0
- package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/types.d.ts +461 -0
- package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/types.js +99 -0
- package/dist/internal/protocol/sealed-sender/types.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/v2-binary.d.ts +124 -0
- package/dist/internal/protocol/sealed-sender/v2-binary.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/v2-binary.js +295 -0
- package/dist/internal/protocol/sealed-sender/v2-binary.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/v2-helpers.d.ts +107 -0
- package/dist/internal/protocol/sealed-sender/v2-helpers.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/v2-helpers.js +185 -0
- package/dist/internal/protocol/sealed-sender/v2-helpers.js.map +1 -0
- package/dist/internal/protocol/sender-keys/index.d.ts +11 -0
- package/dist/internal/protocol/sender-keys/index.d.ts.map +1 -0
- package/dist/internal/protocol/sender-keys/index.js +2 -0
- package/dist/internal/protocol/sender-keys/index.js.map +1 -0
- package/dist/internal/protocol/sender-keys/manager.d.ts +298 -0
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -0
- package/dist/internal/protocol/sender-keys/manager.js +839 -0
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -0
- package/dist/internal/protocol/spqr/braid-serialize.d.ts +128 -0
- package/dist/internal/protocol/spqr/braid-serialize.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/braid-serialize.js +373 -0
- package/dist/internal/protocol/spqr/braid-serialize.js.map +1 -0
- package/dist/internal/protocol/spqr/braid.d.ts +164 -0
- package/dist/internal/protocol/spqr/braid.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/braid.js +305 -0
- package/dist/internal/protocol/spqr/braid.js.map +1 -0
- package/dist/internal/protocol/spqr/index.d.ts +161 -0
- package/dist/internal/protocol/spqr/index.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/index.js +115 -0
- package/dist/internal/protocol/spqr/index.js.map +1 -0
- package/dist/internal/protocol/spqr/message.d.ts +237 -0
- package/dist/internal/protocol/spqr/message.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/message.js +298 -0
- package/dist/internal/protocol/spqr/message.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.d.ts +174 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.js +248 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.d.ts +29 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.js +43 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/errors.d.ts +170 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/errors.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/errors.js +249 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/errors.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts +84 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js +138 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts +45 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/index.js +94 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/index.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/kdf.d.ts +52 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/kdf.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/kdf.js +121 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/kdf.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.d.ts +12 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.js +15 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts +136 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js +796 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts +454 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js +790 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/field.d.ts +108 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/field.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/field.js +125 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/field.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/index.d.ts +12 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/index.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/index.js +5 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/index.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/tables-16.d.ts +28 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/tables-16.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/tables-16.js +13953 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/tables-16.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.d.ts +40 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.js +52 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/index.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.d.ts +151 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.js +297 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/lagrange.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.d.ts +97 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.js +201 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts +249 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js +731 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts +127 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +894 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +387 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/types.js +121 -0
- package/dist/internal/protocol/spqr/ml-kem-braid/types.js.map +1 -0
- package/dist/internal/protocol/spqr/serialize.d.ts +149 -0
- package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/serialize.js +370 -0
- package/dist/internal/protocol/spqr/serialize.js.map +1 -0
- package/dist/internal/protocol/spqr/spqr.d.ts +486 -0
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/spqr.js +1031 -0
- package/dist/internal/protocol/spqr/spqr.js.map +1 -0
- package/dist/internal/protocol/spqr/validate.d.ts +35 -0
- package/dist/internal/protocol/spqr/validate.d.ts.map +1 -0
- package/dist/internal/protocol/spqr/validate.js +62 -0
- package/dist/internal/protocol/spqr/validate.js.map +1 -0
- package/dist/internal/protocol/triple-ratchet/index.d.ts +21 -0
- package/dist/internal/protocol/triple-ratchet/index.d.ts.map +1 -0
- package/dist/internal/protocol/triple-ratchet/index.js +19 -0
- package/dist/internal/protocol/triple-ratchet/index.js.map +1 -0
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +233 -0
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -0
- package/dist/internal/protocol/triple-ratchet/ratchet.js +254 -0
- package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -0
- package/dist/internal/protocol/username/generate.d.ts +9 -0
- package/dist/internal/protocol/username/generate.d.ts.map +1 -0
- package/dist/internal/protocol/username/generate.js +16 -0
- package/dist/internal/protocol/username/generate.js.map +1 -0
- package/dist/internal/protocol/username/hash.d.ts +74 -0
- package/dist/internal/protocol/username/hash.d.ts.map +1 -0
- package/dist/internal/protocol/username/hash.js +228 -0
- package/dist/internal/protocol/username/hash.js.map +1 -0
- package/dist/internal/protocol/username/link.d.ts +50 -0
- package/dist/internal/protocol/username/link.d.ts.map +1 -0
- package/dist/internal/protocol/username/link.js +187 -0
- package/dist/internal/protocol/username/link.js.map +1 -0
- package/dist/internal/protocol/username/proof.d.ts +34 -0
- package/dist/internal/protocol/username/proof.d.ts.map +1 -0
- package/dist/internal/protocol/username/proof.js +83 -0
- package/dist/internal/protocol/username/proof.js.map +1 -0
- package/dist/internal/protocol/version.d.ts +184 -0
- package/dist/internal/protocol/version.d.ts.map +1 -0
- package/dist/internal/protocol/version.js +163 -0
- package/dist/internal/protocol/version.js.map +1 -0
- package/dist/internal/protocol/x3dh/index.d.ts +15 -0
- package/dist/internal/protocol/x3dh/index.d.ts.map +1 -0
- package/dist/internal/protocol/x3dh/index.js +13 -0
- package/dist/internal/protocol/x3dh/index.js.map +1 -0
- package/dist/internal/protocol/x3dh/x3dh.d.ts +131 -0
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -0
- package/dist/internal/protocol/x3dh/x3dh.js +261 -0
- package/dist/internal/protocol/x3dh/x3dh.js.map +1 -0
- package/dist/internal/protocol/zk/credentials/attributes.d.ts +157 -0
- package/dist/internal/protocol/zk/credentials/attributes.d.ts.map +1 -0
- package/dist/internal/protocol/zk/credentials/attributes.js +177 -0
- package/dist/internal/protocol/zk/credentials/attributes.js.map +1 -0
- package/dist/internal/protocol/zk/credentials/credentials.d.ts +129 -0
- package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -0
- package/dist/internal/protocol/zk/credentials/credentials.js +204 -0
- package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -0
- package/dist/internal/protocol/zk/credentials/endorsements.d.ts +235 -0
- package/dist/internal/protocol/zk/credentials/endorsements.d.ts.map +1 -0
- package/dist/internal/protocol/zk/credentials/endorsements.js +520 -0
- package/dist/internal/protocol/zk/credentials/endorsements.js.map +1 -0
- package/dist/internal/protocol/zk/credentials/index.d.ts +14 -0
- package/dist/internal/protocol/zk/credentials/index.d.ts.map +1 -0
- package/dist/internal/protocol/zk/credentials/index.js +6 -0
- package/dist/internal/protocol/zk/credentials/index.js.map +1 -0
- package/dist/internal/protocol/zk/credentials/issuance.d.ts +135 -0
- package/dist/internal/protocol/zk/credentials/issuance.d.ts.map +1 -0
- package/dist/internal/protocol/zk/credentials/issuance.js +338 -0
- package/dist/internal/protocol/zk/credentials/issuance.js.map +1 -0
- package/dist/internal/protocol/zk/credentials/presentation.d.ts +160 -0
- package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -0
- package/dist/internal/protocol/zk/credentials/presentation.js +447 -0
- package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -0
- package/dist/internal/protocol/zk/groups/auth-credential.d.ts +191 -0
- package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/auth-credential.js +377 -0
- package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -0
- package/dist/internal/protocol/zk/groups/client-zk-group-cipher.d.ts +73 -0
- package/dist/internal/protocol/zk/groups/client-zk-group-cipher.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/client-zk-group-cipher.js +140 -0
- package/dist/internal/protocol/zk/groups/client-zk-group-cipher.js.map +1 -0
- package/dist/internal/protocol/zk/groups/group-params.d.ts +93 -0
- package/dist/internal/protocol/zk/groups/group-params.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/group-params.js +184 -0
- package/dist/internal/protocol/zk/groups/group-params.js.map +1 -0
- package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts +245 -0
- package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/group-send-endorsement.js +404 -0
- package/dist/internal/protocol/zk/groups/group-send-endorsement.js.map +1 -0
- package/dist/internal/protocol/zk/groups/index.d.ts +19 -0
- package/dist/internal/protocol/zk/groups/index.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/index.js +12 -0
- package/dist/internal/protocol/zk/groups/index.js.map +1 -0
- package/dist/internal/protocol/zk/groups/lizard.d.ts +51 -0
- package/dist/internal/protocol/zk/groups/lizard.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/lizard.js +478 -0
- package/dist/internal/protocol/zk/groups/lizard.js.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts +35 -0
- package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-commitment.js +99 -0
- package/dist/internal/protocol/zk/groups/profile-key-commitment.js.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +195 -0
- package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-credential.js +370 -0
- package/dist/internal/protocol/zk/groups/profile-key-credential.js.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts +45 -0
- package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-encryption.js +125 -0
- package/dist/internal/protocol/zk/groups/profile-key-encryption.js.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-struct.d.ts +33 -0
- package/dist/internal/protocol/zk/groups/profile-key-struct.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-struct.js +62 -0
- package/dist/internal/protocol/zk/groups/profile-key-struct.js.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-version.d.ts +17 -0
- package/dist/internal/protocol/zk/groups/profile-key-version.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/profile-key-version.js +33 -0
- package/dist/internal/protocol/zk/groups/profile-key-version.js.map +1 -0
- package/dist/internal/protocol/zk/groups/server-params.d.ts +114 -0
- package/dist/internal/protocol/zk/groups/server-params.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/server-params.js +146 -0
- package/dist/internal/protocol/zk/groups/server-params.js.map +1 -0
- package/dist/internal/protocol/zk/groups/uid-encryption.d.ts +41 -0
- package/dist/internal/protocol/zk/groups/uid-encryption.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/uid-encryption.js +113 -0
- package/dist/internal/protocol/zk/groups/uid-encryption.js.map +1 -0
- package/dist/internal/protocol/zk/groups/uid-struct.d.ts +48 -0
- package/dist/internal/protocol/zk/groups/uid-struct.d.ts.map +1 -0
- package/dist/internal/protocol/zk/groups/uid-struct.js +77 -0
- package/dist/internal/protocol/zk/groups/uid-struct.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/args.d.ts +33 -0
- package/dist/internal/protocol/zk/proofs/args.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/args.js +43 -0
- package/dist/internal/protocol/zk/proofs/args.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/index.d.ts +13 -0
- package/dist/internal/protocol/zk/proofs/index.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/index.js +7 -0
- package/dist/internal/protocol/zk/proofs/index.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/proof.d.ts +30 -0
- package/dist/internal/protocol/zk/proofs/proof.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/proof.js +48 -0
- package/dist/internal/protocol/zk/proofs/proof.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/sho-sha256.d.ts +34 -0
- package/dist/internal/protocol/zk/proofs/sho-sha256.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/sho-sha256.js +138 -0
- package/dist/internal/protocol/zk/proofs/sho-sha256.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/sho.d.ts +120 -0
- package/dist/internal/protocol/zk/proofs/sho.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/sho.js +221 -0
- package/dist/internal/protocol/zk/proofs/sho.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/sign.d.ts +29 -0
- package/dist/internal/protocol/zk/proofs/sign.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/sign.js +34 -0
- package/dist/internal/protocol/zk/proofs/sign.js.map +1 -0
- package/dist/internal/protocol/zk/proofs/statement.d.ts +103 -0
- package/dist/internal/protocol/zk/proofs/statement.d.ts.map +1 -0
- package/dist/internal/protocol/zk/proofs/statement.js +282 -0
- package/dist/internal/protocol/zk/proofs/statement.js.map +1 -0
- package/dist/internal/sesame/device-registry.d.ts +208 -0
- package/dist/internal/sesame/device-registry.d.ts.map +1 -0
- package/dist/internal/sesame/device-registry.js +431 -0
- package/dist/internal/sesame/device-registry.js.map +1 -0
- package/dist/internal/sesame/index.d.ts +31 -0
- package/dist/internal/sesame/index.d.ts.map +1 -0
- package/dist/internal/sesame/index.js +40 -0
- package/dist/internal/sesame/index.js.map +1 -0
- package/dist/internal/sesame/manager.d.ts +351 -0
- package/dist/internal/sesame/manager.d.ts.map +1 -0
- package/dist/internal/sesame/manager.js +1760 -0
- package/dist/internal/sesame/manager.js.map +1 -0
- package/dist/internal/sesame/types.d.ts +840 -0
- package/dist/internal/sesame/types.d.ts.map +1 -0
- package/dist/internal/sesame/types.js +290 -0
- package/dist/internal/sesame/types.js.map +1 -0
- package/dist/internal/sesame/validation.d.ts +72 -0
- package/dist/internal/sesame/validation.d.ts.map +1 -0
- package/dist/internal/sesame/validation.js +136 -0
- package/dist/internal/sesame/validation.js.map +1 -0
- package/dist/internal/session/builder.d.ts +94 -0
- package/dist/internal/session/builder.d.ts.map +1 -0
- package/dist/internal/session/builder.js +266 -0
- package/dist/internal/session/builder.js.map +1 -0
- package/dist/internal/session/cipher.d.ts +256 -0
- package/dist/internal/session/cipher.d.ts.map +1 -0
- package/dist/internal/session/cipher.js +1222 -0
- package/dist/internal/session/cipher.js.map +1 -0
- package/dist/internal/session/decryption.d.ts +37 -0
- package/dist/internal/session/decryption.d.ts.map +1 -0
- package/dist/internal/session/decryption.js +256 -0
- package/dist/internal/session/decryption.js.map +1 -0
- package/dist/internal/session/factory.d.ts +161 -0
- package/dist/internal/session/factory.d.ts.map +1 -0
- package/dist/internal/session/factory.js +211 -0
- package/dist/internal/session/factory.js.map +1 -0
- package/dist/internal/session/handshake.d.ts +72 -0
- package/dist/internal/session/handshake.d.ts.map +1 -0
- package/dist/internal/session/handshake.js +343 -0
- package/dist/internal/session/handshake.js.map +1 -0
- package/dist/internal/session/identity-binding.d.ts +5 -0
- package/dist/internal/session/identity-binding.d.ts.map +1 -0
- package/dist/internal/session/identity-binding.js +15 -0
- package/dist/internal/session/identity-binding.js.map +1 -0
- package/dist/internal/session/index.d.ts +73 -0
- package/dist/internal/session/index.d.ts.map +1 -0
- package/dist/internal/session/index.js +75 -0
- package/dist/internal/session/index.js.map +1 -0
- package/dist/internal/session/keys.d.ts +220 -0
- package/dist/internal/session/keys.d.ts.map +1 -0
- package/dist/internal/session/keys.js +78 -0
- package/dist/internal/session/keys.js.map +1 -0
- package/dist/internal/session/ratchet.d.ts +97 -0
- package/dist/internal/session/ratchet.d.ts.map +1 -0
- package/dist/internal/session/ratchet.js +187 -0
- package/dist/internal/session/ratchet.js.map +1 -0
- package/dist/internal/session/session-resolver.d.ts +138 -0
- package/dist/internal/session/session-resolver.d.ts.map +1 -0
- package/dist/internal/session/session-resolver.js +190 -0
- package/dist/internal/session/session-resolver.js.map +1 -0
- package/dist/internal/session/state.d.ts +278 -0
- package/dist/internal/session/state.d.ts.map +1 -0
- package/dist/internal/session/state.js +167 -0
- package/dist/internal/session/state.js.map +1 -0
- package/dist/internal/session/types.d.ts +192 -0
- package/dist/internal/session/types.d.ts.map +1 -0
- package/dist/internal/session/types.js +16 -0
- package/dist/internal/session/types.js.map +1 -0
- package/dist/internal/session/validation.d.ts +145 -0
- package/dist/internal/session/validation.d.ts.map +1 -0
- package/dist/internal/session/validation.js +340 -0
- package/dist/internal/session/validation.js.map +1 -0
- package/dist/keys/branded.d.ts +85 -0
- package/dist/keys/branded.d.ts.map +1 -0
- package/dist/keys/branded.js +26 -0
- package/dist/keys/branded.js.map +1 -0
- package/dist/keys/generation.d.ts +101 -0
- package/dist/keys/generation.d.ts.map +1 -0
- package/dist/keys/generation.js +181 -0
- package/dist/keys/generation.js.map +1 -0
- package/dist/keys/identity.d.ts +27 -0
- package/dist/keys/identity.d.ts.map +1 -0
- package/dist/keys/identity.js +200 -0
- package/dist/keys/identity.js.map +1 -0
- package/dist/keys/index.d.ts +24 -0
- package/dist/keys/index.d.ts.map +1 -0
- package/dist/keys/index.js +22 -0
- package/dist/keys/index.js.map +1 -0
- package/dist/keys/prekey-signature.d.ts +13 -0
- package/dist/keys/prekey-signature.d.ts.map +1 -0
- package/dist/keys/prekey-signature.js +46 -0
- package/dist/keys/prekey-signature.js.map +1 -0
- package/dist/keys/types.d.ts +255 -0
- package/dist/keys/types.d.ts.map +1 -0
- package/dist/keys/types.js +11 -0
- package/dist/keys/types.js.map +1 -0
- package/dist/layers.d.ts +228 -0
- package/dist/layers.d.ts.map +1 -0
- package/dist/layers.js +328 -0
- package/dist/layers.js.map +1 -0
- package/dist/local/store/expo/adapter.d.ts +243 -0
- package/dist/local/store/expo/adapter.d.ts.map +1 -0
- package/dist/local/store/expo/adapter.js +619 -0
- package/dist/local/store/expo/adapter.js.map +1 -0
- package/dist/local/store/expo/database-key.d.ts +142 -0
- package/dist/local/store/expo/database-key.d.ts.map +1 -0
- package/dist/local/store/expo/database-key.js +312 -0
- package/dist/local/store/expo/database-key.js.map +1 -0
- package/dist/local/store/expo/db.d.ts +92 -0
- package/dist/local/store/expo/db.d.ts.map +1 -0
- package/dist/local/store/expo/db.js +142 -0
- package/dist/local/store/expo/db.js.map +1 -0
- package/dist/local/store/expo/index.d.ts +22 -0
- package/dist/local/store/expo/index.d.ts.map +1 -0
- package/dist/local/store/expo/index.js +10 -0
- package/dist/local/store/expo/index.js.map +1 -0
- package/dist/local/store/expo/key-storage.d.ts +422 -0
- package/dist/local/store/expo/key-storage.d.ts.map +1 -0
- package/dist/local/store/expo/key-storage.js +1292 -0
- package/dist/local/store/expo/key-storage.js.map +1 -0
- package/dist/local/store/expo/maintenance.d.ts +4 -0
- package/dist/local/store/expo/maintenance.d.ts.map +1 -0
- package/dist/local/store/expo/maintenance.js +36 -0
- package/dist/local/store/expo/maintenance.js.map +1 -0
- package/dist/local/store/expo/models/ec-one-time-prekey.d.ts +155 -0
- package/dist/local/store/expo/models/ec-one-time-prekey.d.ts.map +1 -0
- package/dist/local/store/expo/models/ec-one-time-prekey.js +309 -0
- package/dist/local/store/expo/models/ec-one-time-prekey.js.map +1 -0
- package/dist/local/store/expo/models/ec-signed-prekey.d.ts +189 -0
- package/dist/local/store/expo/models/ec-signed-prekey.d.ts.map +1 -0
- package/dist/local/store/expo/models/ec-signed-prekey.js +359 -0
- package/dist/local/store/expo/models/ec-signed-prekey.js.map +1 -0
- package/dist/local/store/expo/models/identity-key-id.d.ts +9 -0
- package/dist/local/store/expo/models/identity-key-id.d.ts.map +1 -0
- package/dist/local/store/expo/models/identity-key-id.js +10 -0
- package/dist/local/store/expo/models/identity-key-id.js.map +1 -0
- package/dist/local/store/expo/models/index.d.ts +20 -0
- package/dist/local/store/expo/models/index.d.ts.map +1 -0
- package/dist/local/store/expo/models/index.js +80 -0
- package/dist/local/store/expo/models/index.js.map +1 -0
- package/dist/local/store/expo/models/kyber-one-time-prekey.d.ts +183 -0
- package/dist/local/store/expo/models/kyber-one-time-prekey.d.ts.map +1 -0
- package/dist/local/store/expo/models/kyber-one-time-prekey.js +353 -0
- package/dist/local/store/expo/models/kyber-one-time-prekey.js.map +1 -0
- package/dist/local/store/expo/models/kyber-prekey-used.d.ts +37 -0
- package/dist/local/store/expo/models/kyber-prekey-used.d.ts.map +1 -0
- package/dist/local/store/expo/models/kyber-prekey-used.js +59 -0
- package/dist/local/store/expo/models/kyber-prekey-used.js.map +1 -0
- package/dist/local/store/expo/models/kyber-prekey.d.ts +172 -0
- package/dist/local/store/expo/models/kyber-prekey.d.ts.map +1 -0
- package/dist/local/store/expo/models/kyber-prekey.js +314 -0
- package/dist/local/store/expo/models/kyber-prekey.js.map +1 -0
- package/dist/local/store/expo/models/local-identity.d.ts +52 -0
- package/dist/local/store/expo/models/local-identity.d.ts.map +1 -0
- package/dist/local/store/expo/models/local-identity.js +166 -0
- package/dist/local/store/expo/models/local-identity.js.map +1 -0
- package/dist/local/store/expo/models/message-record.d.ts +198 -0
- package/dist/local/store/expo/models/message-record.d.ts.map +1 -0
- package/dist/local/store/expo/models/message-record.js +298 -0
- package/dist/local/store/expo/models/message-record.js.map +1 -0
- package/dist/local/store/expo/models/recipient-identity.d.ts +21 -0
- package/dist/local/store/expo/models/recipient-identity.d.ts.map +1 -0
- package/dist/local/store/expo/models/recipient-identity.js +66 -0
- package/dist/local/store/expo/models/recipient-identity.js.map +1 -0
- package/dist/local/store/expo/models/replaced-prekey-utils.d.ts +33 -0
- package/dist/local/store/expo/models/replaced-prekey-utils.d.ts.map +1 -0
- package/dist/local/store/expo/models/replaced-prekey-utils.js +54 -0
- package/dist/local/store/expo/models/replaced-prekey-utils.js.map +1 -0
- package/dist/local/store/expo/models/sender-key.d.ts +210 -0
- package/dist/local/store/expo/models/sender-key.d.ts.map +1 -0
- package/dist/local/store/expo/models/sender-key.js +379 -0
- package/dist/local/store/expo/models/sender-key.js.map +1 -0
- package/dist/local/store/expo/models/session.d.ts +175 -0
- package/dist/local/store/expo/models/session.d.ts.map +1 -0
- package/dist/local/store/expo/models/session.js +496 -0
- package/dist/local/store/expo/models/session.js.map +1 -0
- package/dist/local/store/expo/schema.d.ts +1734 -0
- package/dist/local/store/expo/schema.d.ts.map +1 -0
- package/dist/local/store/expo/schema.js +155 -0
- package/dist/local/store/expo/schema.js.map +1 -0
- package/dist/local/store/expo/secure-store-options.d.ts +10 -0
- package/dist/local/store/expo/secure-store-options.d.ts.map +1 -0
- package/dist/local/store/expo/secure-store-options.js +5 -0
- package/dist/local/store/expo/secure-store-options.js.map +1 -0
- package/dist/local/store/index.d.ts +41 -0
- package/dist/local/store/index.d.ts.map +1 -0
- package/dist/local/store/index.js +34 -0
- package/dist/local/store/index.js.map +1 -0
- package/dist/local/store/mock/adapter.d.ts +185 -0
- package/dist/local/store/mock/adapter.d.ts.map +1 -0
- package/dist/local/store/mock/adapter.js +875 -0
- package/dist/local/store/mock/adapter.js.map +1 -0
- package/dist/local/store/mock/index.d.ts +10 -0
- package/dist/local/store/mock/index.d.ts.map +1 -0
- package/dist/local/store/mock/index.js +6 -0
- package/dist/local/store/mock/index.js.map +1 -0
- package/dist/local/store/node/adapter.d.ts +85 -0
- package/dist/local/store/node/adapter.d.ts.map +1 -0
- package/dist/local/store/node/adapter.js +274 -0
- package/dist/local/store/node/adapter.js.map +1 -0
- package/dist/local/store/node/database-encryption.d.ts +109 -0
- package/dist/local/store/node/database-encryption.d.ts.map +1 -0
- package/dist/local/store/node/database-encryption.js +202 -0
- package/dist/local/store/node/database-encryption.js.map +1 -0
- package/dist/local/store/node/database-key.d.ts +124 -0
- package/dist/local/store/node/database-key.d.ts.map +1 -0
- package/dist/local/store/node/database-key.js +264 -0
- package/dist/local/store/node/database-key.js.map +1 -0
- package/dist/local/store/node/database.d.ts +156 -0
- package/dist/local/store/node/database.d.ts.map +1 -0
- package/dist/local/store/node/database.js +630 -0
- package/dist/local/store/node/database.js.map +1 -0
- package/dist/local/store/node/index.d.ts +11 -0
- package/dist/local/store/node/index.d.ts.map +1 -0
- package/dist/local/store/node/index.js +8 -0
- package/dist/local/store/node/index.js.map +1 -0
- package/dist/local/store/react-native/adapter.d.ts +240 -0
- package/dist/local/store/react-native/adapter.d.ts.map +1 -0
- package/dist/local/store/react-native/adapter.js +1108 -0
- package/dist/local/store/react-native/adapter.js.map +1 -0
- package/dist/local/store/react-native/index.d.ts +19 -0
- package/dist/local/store/react-native/index.d.ts.map +1 -0
- package/dist/local/store/react-native/index.js +6 -0
- package/dist/local/store/react-native/index.js.map +1 -0
- package/dist/local/store/react-native/storage.d.ts +39 -0
- package/dist/local/store/react-native/storage.d.ts.map +1 -0
- package/dist/local/store/react-native/storage.js +2 -0
- package/dist/local/store/react-native/storage.js.map +1 -0
- package/dist/local/store/session-codec.d.ts +5 -0
- package/dist/local/store/session-codec.d.ts.map +1 -0
- package/dist/local/store/session-codec.js +42 -0
- package/dist/local/store/session-codec.js.map +1 -0
- package/dist/local/store/web/adapter.d.ts +190 -0
- package/dist/local/store/web/adapter.d.ts.map +1 -0
- package/dist/local/store/web/adapter.js +1188 -0
- package/dist/local/store/web/adapter.js.map +1 -0
- package/dist/local/store/web/index.d.ts +11 -0
- package/dist/local/store/web/index.d.ts.map +1 -0
- package/dist/local/store/web/index.js +8 -0
- package/dist/local/store/web/index.js.map +1 -0
- package/dist/local/vault/expo-secure-store.d.ts +10 -0
- package/dist/local/vault/expo-secure-store.d.ts.map +1 -0
- package/dist/local/vault/expo-secure-store.js +23 -0
- package/dist/local/vault/expo-secure-store.js.map +1 -0
- package/dist/local/vault/index.d.ts +7 -0
- package/dist/local/vault/index.d.ts.map +1 -0
- package/dist/local/vault/index.js +2 -0
- package/dist/local/vault/index.js.map +1 -0
- package/dist/logger.d.ts +18 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +71 -0
- package/dist/logger.js.map +1 -0
- package/dist/media/index.d.ts +524 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +2053 -0
- package/dist/media/index.js.map +1 -0
- package/dist/profile/cipher.d.ts +125 -0
- package/dist/profile/cipher.d.ts.map +1 -0
- package/dist/profile/cipher.js +197 -0
- package/dist/profile/cipher.js.map +1 -0
- package/dist/profile/contact-state.d.ts +33 -0
- package/dist/profile/contact-state.d.ts.map +1 -0
- package/dist/profile/contact-state.js +77 -0
- package/dist/profile/contact-state.js.map +1 -0
- package/dist/profile/crypto.d.ts +65 -0
- package/dist/profile/crypto.d.ts.map +1 -0
- package/dist/profile/crypto.js +93 -0
- package/dist/profile/crypto.js.map +1 -0
- package/dist/profile/index.d.ts +26 -0
- package/dist/profile/index.d.ts.map +1 -0
- package/dist/profile/index.js +30 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/profile/profile-key.d.ts +102 -0
- package/dist/profile/profile-key.d.ts.map +1 -0
- package/dist/profile/profile-key.js +229 -0
- package/dist/profile/profile-key.js.map +1 -0
- package/dist/profile/storage.d.ts +61 -0
- package/dist/profile/storage.d.ts.map +1 -0
- package/dist/profile/storage.js +145 -0
- package/dist/profile/storage.js.map +1 -0
- package/dist/profile/update-service.d.ts +53 -0
- package/dist/profile/update-service.d.ts.map +1 -0
- package/dist/profile/update-service.js +67 -0
- package/dist/profile/update-service.js.map +1 -0
- package/dist/remote/object-store/convex-r2/index.d.ts +11 -0
- package/dist/remote/object-store/convex-r2/index.d.ts.map +1 -0
- package/dist/remote/object-store/convex-r2/index.js +13 -0
- package/dist/remote/object-store/convex-r2/index.js.map +1 -0
- package/dist/remote/object-store/convex-r2/server/index.d.ts +2 -0
- package/dist/remote/object-store/convex-r2/server/index.d.ts.map +1 -0
- package/dist/remote/object-store/convex-r2/server/index.js +2 -0
- package/dist/remote/object-store/convex-r2/server/index.js.map +1 -0
- package/dist/remote/object-store/convex-r2/server.d.ts +126 -0
- package/dist/remote/object-store/convex-r2/server.d.ts.map +1 -0
- package/dist/remote/object-store/convex-r2/server.js +232 -0
- package/dist/remote/object-store/convex-r2/server.js.map +1 -0
- package/dist/remote/object-store/convex-r2/storage.d.ts +47 -0
- package/dist/remote/object-store/convex-r2/storage.d.ts.map +1 -0
- package/dist/remote/object-store/convex-r2/storage.js +55 -0
- package/dist/remote/object-store/convex-r2/storage.js.map +1 -0
- package/dist/remote/object-store/index.d.ts +8 -0
- package/dist/remote/object-store/index.d.ts.map +1 -0
- package/dist/remote/object-store/index.js +2 -0
- package/dist/remote/object-store/index.js.map +1 -0
- package/dist/remote/object-store/s3/index.d.ts +8 -0
- package/dist/remote/object-store/s3/index.d.ts.map +1 -0
- package/dist/remote/object-store/s3/index.js +10 -0
- package/dist/remote/object-store/s3/index.js.map +1 -0
- package/dist/remote/object-store/s3/storage.d.ts +44 -0
- package/dist/remote/object-store/s3/storage.d.ts.map +1 -0
- package/dist/remote/object-store/s3/storage.js +41 -0
- package/dist/remote/object-store/s3/storage.js.map +1 -0
- package/dist/remote/object-store/types.d.ts +80 -0
- package/dist/remote/object-store/types.d.ts.map +1 -0
- package/dist/remote/object-store/types.js +2 -0
- package/dist/remote/object-store/types.js.map +1 -0
- package/dist/remote/object-store/validation.d.ts +6 -0
- package/dist/remote/object-store/validation.d.ts.map +1 -0
- package/dist/remote/object-store/validation.js +93 -0
- package/dist/remote/object-store/validation.js.map +1 -0
- package/dist/remote/relay/convex/group-server.d.ts +118 -0
- package/dist/remote/relay/convex/group-server.d.ts.map +1 -0
- package/dist/remote/relay/convex/group-server.js +150 -0
- package/dist/remote/relay/convex/group-server.js.map +1 -0
- package/dist/remote/relay/convex/index.d.ts +39 -0
- package/dist/remote/relay/convex/index.d.ts.map +1 -0
- package/dist/remote/relay/convex/index.js +36 -0
- package/dist/remote/relay/convex/index.js.map +1 -0
- package/dist/remote/relay/convex/relay.d.ts +339 -0
- package/dist/remote/relay/convex/relay.d.ts.map +1 -0
- package/dist/remote/relay/convex/relay.js +1086 -0
- package/dist/remote/relay/convex/relay.js.map +1 -0
- package/dist/remote/relay/convex/types.d.ts +111 -0
- package/dist/remote/relay/convex/types.d.ts.map +1 -0
- package/dist/remote/relay/convex/types.js +19 -0
- package/dist/remote/relay/convex/types.js.map +1 -0
- package/dist/remote/relay/index.d.ts +34 -0
- package/dist/remote/relay/index.d.ts.map +1 -0
- package/dist/remote/relay/index.js +28 -0
- package/dist/remote/relay/index.js.map +1 -0
- package/dist/remote/relay/mock/adapter.d.ts +237 -0
- package/dist/remote/relay/mock/adapter.d.ts.map +1 -0
- package/dist/remote/relay/mock/adapter.js +939 -0
- package/dist/remote/relay/mock/adapter.js.map +1 -0
- package/dist/remote/relay/mock/index.d.ts +10 -0
- package/dist/remote/relay/mock/index.d.ts.map +1 -0
- package/dist/remote/relay/mock/index.js +6 -0
- package/dist/remote/relay/mock/index.js.map +1 -0
- package/dist/remote/relay/types.d.ts +756 -0
- package/dist/remote/relay/types.d.ts.map +1 -0
- package/dist/remote/relay/types.js +11 -0
- package/dist/remote/relay/types.js.map +1 -0
- package/dist/safety/core.d.ts +108 -0
- package/dist/safety/core.d.ts.map +1 -0
- package/dist/safety/core.js +299 -0
- package/dist/safety/core.js.map +1 -0
- package/dist/safety/fingerprint.d.ts +277 -0
- package/dist/safety/fingerprint.d.ts.map +1 -0
- package/dist/safety/fingerprint.js +339 -0
- package/dist/safety/fingerprint.js.map +1 -0
- package/dist/safety/index.d.ts +141 -0
- package/dist/safety/index.d.ts.map +1 -0
- package/dist/safety/index.js +230 -0
- package/dist/safety/index.js.map +1 -0
- package/dist/safety/protobuf.d.ts +34 -0
- package/dist/safety/protobuf.d.ts.map +1 -0
- package/dist/safety/protobuf.js +142 -0
- package/dist/safety/protobuf.js.map +1 -0
- package/dist/safety/url.d.ts +133 -0
- package/dist/safety/url.d.ts.map +1 -0
- package/dist/safety/url.js +242 -0
- package/dist/safety/url.js.map +1 -0
- package/dist/sealed-sender/index.d.ts +7 -0
- package/dist/sealed-sender/index.d.ts.map +1 -0
- package/dist/sealed-sender/index.js +6 -0
- package/dist/sealed-sender/index.js.map +1 -0
- package/dist/server-clock.d.ts +10 -0
- package/dist/server-clock.d.ts.map +1 -0
- package/dist/server-clock.js +27 -0
- package/dist/server-clock.js.map +1 -0
- package/dist/types/address.d.ts +171 -0
- package/dist/types/address.d.ts.map +1 -0
- package/dist/types/address.js +241 -0
- package/dist/types/address.js.map +1 -0
- package/dist/types/api.d.ts +1222 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +5 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/errors.d.ts +772 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +937 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +33 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/messages.d.ts +257 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/messages.js +96 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/protocol-config.d.ts +337 -0
- package/dist/types/protocol-config.d.ts.map +1 -0
- package/dist/types/protocol-config.js +178 -0
- package/dist/types/protocol-config.js.map +1 -0
- package/dist/types/protocol-constants.d.ts +122 -0
- package/dist/types/protocol-constants.d.ts.map +1 -0
- package/dist/types/protocol-constants.js +115 -0
- package/dist/types/protocol-constants.js.map +1 -0
- package/dist/types/session.d.ts +721 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +340 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/trust.d.ts +168 -0
- package/dist/types/trust.d.ts.map +1 -0
- package/dist/types/trust.js +84 -0
- package/dist/types/trust.js.map +1 -0
- package/dist/types/utils.d.ts +93 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +89 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/username/index.d.ts +12 -0
- package/dist/username/index.d.ts.map +1 -0
- package/dist/username/index.js +11 -0
- package/dist/username/index.js.map +1 -0
- package/dist/username/link.d.ts +52 -0
- package/dist/username/link.d.ts.map +1 -0
- package/dist/username/link.js +87 -0
- package/dist/username/link.js.map +1 -0
- package/dist/utils/binary-transfer.d.ts +18 -0
- package/dist/utils/binary-transfer.d.ts.map +1 -0
- package/dist/utils/binary-transfer.js +27 -0
- package/dist/utils/binary-transfer.js.map +1 -0
- package/dist/utils/errors.d.ts +9 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +15 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/retry.d.ts +59 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +136 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/versions.d.ts +62 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +78 -0
- package/dist/versions.js.map +1 -0
- package/dist/zk/credentials.d.ts +10 -0
- package/dist/zk/credentials.d.ts.map +1 -0
- package/dist/zk/credentials.js +9 -0
- package/dist/zk/credentials.js.map +1 -0
- package/dist/zk/groups.d.ts +12 -0
- package/dist/zk/groups.d.ts.map +1 -0
- package/dist/zk/groups.js +11 -0
- package/dist/zk/groups.js.map +1 -0
- package/docs/ASSURANCE.md +102 -0
- package/docs/CLIENT_COMPOSITION.md +189 -0
- package/docs/DOCUMENTATION_STANDARDS.md +107 -0
- package/docs/E2EE.md +35 -0
- package/docs/ERROR_HANDLING.md +396 -0
- package/docs/GETTING_STARTED.md +714 -0
- package/docs/INTERFACES.md +187 -0
- package/docs/PACKAGE_SURFACE.md +235 -0
- package/docs/PROTOCOL_POLICY.md +109 -0
- package/docs/RECIPES.md +389 -0
- package/docs/SECURITY.md +199 -0
- package/docs/api/README.md +471 -0
- package/docs/api/classes/EncryptionError.md +112 -0
- package/docs/api/classes/EndorsementManager.md +307 -0
- package/docs/api/classes/SealedSenderAuthError.md +127 -0
- package/docs/api/classes/ServerDerivedKeyPair.md +68 -0
- package/docs/api/classes/ServerDerivedPublicKey.md +33 -0
- package/docs/api/classes/ServerRootKeyPair.md +94 -0
- package/docs/api/classes/ServerRootPublicKey.md +72 -0
- package/docs/api/classes/SignalBlockingManager.md +106 -0
- package/docs/api/classes/SignalProtocolClient.md +2651 -0
- package/docs/api/classes/VerificationFailure.md +25 -0
- package/docs/api/enumerations/ContentHint.md +63 -0
- package/docs/api/enumerations/EncryptionErrorCode.md +488 -0
- package/docs/api/enumerations/IdentityKeyChange.md +65 -0
- package/docs/api/enumerations/MessageType.md +29 -0
- package/docs/api/enumerations/TrustDirection.md +33 -0
- package/docs/api/enumerations/TypingAction.md +31 -0
- package/docs/api/functions/createDefaultSignalContentAdapter.md +13 -0
- package/docs/api/functions/createDefaultSignalLogger.md +36 -0
- package/docs/api/functions/createGroupId.md +32 -0
- package/docs/api/functions/createSignalProtocolClient.md +36 -0
- package/docs/api/functions/createSignalProtocolClientConfig.md +24 -0
- package/docs/api/functions/extractGroupId.md +32 -0
- package/docs/api/functions/formatVersion.md +25 -0
- package/docs/api/functions/isCompatible.md +31 -0
- package/docs/api/functions/isGroupId.md +37 -0
- package/docs/api/functions/isSealedSenderAuthError.md +25 -0
- package/docs/api/functions/parseVersion.md +29 -0
- package/docs/api/functions/resolveSPQRLimits.md +21 -0
- package/docs/api/functions/resolveSignalLogger.md +42 -0
- package/docs/api/interfaces/AccountIdentityProvisioning.md +43 -0
- package/docs/api/interfaces/AccountIdentityRotation.md +69 -0
- package/docs/api/interfaces/AttachmentTransferOptions.md +49 -0
- package/docs/api/interfaces/BlockedRecipientEntry.md +25 -0
- package/docs/api/interfaces/BlockedRecipientsSyncInput.md +27 -0
- package/docs/api/interfaces/ConfigurationSyncInput.md +19 -0
- package/docs/api/interfaces/CredentialPublicKey.md +25 -0
- package/docs/api/interfaces/DataMessageInput.md +21 -0
- package/docs/api/interfaces/DecryptedEnvelope.md +95 -0
- package/docs/api/interfaces/DecryptedGroup.md +86 -0
- package/docs/api/interfaces/DeviceInfo.md +79 -0
- package/docs/api/interfaces/DeviceRecord.md +87 -0
- package/docs/api/interfaces/DeviceRegistration.md +27 -0
- package/docs/api/interfaces/DoubleRatchetConfig.md +36 -0
- package/docs/api/interfaces/EcOneTimePreKey.md +27 -0
- package/docs/api/interfaces/EcSignedPreKey.md +39 -0
- package/docs/api/interfaces/EcSignedPreKeyUpload.md +50 -0
- package/docs/api/interfaces/EncryptionErrorContext.md +51 -0
- package/docs/api/interfaces/Envelope.md +154 -0
- package/docs/api/interfaces/ForceKeyResetResult.md +37 -0
- package/docs/api/interfaces/GroupAuthorization.md +23 -0
- package/docs/api/interfaces/GroupChangeEntry.md +42 -0
- package/docs/api/interfaces/GroupMemberDevice.md +26 -0
- package/docs/api/interfaces/IEcOneTimePreKeyStore.md +86 -0
- package/docs/api/interfaces/IEcSignedPreKeyStore.md +132 -0
- package/docs/api/interfaces/IGroupServer.md +120 -0
- package/docs/api/interfaces/IGroupStateStore.md +128 -0
- package/docs/api/interfaces/IIdentityKeyStore.md +312 -0
- package/docs/api/interfaces/IKemPreKeyStore.md +144 -0
- package/docs/api/interfaces/IKyberLastResortPreKeyStore.md +111 -0
- package/docs/api/interfaces/ILogger.md +117 -0
- package/docs/api/interfaces/IProtocolStore.md +1033 -0
- package/docs/api/interfaces/ISenderKeyStore.md +417 -0
- package/docs/api/interfaces/ISesameStore.md +249 -0
- package/docs/api/interfaces/ISessionStore.md +178 -0
- package/docs/api/interfaces/ISignalLocalSecretVault.md +71 -0
- package/docs/api/interfaces/ISignalLocalStore.md +2053 -0
- package/docs/api/interfaces/ISignalProtocolClient.md +1183 -0
- package/docs/api/interfaces/ISignalProtocolManager.md +272 -0
- package/docs/api/interfaces/ISignalRelayServer.md +1329 -0
- package/docs/api/interfaces/IdentityKeyPair.md +49 -0
- package/docs/api/interfaces/IncomingEnvelope.md +91 -0
- package/docs/api/interfaces/InspectedSignalContent.md +43 -0
- package/docs/api/interfaces/KDFChain.md +31 -0
- package/docs/api/interfaces/KemLastResortPreKeyUpload.md +50 -0
- package/docs/api/interfaces/KeyPair.md +23 -0
- package/docs/api/interfaces/KyberPreKey.md +42 -0
- package/docs/api/interfaces/MLKEMBraidAgentState.md +191 -0
- package/docs/api/interfaces/MLKEMBraidMessage.md +49 -0
- package/docs/api/interfaces/MediaAttachmentDeleteSyncInput.md +31 -0
- package/docs/api/interfaces/MessageHeader.md +49 -0
- package/docs/api/interfaces/MessageRecord.md +86 -0
- package/docs/api/interfaces/ParsedReceiptContent.md +19 -0
- package/docs/api/interfaces/ParsedTypingContent.md +19 -0
- package/docs/api/interfaces/PreKeyMaintenanceStore.md +87 -0
- package/docs/api/interfaces/PreKeyMessage.md +159 -0
- package/docs/api/interfaces/PreKeyStatusResult.md +21 -0
- package/docs/api/interfaces/PreKeyUpload.md +42 -0
- package/docs/api/interfaces/ProcessEnvelopeOptions.md +72 -0
- package/docs/api/interfaces/ProtocolAddress.md +38 -0
- package/docs/api/interfaces/ProtocolStrategyConfig.md +91 -0
- package/docs/api/interfaces/RatchetMessage.md +96 -0
- package/docs/api/interfaces/ReadSyncEntryInput.md +19 -0
- package/docs/api/interfaces/ReceiverChain.md +43 -0
- package/docs/api/interfaces/RecipientUsernameSyncInput.md +31 -0
- package/docs/api/interfaces/RelayPreKeyBundle.md +254 -0
- package/docs/api/interfaces/RemoteObjectDownload.md +33 -0
- package/docs/api/interfaces/RemoteObjectUpload.md +49 -0
- package/docs/api/interfaces/ResolvedSPQRInfoStrings.md +27 -0
- package/docs/api/interfaces/ResolvedSPQRLimits.md +37 -0
- package/docs/api/interfaces/RetryRequest.md +80 -0
- package/docs/api/interfaces/SCKAState.md +65 -0
- package/docs/api/interfaces/SPQRLimits.md +40 -0
- package/docs/api/interfaces/SPQRState.md +191 -0
- package/docs/api/interfaces/SafetyNumber.md +60 -0
- package/docs/api/interfaces/SafetyNumberConfirmation.md +46 -0
- package/docs/api/interfaces/SealedSenderConfig.md +70 -0
- package/docs/api/interfaces/SendOptions.md +191 -0
- package/docs/api/interfaces/SendResult.md +93 -0
- package/docs/api/interfaces/SenderKeyDistributionMessage.md +43 -0
- package/docs/api/interfaces/SenderKeyState.md +76 -0
- package/docs/api/interfaces/SenderKeysConfig.md +65 -0
- package/docs/api/interfaces/SentSyncTranscriptInput.md +31 -0
- package/docs/api/interfaces/ServiceId.md +19 -0
- package/docs/api/interfaces/SesameMessage.md +84 -0
- package/docs/api/interfaces/SesameStats.md +57 -0
- package/docs/api/interfaces/SessionHealthResult.md +120 -0
- package/docs/api/interfaces/SessionRecord.md +80 -0
- package/docs/api/interfaces/SessionRecordMetadata.md +109 -0
- package/docs/api/interfaces/SessionState.md +368 -0
- package/docs/api/interfaces/SessionTrustCommit.md +58 -0
- package/docs/api/interfaces/SignalBlockingHooks.md +44 -0
- package/docs/api/interfaces/SignalBlockingManagerOptions.md +31 -0
- package/docs/api/interfaces/SignalBlockingMirror.md +30 -0
- package/docs/api/interfaces/SignalBlockingStore.md +83 -0
- package/docs/api/interfaces/SignalContentAdapter.md +325 -0
- package/docs/api/interfaces/SignalProtocolClientAdapterConfig.md +44 -0
- package/docs/api/interfaces/SignalProtocolClientCompositionOptions.md +693 -0
- package/docs/api/interfaces/SignalProtocolClientConfig.md +839 -0
- package/docs/api/interfaces/SignalProtocolClientDeleteLocalAttachmentInput.md +25 -0
- package/docs/api/interfaces/SignalProtocolClientHooks.md +506 -0
- package/docs/api/interfaces/SignalProtocolClientIdentityConfig.md +35 -0
- package/docs/api/interfaces/SignalProtocolClientLoadLocalAttachmentInput.md +187 -0
- package/docs/api/interfaces/SignalProtocolClientLoadedLocalAttachment.md +19 -0
- package/docs/api/interfaces/SignalProtocolClientMedia.md +83 -0
- package/docs/api/interfaces/SignalProtocolClientMediaCompletedResult.md +25 -0
- package/docs/api/interfaces/SignalProtocolClientMediaConfig.md +157 -0
- package/docs/api/interfaces/SignalProtocolClientMediaDownloadCompletedResult.md +37 -0
- package/docs/api/interfaces/SignalProtocolClientMediaDownloadNotNeededResult.md +25 -0
- package/docs/api/interfaces/SignalProtocolClientMediaFailedResult.md +19 -0
- package/docs/api/interfaces/SignalProtocolClientMediaOperationOptions.md +53 -0
- package/docs/api/interfaces/SignalProtocolClientMediaPendingResult.md +19 -0
- package/docs/api/interfaces/SignalProtocolClientMediaProcessResult.md +43 -0
- package/docs/api/interfaces/SignalProtocolClientMediaSkippedResult.md +25 -0
- package/docs/api/interfaces/SignalProtocolClientMediaUploadCompletedResult.md +31 -0
- package/docs/api/interfaces/SignalProtocolClientProcessPendingMediaOptions.md +87 -0
- package/docs/api/interfaces/SignalProtocolClientSaveDownloadedAttachmentInput.md +25 -0
- package/docs/api/interfaces/SignalProtocolClientSaveUploadedAttachmentInput.md +25 -0
- package/docs/api/interfaces/SignalProtocolClientSyncDeleteInput.md +19 -0
- package/docs/api/interfaces/SignalProtocolConfig.md +50 -0
- package/docs/api/interfaces/SignalRemoteObjectStore.md +88 -0
- package/docs/api/interfaces/SkippedSenderMessageKey.md +26 -0
- package/docs/api/interfaces/TaskNotificationAckSyncInput.md +31 -0
- package/docs/api/interfaces/TripleRatchetState.md +64 -0
- package/docs/api/interfaces/UserRecord.md +71 -0
- package/docs/api/interfaces/UsernameStateSyncInput.md +19 -0
- package/docs/api/interfaces/VerificationStateSyncInput.md +31 -0
- package/docs/api/interfaces/VersionNegotiationState.md +84 -0
- package/docs/api/interfaces/ViewOnceOpenSyncInput.md +19 -0
- package/docs/api/namespaces/ProtocolAddress/README.md +33 -0
- package/docs/api/namespaces/ProtocolAddress/functions/create.md +41 -0
- package/docs/api/namespaces/ProtocolAddress/functions/equals.md +39 -0
- package/docs/api/namespaces/ProtocolAddress/functions/fromStorageKey.md +36 -0
- package/docs/api/namespaces/ProtocolAddress/functions/isUser.md +39 -0
- package/docs/api/namespaces/ProtocolAddress/functions/isValid.md +34 -0
- package/docs/api/namespaces/ProtocolAddress/functions/parse.md +41 -0
- package/docs/api/namespaces/ProtocolAddress/functions/toStorageKey.md +38 -0
- package/docs/api/namespaces/ProtocolAddress/functions/toString.md +34 -0
- package/docs/api/namespaces/SessionRecord/README.md +30 -0
- package/docs/api/namespaces/SessionRecord/functions/archiveCurrent.md +40 -0
- package/docs/api/namespaces/SessionRecord/functions/archiveCurrentState.md +34 -0
- package/docs/api/namespaces/SessionRecord/functions/create.md +25 -0
- package/docs/api/namespaces/SessionRecord/functions/deserialize.md +29 -0
- package/docs/api/namespaces/SessionRecord/functions/findSession.md +34 -0
- package/docs/api/namespaces/SessionRecord/functions/getAllSessions.md +25 -0
- package/docs/api/namespaces/SessionRecord/functions/getArchivedCount.md +25 -0
- package/docs/api/namespaces/SessionRecord/functions/hasCurrentSession.md +25 -0
- package/docs/api/namespaces/SessionRecord/functions/hasUsableSenderChain.md +36 -0
- package/docs/api/namespaces/SessionRecord/functions/promoteSession.md +34 -0
- package/docs/api/namespaces/SessionRecord/functions/serialize.md +28 -0
- package/docs/api/namespaces/SessionRecord/variables/MAX_ARCHIVED_SESSIONS.md +14 -0
- package/docs/api/namespaces/SessionState/README.md +15 -0
- package/docs/api/namespaces/SessionState/functions/getSessionId.md +32 -0
- package/docs/api/namespaces/blocking/README.md +43 -0
- package/docs/api/namespaces/encoding/README.md +33 -0
- package/docs/api/namespaces/encoding/functions/base64ToUrlSafe.md +28 -0
- package/docs/api/namespaces/encoding/functions/bytesToBase64.md +21 -0
- package/docs/api/namespaces/encoding/functions/bytesToString.md +21 -0
- package/docs/api/namespaces/encoding/functions/bytesToUrlSafeBase64.md +33 -0
- package/docs/api/namespaces/encoding/functions/concatBytes.md +21 -0
- package/docs/api/namespaces/encoding/functions/stringToBytes.md +21 -0
- package/docs/api/namespaces/encoding/functions/urlSafeToBase64.md +27 -0
- package/docs/api/namespaces/keys/README.md +126 -0
- package/docs/api/namespaces/keys/functions/acceptContactIdentityRotation.md +33 -0
- package/docs/api/namespaces/keys/functions/assertIdentityCommitment.md +25 -0
- package/docs/api/namespaces/keys/functions/compositeIdentitiesEqual.md +23 -0
- package/docs/api/namespaces/keys/functions/createCompositeIdentityV1.md +19 -0
- package/docs/api/namespaces/keys/functions/createPreKeySignatureContext.md +31 -0
- package/docs/api/namespaces/keys/functions/createUnverifiedContactIdentityRecord.md +23 -0
- package/docs/api/namespaces/keys/functions/decodeCompositeIdentityV1.md +19 -0
- package/docs/api/namespaces/keys/functions/deriveIdentityCommitment.md +19 -0
- package/docs/api/namespaces/keys/functions/encodeCompositeIdentityV1.md +19 -0
- package/docs/api/namespaces/keys/functions/evaluateContactIdentityCandidate.md +27 -0
- package/docs/api/namespaces/keys/functions/generateEcOneTimePreKeys.md +37 -0
- package/docs/api/namespaces/keys/functions/generateEcSignedPreKey.md +39 -0
- package/docs/api/namespaces/keys/functions/generateEcSignedPreKeyId.md +21 -0
- package/docs/api/namespaces/keys/functions/generateIdentityKeyPair.md +24 -0
- package/docs/api/namespaces/keys/functions/generateKemOneTimePreKeys.md +47 -0
- package/docs/api/namespaces/keys/functions/generateKyberLastResortPreKey.md +37 -0
- package/docs/api/namespaces/keys/functions/generateRegistrationId.md +13 -0
- package/docs/api/namespaces/keys/functions/signMlKem1024PreKey.md +29 -0
- package/docs/api/namespaces/keys/functions/signPreKey.md +31 -0
- package/docs/api/namespaces/keys/functions/validateContactIdentityRecord.md +19 -0
- package/docs/api/namespaces/keys/functions/verifyContactIdentityRecord.md +31 -0
- package/docs/api/namespaces/keys/functions/verifyMlKem1024PreKey.md +33 -0
- package/docs/api/namespaces/keys/functions/verifyPreKeySignature.md +35 -0
- package/docs/api/namespaces/keys/interfaces/CompositeIdentityV1.md +33 -0
- package/docs/api/namespaces/keys/interfaces/ContactIdentityRecord.md +53 -0
- package/docs/api/namespaces/keys/interfaces/KemOneTimePreKey.md +43 -0
- package/docs/api/namespaces/keys/type-aliases/IdentityCandidateStatus.md +9 -0
- package/docs/api/namespaces/keys/type-aliases/IdentityTrustState.md +9 -0
- package/docs/api/namespaces/keys/type-aliases/IdentityType.md +9 -0
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_ED25519_TAG.md +9 -0
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_LENGTH.md +9 -0
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_VERSION.md +9 -0
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_X25519_TAG.md +9 -0
- package/docs/api/namespaces/keys/variables/IDENTITY_COMMITMENT_V1_DOMAIN.md +9 -0
- package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_ML_KEM_1024.md +9 -0
- package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_X25519.md +9 -0
- package/docs/api/namespaces/keys/variables/PREKEY_SIGNATURE_V1_DOMAIN.md +9 -0
- package/docs/api/namespaces/media/README.md +105 -0
- package/docs/api/namespaces/media/classes/MediaAttachmentError.md +57 -0
- package/docs/api/namespaces/media/functions/createByteRangeMediaAttachmentTransfer.md +19 -0
- package/docs/api/namespaces/media/functions/createMediaAttachmentDeliveryId.md +29 -0
- package/docs/api/namespaces/media/functions/createMediaAttachmentId.md +19 -0
- package/docs/api/namespaces/media/functions/createMediaAttachmentMessage.md +25 -0
- package/docs/api/namespaces/media/functions/createMediaAttachmentPointer.md +19 -0
- package/docs/api/namespaces/media/functions/createTusMediaAttachmentTransfer.md +19 -0
- package/docs/api/namespaces/media/functions/deleteMediaAttachment.md +23 -0
- package/docs/api/namespaces/media/functions/executeMediaAttachmentJob.md +23 -0
- package/docs/api/namespaces/media/functions/isMediaAttachmentFlagSet.md +19 -0
- package/docs/api/namespaces/media/functions/parseMediaAttachmentMessage.md +19 -0
- package/docs/api/namespaces/media/functions/planMediaAttachmentCleanup.md +23 -0
- package/docs/api/namespaces/media/functions/planMediaAttachmentCleanupJobs.md +19 -0
- package/docs/api/namespaces/media/functions/planMediaAttachmentDeleteSync.md +19 -0
- package/docs/api/namespaces/media/functions/planMediaAttachmentDownloadJob.md +19 -0
- package/docs/api/namespaces/media/functions/planMediaAttachmentOpen.md +19 -0
- package/docs/api/namespaces/media/functions/planMediaAttachmentProcessing.md +19 -0
- package/docs/api/namespaces/media/functions/planMediaAttachmentUploadJob.md +19 -0
- package/docs/api/namespaces/media/functions/prepareMediaAttachmentUpload.md +30 -0
- package/docs/api/namespaces/media/functions/resolveMediaAttachment.md +30 -0
- package/docs/api/namespaces/media/functions/serializeMediaAttachmentMessage.md +25 -0
- package/docs/api/namespaces/media/functions/validateMediaAttachmentPolicy.md +23 -0
- package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentPartialStore.md +68 -0
- package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentTransferOptions.md +91 -0
- package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentOptions.md +25 -0
- package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentResult.md +19 -0
- package/docs/api/namespaces/media/interfaces/ExecuteMediaAttachmentJobOptions.md +157 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentBackgroundJob.md +85 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentCleanupPlan.md +37 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentJobExecutionResult.md +55 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentMessage.md +31 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentOpenDecision.md +31 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentPointer.md +133 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentPolicy.md +67 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentProcessingPlan.md +73 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentProgress.md +69 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentResumeState.md +37 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentRetryOptions.md +31 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentTransfer.md +51 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferCheckpoint.md +69 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferOptions.md +67 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadJobData.md +19 -0
- package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadResponse.md +25 -0
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentCleanupJobsInput.md +61 -0
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDeleteSyncInput.md +25 -0
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDownloadJobInput.md +161 -0
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentOpenInput.md +25 -0
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentProcessingInput.md +83 -0
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentUploadJobInput.md +147 -0
- package/docs/api/namespaces/media/interfaces/PrepareMediaAttachmentUploadOptions.md +144 -0
- package/docs/api/namespaces/media/interfaces/ResolveMediaAttachmentOptions.md +55 -0
- package/docs/api/namespaces/media/interfaces/ResolvedMediaAttachment.md +109 -0
- package/docs/api/namespaces/media/interfaces/TusMediaAttachmentTransferOptions.md +85 -0
- package/docs/api/namespaces/media/type-aliases/CreateMediaAttachmentPointerInput.md +15 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentCheckpointCallback.md +19 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentCleanupReason.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentErrorCode.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentFlag.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobExecutionStatus.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobOperation.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobPriority.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSkipReason.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSource.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentKnownIds.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentMessageType.md +9 -0
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentProgressCallback.md +19 -0
- package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_DEFAULTS.md +47 -0
- package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_PRESETS.md +95 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentCleanupReason.md +27 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentErrorCode.md +75 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentFlag.md +23 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentJobExecutionStatus.md +19 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentJobOperation.md +31 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentJobPriority.md +23 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentJobSource.md +51 -0
- package/docs/api/namespaces/media/variables/MediaAttachmentMessageType.md +15 -0
- package/docs/api/namespaces/media/variables/downloadMediaAttachment.md +30 -0
- package/docs/api/namespaces/safety/README.md +61 -0
- package/docs/api/namespaces/safety/classes/DisplayableFingerprint.md +108 -0
- package/docs/api/namespaces/safety/classes/Fingerprint.md +104 -0
- package/docs/api/namespaces/safety/classes/ScannableFingerprint.md +209 -0
- package/docs/api/namespaces/safety/functions/base64ToBytes.md +21 -0
- package/docs/api/namespaces/safety/functions/clearFingerprintCache.md +15 -0
- package/docs/api/namespaces/safety/functions/compareSafetyNumbers.md +25 -0
- package/docs/api/namespaces/safety/functions/createFingerprintData.md +60 -0
- package/docs/api/namespaces/safety/functions/extractQrData.md +34 -0
- package/docs/api/namespaces/safety/functions/generateCompositeSafetyNumber.md +39 -0
- package/docs/api/namespaces/safety/functions/generateEmojiFingerprint.md +24 -0
- package/docs/api/namespaces/safety/functions/generateSingleKeyReferenceSafetyNumber.md +51 -0
- package/docs/api/namespaces/safety/functions/generateVerifySchemeUrl.md +32 -0
- package/docs/api/namespaces/safety/functions/generateVerifyUrl.md +49 -0
- package/docs/api/namespaces/safety/functions/isValidSafetyNumber.md +21 -0
- package/docs/api/namespaces/safety/functions/isVerifyUrl.md +45 -0
- package/docs/api/namespaces/safety/functions/parseVerifyUrl.md +31 -0
- package/docs/api/namespaces/safety/interfaces/FingerprintData.md +52 -0
- package/docs/api/namespaces/safety/interfaces/SafetyNumber.md +49 -0
- package/docs/api/namespaces/safety/interfaces/VerifyLinkConfig.md +28 -0
- package/docs/api/namespaces/safety/interfaces/VerifyUrlParams.md +49 -0
- package/docs/api/namespaces/safety/type-aliases/CompareResult.md +21 -0
- package/docs/api/namespaces/safety/variables/DEFAULT_VERIFY_LINK_CONFIG.md +12 -0
- package/docs/api/namespaces/safety/variables/FINGERPRINT_ITERATIONS.md +12 -0
- package/docs/api/namespaces/safety/variables/FINGERPRINT_VERSION.md +12 -0
- package/docs/api/namespaces/safety/variables/VERIFY_BASE_URL.md +11 -0
- package/docs/api/namespaces/safety/variables/VERIFY_SCHEME_URL.md +11 -0
- package/docs/api/type-aliases/Base64.md +20 -0
- package/docs/api/type-aliases/BraidPolicy.md +11 -0
- package/docs/api/type-aliases/Bytes.md +20 -0
- package/docs/api/type-aliases/Ciphertext.md +21 -0
- package/docs/api/type-aliases/DeviceType.md +11 -0
- package/docs/api/type-aliases/DownloadedAttachment.md +11 -0
- package/docs/api/type-aliases/GroupId.md +27 -0
- package/docs/api/type-aliases/Hex.md +20 -0
- package/docs/api/type-aliases/HookName.md +11 -0
- package/docs/api/type-aliases/PostQuantumPolicy.md +11 -0
- package/docs/api/type-aliases/PreparedAttachmentUpload.md +14 -0
- package/docs/api/type-aliases/PrivateKey.md +22 -0
- package/docs/api/type-aliases/ProgressCallback.md +45 -0
- package/docs/api/type-aliases/PublicKey.md +22 -0
- package/docs/api/type-aliases/RemoteObjectCompleteUploadRequest.md +19 -0
- package/docs/api/type-aliases/RemoteObjectDeleteRequest.md +19 -0
- package/docs/api/type-aliases/RemoteObjectDownloadRequest.md +19 -0
- package/docs/api/type-aliases/RemoteObjectUploadRequest.md +42 -0
- package/docs/api/type-aliases/SCKAMode.md +11 -0
- package/docs/api/type-aliases/SealedSenderAuth.md +15 -0
- package/docs/api/type-aliases/SignalProtocolClientMediaCleanupInput.md +9 -0
- package/docs/api/type-aliases/SignalProtocolClientMediaCleanupResult.md +9 -0
- package/docs/api/type-aliases/SignalProtocolClientMediaDownloadInput.md +9 -0
- package/docs/api/type-aliases/SignalProtocolClientMediaDownloadResult.md +9 -0
- package/docs/api/type-aliases/SignalProtocolClientMediaOperationResult.md +9 -0
- package/docs/api/type-aliases/SignalProtocolClientMediaUploadInput.md +9 -0
- package/docs/api/type-aliases/SignalProtocolClientMediaUploadResult.md +9 -0
- package/docs/api/type-aliases/Signature.md +21 -0
- package/docs/api/type-aliases/Unsubscribe.md +15 -0
- package/docs/api/variables/BraidPolicy.md +21 -0
- package/docs/api/variables/DEFAULT_DEVICE_ID.md +12 -0
- package/docs/api/variables/DOUBLE_RATCHET_SPEC.md +11 -0
- package/docs/api/variables/GROUP_V2_PREFIX.md +11 -0
- package/docs/api/variables/KEY_REFRESH_INTERVAL_MS_DEFAULT.md +11 -0
- package/docs/api/variables/MAX_MESSAGE_KEYS.md +14 -0
- package/docs/api/variables/MAX_PREKEY_AGE_MS_DEFAULT.md +11 -0
- package/docs/api/variables/MAX_RECEIVER_CHAINS.md +14 -0
- package/docs/api/variables/MAX_REGISTRATION_ID.md +16 -0
- package/docs/api/variables/MAX_SKIP.md +11 -0
- package/docs/api/variables/MESSAGE_FORMAT.md +11 -0
- package/docs/api/variables/MIN_REGISTRATION_ID.md +16 -0
- package/docs/api/variables/ML_KEM_BRAID_SPEC.md +11 -0
- package/docs/api/variables/ONE_TIME_PREKEY_BATCH_SIZE.md +21 -0
- package/docs/api/variables/PQXDH_SPEC.md +11 -0
- package/docs/api/variables/PostQuantumPolicy.md +21 -0
- package/docs/api/variables/SENDER_KEY_FORMAT.md +11 -0
- package/docs/api/variables/SENDER_KEY_SPEC.md +11 -0
- package/docs/api/variables/SESAME_SPEC.md +11 -0
- package/docs/api/variables/SESSION_FORMAT.md +11 -0
- package/docs/api/variables/SPQR_LIMITS_DEFAULTS.md +11 -0
- package/docs/api/variables/X3DH_SPEC.md +9 -0
- package/docs/api/variables/defaultSignalLogger.md +32 -0
- package/encoding/README.md +32 -0
- package/files/README.md +37 -0
- package/groups/README.md +42 -0
- package/hooks/README.md +40 -0
- package/keys/README.md +121 -0
- package/local/store/README.md +120 -0
- package/local/store/expo/README.md +73 -0
- package/local/store/mock/README.md +27 -0
- package/local/store/node/README.md +35 -0
- package/local/store/react-native/README.md +39 -0
- package/local/store/web/README.md +65 -0
- package/local/vault/README.md +32 -0
- package/media/README.md +73 -0
- package/package.json +436 -0
- package/profile/README.md +44 -0
- package/remote/README.md +219 -0
- package/remote/object-store/README.md +45 -0
- package/remote/object-store/convex-r2/README.md +85 -0
- package/remote/object-store/s3/README.md +35 -0
- package/remote/relay/README.md +38 -0
- package/remote/relay/convex/README.md +54 -0
- package/remote/relay/mock/README.md +32 -0
- package/safety/README.md +42 -0
- package/sealed-sender/README.md +32 -0
- package/types/README.md +36 -0
- package/username/README.md +37 -0
- package/utils/README.md +37 -0
- package/zk/README.md +36 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExpiringProfileKeyCredential -- ZK proof that encrypted member data is valid
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* Implements the ExpiringProfileKeyCredential flow for group member verification:
|
|
6
|
+
* 1. Server issues a credential over (ACI, ProfileKey, redemptionTime)
|
|
7
|
+
* 2. Client receives and verifies the issuance proof
|
|
8
|
+
* 3. Client presents the credential to a group, encrypting ACI under the
|
|
9
|
+
* group's UID encryption key and ProfileKey under the group's profile
|
|
10
|
+
* key encryption key (two different ElGamal domains)
|
|
11
|
+
* 4. Server verifies the presentation proof
|
|
12
|
+
*
|
|
13
|
+
* The redemption time is a public attribute (visible to both issuer and
|
|
14
|
+
* verifier); ACI and ProfileKey are hidden attributes encrypted under
|
|
15
|
+
* different group encryption keys during presentation.
|
|
16
|
+
*
|
|
17
|
+
* Key difference from AuthCredentialWithPni:
|
|
18
|
+
* - Auth: both hidden attrs (ACI, PNI) encrypted under uidEncKeyPair
|
|
19
|
+
* - Profile: ACI under uidEncKeyPair, ProfileKey under profileKeyEncKeyPair
|
|
20
|
+
*
|
|
21
|
+
* @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
|
|
22
|
+
*/
|
|
23
|
+
import { type IssuanceProof } from '../credentials/issuance.js';
|
|
24
|
+
import { type PresentationProof } from '../credentials/presentation.js';
|
|
25
|
+
import type { Credential, CredentialKeyPair, CredentialPublicKey } from '../credentials/credentials.js';
|
|
26
|
+
import { type UidStruct, type ServiceId } from './uid-struct.js';
|
|
27
|
+
import { type ProfileKeyStruct } from './profile-key-struct.js';
|
|
28
|
+
import { type UidEncCiphertext } from './uid-encryption.js';
|
|
29
|
+
import { type ProfileKeyEncCiphertext } from './profile-key-encryption.js';
|
|
30
|
+
import type { GroupSecretParams, GroupPublicParams } from './group-params.js';
|
|
31
|
+
export {};
|
|
32
|
+
/**
|
|
33
|
+
* Server response containing an issuance proof for an ExpiringProfileKeyCredential.
|
|
34
|
+
*
|
|
35
|
+
* Created by the server during credential issuance and sent to the client.
|
|
36
|
+
* The client verifies the proof and extracts the credential.
|
|
37
|
+
*/
|
|
38
|
+
export interface ExpiringProfileKeyCredentialResponse {
|
|
39
|
+
/** ZK issuance proof binding the credential to (ACI, ProfileKey, redemptionTime). */
|
|
40
|
+
readonly issuanceProof: IssuanceProof;
|
|
41
|
+
/** Day-aligned epoch timestamp (must be a multiple of SECONDS_PER_DAY). */
|
|
42
|
+
readonly redemptionTime: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A verified profile key credential binding an ACI and ProfileKey to a
|
|
46
|
+
* redemption time.
|
|
47
|
+
*
|
|
48
|
+
* Stored by the client after receiving and verifying an issuance response.
|
|
49
|
+
* Used to generate presentation proofs for group member verification.
|
|
50
|
+
*/
|
|
51
|
+
export interface ExpiringProfileKeyCredential {
|
|
52
|
+
/** The raw ZK credential (t, U, V triple). */
|
|
53
|
+
readonly credential: Credential;
|
|
54
|
+
/** The user's ACI as a UidStruct (pair of Ristretto points). */
|
|
55
|
+
readonly aci: UidStruct;
|
|
56
|
+
/** The user's profile key as a ProfileKeyStruct (pair of Ristretto points). */
|
|
57
|
+
readonly profileKey: ProfileKeyStruct;
|
|
58
|
+
/** Day-aligned epoch timestamp (expiration boundary). */
|
|
59
|
+
readonly redemptionTime: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A presentation proof demonstrating possession of an ExpiringProfileKeyCredential,
|
|
63
|
+
* with ACI encrypted under the group's UID encryption key and ProfileKey
|
|
64
|
+
* encrypted under the group's profile key encryption key.
|
|
65
|
+
*
|
|
66
|
+
* Sent to the server during group creation or member addition. The server
|
|
67
|
+
* verifies the ZK proof to ensure the encrypted member data is valid
|
|
68
|
+
* without being able to decrypt it.
|
|
69
|
+
*/
|
|
70
|
+
export interface ProfileKeyCredentialPresentation {
|
|
71
|
+
/** ZK presentation proof. */
|
|
72
|
+
readonly proof: PresentationProof;
|
|
73
|
+
/** ACI encrypted under the group's UID encryption key. */
|
|
74
|
+
readonly uidEncCiphertext: UidEncCiphertext;
|
|
75
|
+
/** ProfileKey encrypted under the group's profile key encryption key. */
|
|
76
|
+
readonly profileKeyEncCiphertext: ProfileKeyEncCiphertext;
|
|
77
|
+
/** Day-aligned epoch timestamp matching the credential. */
|
|
78
|
+
readonly redemptionTime: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Issue an ExpiringProfileKeyCredential for the given ACI, ProfileKey, and
|
|
82
|
+
* redemption time.
|
|
83
|
+
*
|
|
84
|
+
* Called by the server. Produces an issuance proof that the client can verify
|
|
85
|
+
* to extract the credential.
|
|
86
|
+
*
|
|
87
|
+
* The builder accumulates attributes in the same order used by the client
|
|
88
|
+
* during verification: ACI (hidden), ProfileKey (hidden), redemptionTime (public).
|
|
89
|
+
*
|
|
90
|
+
* CRITICAL: Use different randomness for each issuance. Reusing randomness
|
|
91
|
+
* effectively reveals the server's private key.
|
|
92
|
+
*
|
|
93
|
+
* @param credentialKeyPair - The server's profile key credential signing key pair
|
|
94
|
+
* @param aci - The user's ACI ServiceId
|
|
95
|
+
* @param profileKeyBytes - The user's 32-byte profile key
|
|
96
|
+
* @param redemptionTime - Day-aligned epoch timestamp (seconds)
|
|
97
|
+
* @param randomness - At least 32 bytes of cryptographically secure randomness
|
|
98
|
+
* @returns The issuance response to send to the client
|
|
99
|
+
*/
|
|
100
|
+
export declare function issueProfileKeyCredential(credentialKeyPair: CredentialKeyPair, aci: ServiceId, profileKeyBytes: Uint8Array, redemptionTime: number, randomness: Uint8Array): ExpiringProfileKeyCredentialResponse;
|
|
101
|
+
/**
|
|
102
|
+
* Receive and verify an ExpiringProfileKeyCredential issuance response.
|
|
103
|
+
*
|
|
104
|
+
* Called by the client. Verifies the issuance proof against the server's
|
|
105
|
+
* public key and extracts the credential for later presentation.
|
|
106
|
+
*
|
|
107
|
+
* The builder must accumulate attributes in the same order used during
|
|
108
|
+
* issuance: ACI (hidden), ProfileKey (hidden), redemptionTime (public).
|
|
109
|
+
*
|
|
110
|
+
* Validates that the credential expires within 1-7 days from currentTime.
|
|
111
|
+
* This prevents a compromised server from
|
|
112
|
+
* issuing absurdly long-lived or already-expired credentials.
|
|
113
|
+
*
|
|
114
|
+
* @param publicKey - The server's profile key credential public key
|
|
115
|
+
* @param response - The issuance response from the server
|
|
116
|
+
* @param aci - The user's ACI ServiceId (must match what the server issued)
|
|
117
|
+
* @param profileKeyBytes - The user's 32-byte profile key (must match)
|
|
118
|
+
* @param redemptionTime - Day-aligned epoch timestamp (must match the response)
|
|
119
|
+
* @param currentTime - Current time in epoch seconds, used for 1-7 day window validation
|
|
120
|
+
* @returns The verified credential for storage and later presentation
|
|
121
|
+
* @throws {VerificationFailure} If the issuance proof is invalid
|
|
122
|
+
* @throws {VerificationFailure} If the redemption time is not day-aligned
|
|
123
|
+
* @throws {VerificationFailure} If the credential is not within 1-7 days of currentTime
|
|
124
|
+
*/
|
|
125
|
+
export declare function receiveProfileKeyCredential(publicKey: CredentialPublicKey, response: ExpiringProfileKeyCredentialResponse, aci: ServiceId, profileKeyBytes: Uint8Array, redemptionTime: number, currentTime: number): ExpiringProfileKeyCredential;
|
|
126
|
+
/**
|
|
127
|
+
* Present an ExpiringProfileKeyCredential to a group for member verification.
|
|
128
|
+
*
|
|
129
|
+
* Called by the client. Generates a ZK presentation proof that encrypts the
|
|
130
|
+
* ACI under the group's UID encryption key and ProfileKey under the group's
|
|
131
|
+
* profile key encryption key, allowing the server to verify the encrypted
|
|
132
|
+
* data is valid without decrypting it.
|
|
133
|
+
*
|
|
134
|
+
* KEY DIFFERENCE FROM AUTH: Uses TWO different encryption domains:
|
|
135
|
+
* - ACI is encrypted under uidEncKeyPair (UidEncryptionDomain)
|
|
136
|
+
* - ProfileKey is encrypted under profileKeyEncKeyPair (ProfileKeyEncryptionDomain)
|
|
137
|
+
*
|
|
138
|
+
* CRITICAL: Use different randomness for each presentation. Reusing randomness
|
|
139
|
+
* allows different presentations to be linked.
|
|
140
|
+
*
|
|
141
|
+
* @param publicKey - The server's profile key credential public key
|
|
142
|
+
* @param credential - The client's stored ExpiringProfileKeyCredential
|
|
143
|
+
* @param groupSecretParams - The group's secret parameters
|
|
144
|
+
* @param randomness - At least 32 bytes of cryptographically secure randomness
|
|
145
|
+
* @returns The presentation to send to the server
|
|
146
|
+
*/
|
|
147
|
+
export declare function presentProfileKeyCredential(publicKey: CredentialPublicKey, credential: ExpiringProfileKeyCredential, groupSecretParams: GroupSecretParams, randomness: Uint8Array): ProfileKeyCredentialPresentation;
|
|
148
|
+
/**
|
|
149
|
+
* Verify a ProfileKeyCredentialPresentation against the server's key pair and
|
|
150
|
+
* the group's public parameters.
|
|
151
|
+
*
|
|
152
|
+
* Called by the server. Checks that:
|
|
153
|
+
* 1. The presentation proof is valid (ZK verification)
|
|
154
|
+
* 2. The credential has not expired (redemptionTime >= currentTime)
|
|
155
|
+
*
|
|
156
|
+
* @param credentialKeyPair - The server's profile key credential signing key pair
|
|
157
|
+
* @param groupPublicParams - The group's public parameters
|
|
158
|
+
* @param presentation - The client's presentation proof
|
|
159
|
+
* @param currentTime - Current time in epoch seconds for expiry check
|
|
160
|
+
* @returns true if the presentation is valid
|
|
161
|
+
* @throws {VerificationFailure} If the presentation proof is invalid or expired
|
|
162
|
+
*/
|
|
163
|
+
export declare function verifyProfileKeyCredentialPresentation(credentialKeyPair: CredentialKeyPair, groupPublicParams: GroupPublicParams, presentation: ProfileKeyCredentialPresentation, currentTime: number): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Serialize an ExpiringProfileKeyCredentialResponse to bytes.
|
|
166
|
+
*
|
|
167
|
+
* Format:
|
|
168
|
+
* [redemptionTime: 8 bytes BE u64]
|
|
169
|
+
* [credential.t: 32 bytes scalar LE]
|
|
170
|
+
* [credential.U: 32 bytes point]
|
|
171
|
+
* [credential.V: 32 bytes point]
|
|
172
|
+
* [pokshoProof: remaining bytes]
|
|
173
|
+
*/
|
|
174
|
+
export declare function serializeProfileKeyCredentialResponse(response: ExpiringProfileKeyCredentialResponse): Uint8Array;
|
|
175
|
+
/**
|
|
176
|
+
* Deserialize an ExpiringProfileKeyCredentialResponse from bytes.
|
|
177
|
+
*/
|
|
178
|
+
export declare function deserializeProfileKeyCredentialResponse(bytes: Uint8Array): ExpiringProfileKeyCredentialResponse;
|
|
179
|
+
/**
|
|
180
|
+
* Serialize a ProfileKeyCredentialPresentation to bytes.
|
|
181
|
+
*
|
|
182
|
+
* Format:
|
|
183
|
+
* [redemptionTime: 8 bytes BE u64]
|
|
184
|
+
* [C_x0: 32] [C_x1: 32] [C_V: 32]
|
|
185
|
+
* [C_y_count: 4 LE u32] [C_y[]: 32 * n]
|
|
186
|
+
* [proofLen: 4 LE u32] [pokshoProof: proofLen]
|
|
187
|
+
* [aci.E_A1: 32] [aci.E_A2: 32]
|
|
188
|
+
* [profileKey.E_A1: 32] [profileKey.E_A2: 32]
|
|
189
|
+
*/
|
|
190
|
+
export declare function serializeProfileKeyCredentialPresentation(presentation: ProfileKeyCredentialPresentation): Uint8Array;
|
|
191
|
+
/**
|
|
192
|
+
* Deserialize a ProfileKeyCredentialPresentation from bytes.
|
|
193
|
+
*/
|
|
194
|
+
export declare function deserializeProfileKeyCredentialPresentation(bytes: Uint8Array): ProfileKeyCredentialPresentation;
|
|
195
|
+
//# sourceMappingURL=profile-key-credential.d.ts.map
|
|
@@ -0,0 +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,KAAK,aAAa,EAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAA0B,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,KAAK,uBAAuB,EAA8B,MAAM,0BAA0B,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAI3E,OAAO,EAAE,CAAC;AAkCV;;;;;GAKG;AACH,MAAM,WAAW,oCAAoC;IACnD,qFAAqF;IACrF,QAAQ,C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B,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,GACrB,gCAAgC,CAoBlC;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sCAAsC,CACpD,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,gCAAgC,EAC9C,WAAW,EAAE,MAAM,GAClB,OAAO,CAkBT;AAQD;;;;;;;;;GASG;AACH,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,oCAAoC,GAC7C,UAAU,CAeZ;AAED;;GAEG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,UAAU,GAChB,oCAAoC,CAqBtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yCAAyC,CACvD,YAAY,EAAE,gCAAgC,GAC7C,UAAU,CAwCZ;AAED;;GAEG;AACH,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,UAAU,GAChB,gCAAgC,CA2DlC"}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExpiringProfileKeyCredential -- ZK proof that encrypted member data is valid
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* Implements the ExpiringProfileKeyCredential flow for group member verification:
|
|
6
|
+
* 1. Server issues a credential over (ACI, ProfileKey, redemptionTime)
|
|
7
|
+
* 2. Client receives and verifies the issuance proof
|
|
8
|
+
* 3. Client presents the credential to a group, encrypting ACI under the
|
|
9
|
+
* group's UID encryption key and ProfileKey under the group's profile
|
|
10
|
+
* key encryption key (two different ElGamal domains)
|
|
11
|
+
* 4. Server verifies the presentation proof
|
|
12
|
+
*
|
|
13
|
+
* The redemption time is a public attribute (visible to both issuer and
|
|
14
|
+
* verifier); ACI and ProfileKey are hidden attributes encrypted under
|
|
15
|
+
* different group encryption keys during presentation.
|
|
16
|
+
*
|
|
17
|
+
* Key difference from AuthCredentialWithPni:
|
|
18
|
+
* - Auth: both hidden attrs (ACI, PNI) encrypted under uidEncKeyPair
|
|
19
|
+
* - Profile: ACI under uidEncKeyPair, ProfileKey under profileKeyEncKeyPair
|
|
20
|
+
*
|
|
21
|
+
* @see https://eprint.iacr.org/2019/1416.pdf -- Signal Private Group System
|
|
22
|
+
*/
|
|
23
|
+
import { RistrettoPoint } from '../proofs/sho.js';
|
|
24
|
+
import { IssuanceProofBuilder, VerificationFailure, } from '../credentials/issuance.js';
|
|
25
|
+
import { PresentationProofBuilder, PresentationProofVerifier, } from '../credentials/presentation.js';
|
|
26
|
+
import { uidStructFromServiceId } from './uid-struct.js';
|
|
27
|
+
import { profileKeyStructNew } from './profile-key-struct.js';
|
|
28
|
+
import { UidEncryptionDomain } from './uid-encryption.js';
|
|
29
|
+
import { ProfileKeyEncryptionDomain } from './profile-key-encryption.js';
|
|
30
|
+
import { SECONDS_PER_DAY } from './group-params.js';
|
|
31
|
+
import { scalarToBytes, bytesToScalarCanonical } from '../proofs/sho.js';
|
|
32
|
+
import { Ciphertext } from '../credentials/attributes.js';
|
|
33
|
+
const enc = new TextEncoder();
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Constants
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
/** Credential label matching the profile: `Signal_ZKGroup_20220508_ExpiringProfileKeyCredential`. */
|
|
38
|
+
const CREDENTIAL_LABEL = enc.encode('Signal_ZKGroup_20220508_ExpiringProfileKeyCredential');
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Redemption time as a PublicAttribute
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
/**
|
|
43
|
+
* Create a PublicAttribute from a redemption timestamp.
|
|
44
|
+
*
|
|
45
|
+
* Encodes the timestamp as unsigned big-endian 64-bit bytes and absorbs it
|
|
46
|
+
* into the SHO.
|
|
47
|
+
*/
|
|
48
|
+
function redemptionTimePublicAttribute(time) {
|
|
49
|
+
return {
|
|
50
|
+
hashInto(sho) {
|
|
51
|
+
const buf = new Uint8Array(8);
|
|
52
|
+
new DataView(buf.buffer).setBigUint64(0, BigInt(time), false);
|
|
53
|
+
sho.absorbAndRatchet(buf);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Issuance (server side)
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
/**
|
|
61
|
+
* Issue an ExpiringProfileKeyCredential for the given ACI, ProfileKey, and
|
|
62
|
+
* redemption time.
|
|
63
|
+
*
|
|
64
|
+
* Called by the server. Produces an issuance proof that the client can verify
|
|
65
|
+
* to extract the credential.
|
|
66
|
+
*
|
|
67
|
+
* The builder accumulates attributes in the same order used by the client
|
|
68
|
+
* during verification: ACI (hidden), ProfileKey (hidden), redemptionTime (public).
|
|
69
|
+
*
|
|
70
|
+
* CRITICAL: Use different randomness for each issuance. Reusing randomness
|
|
71
|
+
* effectively reveals the server's private key.
|
|
72
|
+
*
|
|
73
|
+
* @param credentialKeyPair - The server's profile key credential signing key pair
|
|
74
|
+
* @param aci - The user's ACI ServiceId
|
|
75
|
+
* @param profileKeyBytes - The user's 32-byte profile key
|
|
76
|
+
* @param redemptionTime - Day-aligned epoch timestamp (seconds)
|
|
77
|
+
* @param randomness - At least 32 bytes of cryptographically secure randomness
|
|
78
|
+
* @returns The issuance response to send to the client
|
|
79
|
+
*/
|
|
80
|
+
export function issueProfileKeyCredential(credentialKeyPair, aci, profileKeyBytes, redemptionTime, randomness) {
|
|
81
|
+
const aciUid = uidStructFromServiceId(aci);
|
|
82
|
+
const profileKey = profileKeyStructNew(profileKeyBytes, aci.uuid);
|
|
83
|
+
const builder = new IssuanceProofBuilder(CREDENTIAL_LABEL);
|
|
84
|
+
builder.addAttribute(aciUid);
|
|
85
|
+
builder.addAttribute(profileKey);
|
|
86
|
+
builder.addPublicAttribute(redemptionTimePublicAttribute(redemptionTime));
|
|
87
|
+
const issuanceProof = builder.issue(credentialKeyPair, randomness);
|
|
88
|
+
return { issuanceProof, redemptionTime };
|
|
89
|
+
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Receive (client side)
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
/**
|
|
94
|
+
* Receive and verify an ExpiringProfileKeyCredential issuance response.
|
|
95
|
+
*
|
|
96
|
+
* Called by the client. Verifies the issuance proof against the server's
|
|
97
|
+
* public key and extracts the credential for later presentation.
|
|
98
|
+
*
|
|
99
|
+
* The builder must accumulate attributes in the same order used during
|
|
100
|
+
* issuance: ACI (hidden), ProfileKey (hidden), redemptionTime (public).
|
|
101
|
+
*
|
|
102
|
+
* Validates that the credential expires within 1-7 days from currentTime.
|
|
103
|
+
* This prevents a compromised server from
|
|
104
|
+
* issuing absurdly long-lived or already-expired credentials.
|
|
105
|
+
*
|
|
106
|
+
* @param publicKey - The server's profile key credential public key
|
|
107
|
+
* @param response - The issuance response from the server
|
|
108
|
+
* @param aci - The user's ACI ServiceId (must match what the server issued)
|
|
109
|
+
* @param profileKeyBytes - The user's 32-byte profile key (must match)
|
|
110
|
+
* @param redemptionTime - Day-aligned epoch timestamp (must match the response)
|
|
111
|
+
* @param currentTime - Current time in epoch seconds, used for 1-7 day window validation
|
|
112
|
+
* @returns The verified credential for storage and later presentation
|
|
113
|
+
* @throws {VerificationFailure} If the issuance proof is invalid
|
|
114
|
+
* @throws {VerificationFailure} If the redemption time is not day-aligned
|
|
115
|
+
* @throws {VerificationFailure} If the credential is not within 1-7 days of currentTime
|
|
116
|
+
*/
|
|
117
|
+
export function receiveProfileKeyCredential(publicKey, response, aci, profileKeyBytes, redemptionTime, currentTime) {
|
|
118
|
+
if (redemptionTime % SECONDS_PER_DAY !== 0) {
|
|
119
|
+
throw new VerificationFailure();
|
|
120
|
+
}
|
|
121
|
+
// Reject credentials not within 1-7 days of currentTime
|
|
122
|
+
const secondsRemaining = Math.max(0, response.redemptionTime - currentTime);
|
|
123
|
+
const daysRemaining = Math.floor(secondsRemaining / SECONDS_PER_DAY);
|
|
124
|
+
if (daysRemaining === 0 || daysRemaining > 7) {
|
|
125
|
+
throw new VerificationFailure();
|
|
126
|
+
}
|
|
127
|
+
const aciUid = uidStructFromServiceId(aci);
|
|
128
|
+
const profileKey = profileKeyStructNew(profileKeyBytes, aci.uuid);
|
|
129
|
+
const builder = new IssuanceProofBuilder(CREDENTIAL_LABEL);
|
|
130
|
+
builder.addAttribute(aciUid);
|
|
131
|
+
builder.addAttribute(profileKey);
|
|
132
|
+
builder.addPublicAttribute(redemptionTimePublicAttribute(redemptionTime));
|
|
133
|
+
const credential = builder.verify(publicKey, response.issuanceProof);
|
|
134
|
+
return {
|
|
135
|
+
credential,
|
|
136
|
+
aci: aciUid,
|
|
137
|
+
profileKey,
|
|
138
|
+
redemptionTime,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
// Presentation (client side)
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
/**
|
|
145
|
+
* Present an ExpiringProfileKeyCredential to a group for member verification.
|
|
146
|
+
*
|
|
147
|
+
* Called by the client. Generates a ZK presentation proof that encrypts the
|
|
148
|
+
* ACI under the group's UID encryption key and ProfileKey under the group's
|
|
149
|
+
* profile key encryption key, allowing the server to verify the encrypted
|
|
150
|
+
* data is valid without decrypting it.
|
|
151
|
+
*
|
|
152
|
+
* KEY DIFFERENCE FROM AUTH: Uses TWO different encryption domains:
|
|
153
|
+
* - ACI is encrypted under uidEncKeyPair (UidEncryptionDomain)
|
|
154
|
+
* - ProfileKey is encrypted under profileKeyEncKeyPair (ProfileKeyEncryptionDomain)
|
|
155
|
+
*
|
|
156
|
+
* CRITICAL: Use different randomness for each presentation. Reusing randomness
|
|
157
|
+
* allows different presentations to be linked.
|
|
158
|
+
*
|
|
159
|
+
* @param publicKey - The server's profile key credential public key
|
|
160
|
+
* @param credential - The client's stored ExpiringProfileKeyCredential
|
|
161
|
+
* @param groupSecretParams - The group's secret parameters
|
|
162
|
+
* @param randomness - At least 32 bytes of cryptographically secure randomness
|
|
163
|
+
* @returns The presentation to send to the server
|
|
164
|
+
*/
|
|
165
|
+
export function presentProfileKeyCredential(publicKey, credential, groupSecretParams, randomness) {
|
|
166
|
+
const { aci, profileKey, credential: cred, redemptionTime } = credential;
|
|
167
|
+
const builder = new PresentationProofBuilder(CREDENTIAL_LABEL);
|
|
168
|
+
// ACI attribute encrypted under UID encryption domain
|
|
169
|
+
builder.addAttribute(aci, groupSecretParams.uidEncKeyPair);
|
|
170
|
+
// ProfileKey attribute encrypted under PROFILE KEY encryption domain (different!)
|
|
171
|
+
builder.addAttribute(profileKey, groupSecretParams.profileKeyEncKeyPair);
|
|
172
|
+
const proof = builder.present(publicKey, cred, randomness);
|
|
173
|
+
const uidEncCiphertext = groupSecretParams.uidEncKeyPair.encrypt(aci);
|
|
174
|
+
const profileKeyEncCiphertext = groupSecretParams.profileKeyEncKeyPair.encrypt(profileKey);
|
|
175
|
+
return {
|
|
176
|
+
proof,
|
|
177
|
+
uidEncCiphertext,
|
|
178
|
+
profileKeyEncCiphertext,
|
|
179
|
+
redemptionTime,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
// Verification (server side)
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
/**
|
|
186
|
+
* Verify a ProfileKeyCredentialPresentation against the server's key pair and
|
|
187
|
+
* the group's public parameters.
|
|
188
|
+
*
|
|
189
|
+
* Called by the server. Checks that:
|
|
190
|
+
* 1. The presentation proof is valid (ZK verification)
|
|
191
|
+
* 2. The credential has not expired (redemptionTime >= currentTime)
|
|
192
|
+
*
|
|
193
|
+
* @param credentialKeyPair - The server's profile key credential signing key pair
|
|
194
|
+
* @param groupPublicParams - The group's public parameters
|
|
195
|
+
* @param presentation - The client's presentation proof
|
|
196
|
+
* @param currentTime - Current time in epoch seconds for expiry check
|
|
197
|
+
* @returns true if the presentation is valid
|
|
198
|
+
* @throws {VerificationFailure} If the presentation proof is invalid or expired
|
|
199
|
+
*/
|
|
200
|
+
export function verifyProfileKeyCredentialPresentation(credentialKeyPair, groupPublicParams, presentation, currentTime) {
|
|
201
|
+
const { proof, uidEncCiphertext, profileKeyEncCiphertext, redemptionTime } = presentation;
|
|
202
|
+
// Reject when the current time reaches or exceeds credential expiration.
|
|
203
|
+
if (currentTime >= redemptionTime) {
|
|
204
|
+
throw new VerificationFailure();
|
|
205
|
+
}
|
|
206
|
+
const verifier = new PresentationProofVerifier(CREDENTIAL_LABEL);
|
|
207
|
+
// ACI checked against UID encryption public key
|
|
208
|
+
verifier.addAttribute(uidEncCiphertext, groupPublicParams.uidEncPublicKey);
|
|
209
|
+
// ProfileKey checked against PROFILE KEY encryption public key (different!)
|
|
210
|
+
verifier.addAttribute(profileKeyEncCiphertext, groupPublicParams.profileKeyEncPublicKey);
|
|
211
|
+
verifier.addPublicAttribute(redemptionTimePublicAttribute(redemptionTime));
|
|
212
|
+
verifier.verify(credentialKeyPair, proof);
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
// ---------------------------------------------------------------------------
|
|
216
|
+
// Serialization helpers
|
|
217
|
+
// ---------------------------------------------------------------------------
|
|
218
|
+
const Point = RistrettoPoint;
|
|
219
|
+
/**
|
|
220
|
+
* Serialize an ExpiringProfileKeyCredentialResponse to bytes.
|
|
221
|
+
*
|
|
222
|
+
* Format:
|
|
223
|
+
* [redemptionTime: 8 bytes BE u64]
|
|
224
|
+
* [credential.t: 32 bytes scalar LE]
|
|
225
|
+
* [credential.U: 32 bytes point]
|
|
226
|
+
* [credential.V: 32 bytes point]
|
|
227
|
+
* [pokshoProof: remaining bytes]
|
|
228
|
+
*/
|
|
229
|
+
export function serializeProfileKeyCredentialResponse(response) {
|
|
230
|
+
const { issuanceProof, redemptionTime } = response;
|
|
231
|
+
const tBytes = scalarToBytes(issuanceProof.credential.t);
|
|
232
|
+
const uBytes = issuanceProof.credential.U.toBytes();
|
|
233
|
+
const vBytes = issuanceProof.credential.V.toBytes();
|
|
234
|
+
const proofBytes = issuanceProof.pokshoProof;
|
|
235
|
+
const buf = new Uint8Array(8 + 32 + 32 + 32 + proofBytes.length);
|
|
236
|
+
const view = new DataView(buf.buffer);
|
|
237
|
+
view.setBigUint64(0, BigInt(redemptionTime), false);
|
|
238
|
+
buf.set(tBytes, 8);
|
|
239
|
+
buf.set(uBytes, 40);
|
|
240
|
+
buf.set(vBytes, 72);
|
|
241
|
+
buf.set(proofBytes, 104);
|
|
242
|
+
return buf;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Deserialize an ExpiringProfileKeyCredentialResponse from bytes.
|
|
246
|
+
*/
|
|
247
|
+
export function deserializeProfileKeyCredentialResponse(bytes) {
|
|
248
|
+
// 8 (time) + 32*3 (credential) + 320 (issuance proof: 1 challenge + 9 responses)
|
|
249
|
+
if (bytes.length !== 424) {
|
|
250
|
+
throw new Error('deserializeProfileKeyCredentialResponse: invalid length');
|
|
251
|
+
}
|
|
252
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
253
|
+
const redemptionTime = Number(view.getBigUint64(0, false));
|
|
254
|
+
const t = bytesToScalarCanonical(bytes.subarray(8, 40));
|
|
255
|
+
if (t === null)
|
|
256
|
+
throw new Error('deserializeProfileKeyCredentialResponse: invalid scalar t');
|
|
257
|
+
const U = Point.fromBytes(bytes.subarray(40, 72));
|
|
258
|
+
const V = Point.fromBytes(bytes.subarray(72, 104));
|
|
259
|
+
const pokshoProof = bytes.slice(104);
|
|
260
|
+
return {
|
|
261
|
+
issuanceProof: {
|
|
262
|
+
credential: { t, U, V },
|
|
263
|
+
pokshoProof,
|
|
264
|
+
},
|
|
265
|
+
redemptionTime,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Serialize a ProfileKeyCredentialPresentation to bytes.
|
|
270
|
+
*
|
|
271
|
+
* Format:
|
|
272
|
+
* [redemptionTime: 8 bytes BE u64]
|
|
273
|
+
* [C_x0: 32] [C_x1: 32] [C_V: 32]
|
|
274
|
+
* [C_y_count: 4 LE u32] [C_y[]: 32 * n]
|
|
275
|
+
* [proofLen: 4 LE u32] [pokshoProof: proofLen]
|
|
276
|
+
* [aci.E_A1: 32] [aci.E_A2: 32]
|
|
277
|
+
* [profileKey.E_A1: 32] [profileKey.E_A2: 32]
|
|
278
|
+
*/
|
|
279
|
+
export function serializeProfileKeyCredentialPresentation(presentation) {
|
|
280
|
+
const { proof, uidEncCiphertext, profileKeyEncCiphertext, redemptionTime } = presentation;
|
|
281
|
+
const cyCount = proof.C_y.length;
|
|
282
|
+
const proofLen = proof.pokshoProof.length;
|
|
283
|
+
const totalLen = 8 + 32 * 3 + 4 + 32 * cyCount + 4 + proofLen + 32 * 4;
|
|
284
|
+
const buf = new Uint8Array(totalLen);
|
|
285
|
+
const view = new DataView(buf.buffer);
|
|
286
|
+
let offset = 0;
|
|
287
|
+
view.setBigUint64(offset, BigInt(redemptionTime), false);
|
|
288
|
+
offset += 8;
|
|
289
|
+
buf.set(proof.C_x0.toBytes(), offset);
|
|
290
|
+
offset += 32;
|
|
291
|
+
buf.set(proof.C_x1.toBytes(), offset);
|
|
292
|
+
offset += 32;
|
|
293
|
+
buf.set(proof.C_V.toBytes(), offset);
|
|
294
|
+
offset += 32;
|
|
295
|
+
view.setUint32(offset, cyCount, true);
|
|
296
|
+
offset += 4;
|
|
297
|
+
for (const cy of proof.C_y) {
|
|
298
|
+
buf.set(cy.toBytes(), offset);
|
|
299
|
+
offset += 32;
|
|
300
|
+
}
|
|
301
|
+
view.setUint32(offset, proofLen, true);
|
|
302
|
+
offset += 4;
|
|
303
|
+
buf.set(proof.pokshoProof, offset);
|
|
304
|
+
offset += proofLen;
|
|
305
|
+
buf.set(uidEncCiphertext.E_A1.toBytes(), offset);
|
|
306
|
+
offset += 32;
|
|
307
|
+
buf.set(uidEncCiphertext.E_A2.toBytes(), offset);
|
|
308
|
+
offset += 32;
|
|
309
|
+
buf.set(profileKeyEncCiphertext.E_A1.toBytes(), offset);
|
|
310
|
+
offset += 32;
|
|
311
|
+
buf.set(profileKeyEncCiphertext.E_A2.toBytes(), offset);
|
|
312
|
+
return buf;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Deserialize a ProfileKeyCredentialPresentation from bytes.
|
|
316
|
+
*/
|
|
317
|
+
export function deserializeProfileKeyCredentialPresentation(bytes) {
|
|
318
|
+
// Minimum: 8 (time) + 96 (C_x0,C_x1,C_V) + 4 (cyCount) + 4 (proofLen) + 128 (4 ciphertext points)
|
|
319
|
+
const MIN_LEN = 240;
|
|
320
|
+
if (bytes.length < MIN_LEN) {
|
|
321
|
+
throw new Error('deserializeProfileKeyCredentialPresentation: too short');
|
|
322
|
+
}
|
|
323
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
324
|
+
let offset = 0;
|
|
325
|
+
const redemptionTime = Number(view.getBigUint64(offset, false));
|
|
326
|
+
offset += 8;
|
|
327
|
+
const C_x0 = Point.fromBytes(bytes.subarray(offset, offset + 32));
|
|
328
|
+
offset += 32;
|
|
329
|
+
const C_x1 = Point.fromBytes(bytes.subarray(offset, offset + 32));
|
|
330
|
+
offset += 32;
|
|
331
|
+
const C_V = Point.fromBytes(bytes.subarray(offset, offset + 32));
|
|
332
|
+
offset += 32;
|
|
333
|
+
const cyCount = view.getUint32(offset, true);
|
|
334
|
+
offset += 4;
|
|
335
|
+
// Bounds: cyCount * 32 + proofLen(4) + proof + ciphertexts(128) must fit in remaining bytes
|
|
336
|
+
if (cyCount > 16 || offset + cyCount * 32 + 4 + 128 > bytes.length) {
|
|
337
|
+
throw new Error('deserializeProfileKeyCredentialPresentation: cyCount out of bounds');
|
|
338
|
+
}
|
|
339
|
+
const C_y = [];
|
|
340
|
+
for (let i = 0; i < cyCount; i++) {
|
|
341
|
+
C_y.push(Point.fromBytes(bytes.subarray(offset, offset + 32)));
|
|
342
|
+
offset += 32;
|
|
343
|
+
}
|
|
344
|
+
const proofLen = view.getUint32(offset, true);
|
|
345
|
+
offset += 4;
|
|
346
|
+
if (offset + proofLen + 128 > bytes.length) {
|
|
347
|
+
throw new Error('deserializeProfileKeyCredentialPresentation: proofLen out of bounds');
|
|
348
|
+
}
|
|
349
|
+
const pokshoProof = bytes.slice(offset, offset + proofLen);
|
|
350
|
+
offset += proofLen;
|
|
351
|
+
const aciE_A1 = Point.fromBytes(bytes.subarray(offset, offset + 32));
|
|
352
|
+
offset += 32;
|
|
353
|
+
const aciE_A2 = Point.fromBytes(bytes.subarray(offset, offset + 32));
|
|
354
|
+
offset += 32;
|
|
355
|
+
const pkE_A1 = Point.fromBytes(bytes.subarray(offset, offset + 32));
|
|
356
|
+
offset += 32;
|
|
357
|
+
const pkE_A2 = Point.fromBytes(bytes.subarray(offset, offset + 32));
|
|
358
|
+
offset += 32;
|
|
359
|
+
// Reject trailing bytes
|
|
360
|
+
if (offset !== bytes.length) {
|
|
361
|
+
throw new Error('deserializeProfileKeyCredentialPresentation: trailing bytes');
|
|
362
|
+
}
|
|
363
|
+
return {
|
|
364
|
+
proof: { C_x0, C_x1, C_V, C_y, pokshoProof },
|
|
365
|
+
uidEncCiphertext: new Ciphertext(aciE_A1, aciE_A2, UidEncryptionDomain),
|
|
366
|
+
profileKeyEncCiphertext: new Ciphertext(pkE_A1, pkE_A2, ProfileKeyEncryptionDomain),
|
|
367
|
+
redemptionTime,
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
//# sourceMappingURL=profile-key-credential.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-key-credential.js","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/profile-key-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAiB,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EACL,oBAAoB,EAEpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO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AK,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;IACpE,MAAM,IAAI,EAAE,CAAC;IAEb,wBAAwB;IACxB,IAAI,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IAED,OAAO;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE;QAC5C,gBAAgB,EAAE,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC;QACvE,uBAAuB,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,0BAA0B,CAAC;QACnF,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile key encryption — ElGamal encryption of profile keys for group membership
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* Provides domain-specific ElGamal encryption for ProfileKeyStruct attributes.
|
|
6
|
+
* Uses pinned, domain-separated system parameters.
|
|
7
|
+
*
|
|
8
|
+
* Decryption recovers the original 32-byte profile key by:
|
|
9
|
+
* 1. Decrypting M4 from the ciphertext
|
|
10
|
+
* 2. Running decode_253_bits to get 8 candidate field elements
|
|
11
|
+
* 3. Brute-forcing the 3 masked bits (8 variations per candidate = 64 total)
|
|
12
|
+
* 4. Checking which candidate matches the expected M3 point
|
|
13
|
+
*
|
|
14
|
+
* @see https://eprint.iacr.org/2019/1416.pdf — Signal Private Group System
|
|
15
|
+
*/
|
|
16
|
+
import { ShoHmacSha256 } from '../proofs/sho.js';
|
|
17
|
+
import { type Domain, KeyPair, Ciphertext } from '../credentials/attributes.js';
|
|
18
|
+
import type { ShoSha256 } from '../proofs/sho-sha256.js';
|
|
19
|
+
export {};
|
|
20
|
+
/**
|
|
21
|
+
* Verify that generating system params from scratch matches the hardcoded values.
|
|
22
|
+
*/
|
|
23
|
+
export declare function verifySystemParams(): boolean;
|
|
24
|
+
export declare const ProfileKeyEncryptionDomain: Domain;
|
|
25
|
+
export type ProfileKeyEncKeyPair = KeyPair;
|
|
26
|
+
export type ProfileKeyEncCiphertext = Ciphertext;
|
|
27
|
+
/**
|
|
28
|
+
* Derive a profile key encryption keypair from a SHO.
|
|
29
|
+
*/
|
|
30
|
+
export declare function deriveProfileKeyEncKeyPair(sho: ShoHmacSha256 | ShoSha256): ProfileKeyEncKeyPair;
|
|
31
|
+
/**
|
|
32
|
+
* Encrypt a profile key using a profile key encryption keypair.
|
|
33
|
+
*/
|
|
34
|
+
export declare function encryptProfileKey(keyPair: ProfileKeyEncKeyPair, profileKeyBytes: Uint8Array, uidBytes: Uint8Array): ProfileKeyEncCiphertext;
|
|
35
|
+
/**
|
|
36
|
+
* Decrypt a profile key ciphertext back to the original 32-byte profile key.
|
|
37
|
+
*
|
|
38
|
+
* This is computationally expensive: it tries up to 64 candidate profile keys
|
|
39
|
+
* (8 field element candidates x 8 bit variations for the 3 masked bits).
|
|
40
|
+
*
|
|
41
|
+
* @returns The decrypted ProfileKeyStruct (with .bytes being the profile key)
|
|
42
|
+
* @throws Error if decryption fails
|
|
43
|
+
*/
|
|
44
|
+
export declare function decryptProfileKey(keyPair: ProfileKeyEncKeyPair, ciphertext: ProfileKeyEncCiphertext, uidBytes: Uint8Array): Uint8Array;
|
|
45
|
+
//# sourceMappingURL=profile-key-encryption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-key-encryption.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/zk/groups/profile-key-encryption.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAkB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,CAAC;AA6BV;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAU5C;AAMD,eAAO,MAAM,0BAA0B,EAAE,MAMxC,CAAC;AAGF,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAC3C,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAEjD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,oBAAoB,CAE/F;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,oBAAoB,EAC7B,eAAe,EAAE,UAAU,EAC3B,QAAQ,EAAE,UAAU,GACnB,uBAAuB,CAGzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,uBAAuB,EACnC,QAAQ,EAAE,UAAU,GACnB,UAAU,CA2CZ"}
|