@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,894 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ML-KEM Braid State Machine
|
|
3
|
+
*
|
|
4
|
+
* Implementation of the 11-state protocol machine for ML-KEM Braid.
|
|
5
|
+
*
|
|
6
|
+
* @module ml-kem-braid/state-machine
|
|
7
|
+
* @see https://signal.org/docs/specifications/mlkembraid/
|
|
8
|
+
*
|
|
9
|
+
* Status: Implemented
|
|
10
|
+
*/
|
|
11
|
+
import { MessageType, PROTOCOL_CONSTANTS, MLKEM_768_SIZES, isInAliceRole, BOB_STATES, } from './types.js';
|
|
12
|
+
import { computeHek, createIncrementalKEM } from './incremental-kem.js';
|
|
13
|
+
import { createAuthenticator, initAuthenticatorState } from './authenticator.js';
|
|
14
|
+
import { PolyEncoder, createEncoder, createDecoder } from './rs/index.js';
|
|
15
|
+
import { KDF_OK } from './kdf.js';
|
|
16
|
+
import { generateRandomBytes } from '../../../crypto/random.js';
|
|
17
|
+
import { constantTimeEqual, cloneProtocolState, secureZeroBytes } from '../../../crypto/index.js';
|
|
18
|
+
import { StateTransitionError, AuthenticatorError } from './errors.js';
|
|
19
|
+
import { assertBraidChunkIndex } from './chunk-domain.js';
|
|
20
|
+
/**
|
|
21
|
+
* State transition table
|
|
22
|
+
*
|
|
23
|
+
* Maps (currentState, event) → nextState
|
|
24
|
+
*/
|
|
25
|
+
// prettier-ignore
|
|
26
|
+
export default {};
|
|
27
|
+
export const STATE_TRANSITIONS = {
|
|
28
|
+
// Alice's states
|
|
29
|
+
KeysUnsampled: {
|
|
30
|
+
KEYGEN: 'KeysSampled',
|
|
31
|
+
},
|
|
32
|
+
KeysSampled: {
|
|
33
|
+
RECEIVE_CT1: 'HeaderSent',
|
|
34
|
+
},
|
|
35
|
+
HeaderSent: {
|
|
36
|
+
CT1_COMPLETE: 'Ct1Received',
|
|
37
|
+
},
|
|
38
|
+
Ct1Received: {
|
|
39
|
+
RECEIVE_CT2: 'EkSentCt1Received',
|
|
40
|
+
},
|
|
41
|
+
EkSentCt1Received: {
|
|
42
|
+
CT2_COMPLETE: 'NoHeaderReceived', // Emits key, epoch++
|
|
43
|
+
},
|
|
44
|
+
// Bob's states
|
|
45
|
+
NoHeaderReceived: {
|
|
46
|
+
HEADER_COMPLETE: 'HeaderReceived',
|
|
47
|
+
},
|
|
48
|
+
HeaderReceived: {
|
|
49
|
+
SAMPLE_CT1: 'Ct1Sampled', // Emits key on Send()
|
|
50
|
+
},
|
|
51
|
+
Ct1Sampled: {
|
|
52
|
+
EK_COMPLETE_NO_ACK: 'EkReceivedCt1Sampled',
|
|
53
|
+
EKCT1_ACK_EK_INCOMPLETE: 'Ct1Acknowledged',
|
|
54
|
+
EKCT1_ACK_EK_COMPLETE: 'Ct2Sampled',
|
|
55
|
+
},
|
|
56
|
+
EkReceivedCt1Sampled: {
|
|
57
|
+
EKCT1_ACK: 'Ct2Sampled',
|
|
58
|
+
},
|
|
59
|
+
Ct1Acknowledged: {
|
|
60
|
+
EK_COMPLETE: 'Ct2Sampled',
|
|
61
|
+
},
|
|
62
|
+
Ct2Sampled: {
|
|
63
|
+
BOB_NEW_EPOCH: 'KeysUnsampled', // Role swap: Bob becomes Alice
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
// Header size: ek_seed (32) + hek (32) + MAC (32) = 96 bytes
|
|
67
|
+
const HEADER_SIZE = MLKEM_768_SIZES.EK_SEED_SIZE + 32 + PROTOCOL_CONSTANTS.MAC_SIZE;
|
|
68
|
+
// EK Vector size: 1152 bytes (NO MAC - authenticated via hash binding to hek)
|
|
69
|
+
const EK_SIZE = MLKEM_768_SIZES.EK_VECTOR_SIZE;
|
|
70
|
+
// CT1 size: 960 bytes (NO MAC - combined MAC with CT2)
|
|
71
|
+
const CT1_SIZE = MLKEM_768_SIZES.CT1_SIZE;
|
|
72
|
+
// CT2 size: 128 bytes + combined MAC for ct1||ct2 (32) = 160 bytes
|
|
73
|
+
const CT2_SIZE = MLKEM_768_SIZES.CT2_SIZE + PROTOCOL_CONSTANTS.MAC_SIZE;
|
|
74
|
+
/**
|
|
75
|
+
* ML-KEM Braid State Machine Implementation
|
|
76
|
+
*
|
|
77
|
+
* Manages the 11-state protocol for chunked ML-KEM key agreement.
|
|
78
|
+
*/
|
|
79
|
+
export class MLKEMBraidStateMachine {
|
|
80
|
+
randomBytes;
|
|
81
|
+
kem = createIncrementalKEM();
|
|
82
|
+
authenticator = createAuthenticator();
|
|
83
|
+
constructor(randomBytes = generateRandomBytes) {
|
|
84
|
+
this.randomBytes = randomBytes;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Initialize Alice (initiator) state
|
|
88
|
+
*
|
|
89
|
+
* Alice starts in KeysUnsampled, ready to generate a new keypair.
|
|
90
|
+
*
|
|
91
|
+
* @param initial_shared_secret - Shared secret from PQXDH handshake
|
|
92
|
+
* @returns Initial agent state for Alice
|
|
93
|
+
*/
|
|
94
|
+
async InitAlice(initial_shared_secret) {
|
|
95
|
+
const auth = await initAuthenticatorState(initial_shared_secret);
|
|
96
|
+
return {
|
|
97
|
+
state: 'KeysUnsampled',
|
|
98
|
+
epoch: 1n,
|
|
99
|
+
auth,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Initialize Bob (responder) state
|
|
104
|
+
*
|
|
105
|
+
* Bob starts in NoHeaderReceived, waiting for Alice's first header.
|
|
106
|
+
*
|
|
107
|
+
* @param initial_shared_secret - Shared secret from PQXDH handshake
|
|
108
|
+
* @returns Initial agent state for Bob
|
|
109
|
+
*/
|
|
110
|
+
async InitBob(initial_shared_secret) {
|
|
111
|
+
const auth = await initAuthenticatorState(initial_shared_secret);
|
|
112
|
+
return {
|
|
113
|
+
state: 'NoHeaderReceived',
|
|
114
|
+
epoch: 1n,
|
|
115
|
+
auth,
|
|
116
|
+
headerDecoder: this.createDecoderState(HEADER_SIZE),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Process Send operation
|
|
121
|
+
*
|
|
122
|
+
* Updates state and returns message to transmit.
|
|
123
|
+
*
|
|
124
|
+
* @param state - Current agent state (will be mutated)
|
|
125
|
+
* @returns Message, sending epoch, and optional output key
|
|
126
|
+
*/
|
|
127
|
+
async Send(state) {
|
|
128
|
+
if (isInAliceRole(state)) {
|
|
129
|
+
return this.sendAlice(state);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return this.sendBob(state);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Process Receive operation
|
|
137
|
+
*
|
|
138
|
+
* Updates state based on received message.
|
|
139
|
+
*
|
|
140
|
+
* @param state - Current agent state (will be mutated)
|
|
141
|
+
* @param message - Received ML-KEM Braid message
|
|
142
|
+
* @returns Receiving epoch and optional output key
|
|
143
|
+
*/
|
|
144
|
+
async Receive(state, message) {
|
|
145
|
+
if (isInAliceRole(state)) {
|
|
146
|
+
return this.receiveAlice(state, message);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return this.receiveBob(state, message);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// ===========================================================================
|
|
153
|
+
// Private: Alice Send Handlers
|
|
154
|
+
// ===========================================================================
|
|
155
|
+
async sendAlice(state) {
|
|
156
|
+
switch (state.state) {
|
|
157
|
+
case 'KeysUnsampled':
|
|
158
|
+
return this.aliceSendFromKeysUnsampled(state);
|
|
159
|
+
case 'KeysSampled':
|
|
160
|
+
return this.aliceSendFromKeysSampled(state);
|
|
161
|
+
case 'HeaderSent':
|
|
162
|
+
// Continue sending ek chunks
|
|
163
|
+
return this.aliceSendFromHeaderSent(state);
|
|
164
|
+
case 'Ct1Received':
|
|
165
|
+
return this.aliceSendFromCt1Received(state);
|
|
166
|
+
case 'EkSentCt1Received':
|
|
167
|
+
// Waiting for more CT2 chunks; send bare CT1 acknowledgements.
|
|
168
|
+
return this.aliceSendFromEkSentCt1Received(state);
|
|
169
|
+
default:
|
|
170
|
+
throw StateTransitionError.invalidTransition(state.state, 'SEND');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
async aliceSendFromKeysUnsampled(state) {
|
|
174
|
+
// Generate new keypair
|
|
175
|
+
const randomness = await this.randomBytes(64);
|
|
176
|
+
let keyPair;
|
|
177
|
+
try {
|
|
178
|
+
keyPair = await this.kem.KeyGen(randomness);
|
|
179
|
+
}
|
|
180
|
+
finally {
|
|
181
|
+
secureZeroBytes(randomness);
|
|
182
|
+
}
|
|
183
|
+
const { dk, ek_seed, ek_vector, hek } = keyPair;
|
|
184
|
+
state.dk = dk;
|
|
185
|
+
state.ek_seed = ek_seed;
|
|
186
|
+
state.ek_vector = ek_vector;
|
|
187
|
+
state.hek = hek;
|
|
188
|
+
// Create header: ek_seed || hek
|
|
189
|
+
const header = new Uint8Array(MLKEM_768_SIZES.EK_SEED_SIZE + 32);
|
|
190
|
+
header.set(ek_seed, 0);
|
|
191
|
+
header.set(hek, MLKEM_768_SIZES.EK_SEED_SIZE);
|
|
192
|
+
// Add MAC
|
|
193
|
+
const headerMac = this.authenticator.MacHdr(state.auth, state.epoch, header);
|
|
194
|
+
const headerWithMac = new Uint8Array(header.length + headerMac.length);
|
|
195
|
+
headerWithMac.set(header, 0);
|
|
196
|
+
headerWithMac.set(headerMac, header.length);
|
|
197
|
+
// Create encoder for header
|
|
198
|
+
state.headerEncoder = await this.createEncoderState(headerWithMac);
|
|
199
|
+
// Create encoder for ek_vector (NO MAC - authenticated via hash binding to hek)
|
|
200
|
+
// The specification HEK = SHA3-256(ek_seed || ek_vector) is transmitted in
|
|
201
|
+
// the authenticated header. Bob verifies EK integrity by recomputing it.
|
|
202
|
+
state.ekEncoder = await this.createEncoderState(ek_vector);
|
|
203
|
+
// Transition to KeysSampled
|
|
204
|
+
this.transition(state, 'KEYGEN');
|
|
205
|
+
// Send first header chunk
|
|
206
|
+
return this.aliceSendHeaderChunk(state);
|
|
207
|
+
}
|
|
208
|
+
async aliceSendFromKeysSampled(state) {
|
|
209
|
+
// Continue sending header chunks
|
|
210
|
+
return this.aliceSendHeaderChunk(state);
|
|
211
|
+
}
|
|
212
|
+
async aliceSendHeaderChunk(state) {
|
|
213
|
+
if (!state.headerEncoder) {
|
|
214
|
+
throw new Error('No header encoder');
|
|
215
|
+
}
|
|
216
|
+
const { chunk, index } = this.getNextEncoderChunk(state.headerEncoder);
|
|
217
|
+
return {
|
|
218
|
+
message: {
|
|
219
|
+
epoch: state.epoch,
|
|
220
|
+
type: MessageType.Hdr,
|
|
221
|
+
chunkIndex: index,
|
|
222
|
+
data: chunk,
|
|
223
|
+
},
|
|
224
|
+
sending_epoch: state.epoch,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
async aliceSendFromHeaderSent(state) {
|
|
228
|
+
// Send ek_vector chunks
|
|
229
|
+
return this.aliceSendEkChunk(state, MessageType.Ek);
|
|
230
|
+
}
|
|
231
|
+
async aliceSendFromCt1Received(state) {
|
|
232
|
+
// Continue sending ek_vector chunks with CT1 acknowledgement until CT2 arrives.
|
|
233
|
+
return this.aliceSendEkChunk(state, MessageType.EkCt1Ack);
|
|
234
|
+
}
|
|
235
|
+
async aliceSendFromEkSentCt1Received(state) {
|
|
236
|
+
// The SPQR v1 Ct1Ack is acknowledgement-only after CT2 reception.
|
|
237
|
+
return {
|
|
238
|
+
message: {
|
|
239
|
+
epoch: state.epoch,
|
|
240
|
+
type: MessageType.Ct1Ack,
|
|
241
|
+
},
|
|
242
|
+
sending_epoch: state.epoch,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
async aliceSendEkChunk(state, type) {
|
|
246
|
+
if (!state.ekEncoder) {
|
|
247
|
+
throw new Error('No ek encoder');
|
|
248
|
+
}
|
|
249
|
+
const { chunk, index } = this.getNextEncoderChunk(state.ekEncoder);
|
|
250
|
+
return {
|
|
251
|
+
message: {
|
|
252
|
+
epoch: state.epoch,
|
|
253
|
+
type,
|
|
254
|
+
chunkIndex: index,
|
|
255
|
+
data: chunk,
|
|
256
|
+
},
|
|
257
|
+
sending_epoch: state.epoch,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
// ===========================================================================
|
|
261
|
+
// Private: Alice Receive Handlers
|
|
262
|
+
// ===========================================================================
|
|
263
|
+
async receiveAlice(state, message) {
|
|
264
|
+
const result = {
|
|
265
|
+
receiving_epoch: message.epoch,
|
|
266
|
+
};
|
|
267
|
+
if (message.epoch < state.epoch) {
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
if (message.epoch > state.epoch) {
|
|
271
|
+
throw StateTransitionError.epochMismatch(state.epoch, message.epoch);
|
|
272
|
+
}
|
|
273
|
+
switch (message.type) {
|
|
274
|
+
case MessageType.Ct1:
|
|
275
|
+
// Bob sending CT1 chunk
|
|
276
|
+
if (message.data && (state.state === 'KeysSampled' || state.state === 'HeaderSent')) {
|
|
277
|
+
const receivedFirstCt1Chunk = state.state === 'KeysSampled';
|
|
278
|
+
// Add CT1 chunk
|
|
279
|
+
if (!state.ct1Decoder) {
|
|
280
|
+
state.ct1Decoder = this.createDecoderState(CT1_SIZE);
|
|
281
|
+
}
|
|
282
|
+
// Use explicit chunkIndex if provided, otherwise fallback to sequential
|
|
283
|
+
const ct1ChunkIndex = message.chunkIndex ?? state.ct1Decoder.receivedChunks;
|
|
284
|
+
this.addDecoderChunk(state.ct1Decoder, ct1ChunkIndex, message.data);
|
|
285
|
+
if (receivedFirstCt1Chunk) {
|
|
286
|
+
this.transition(state, 'RECEIVE_CT1');
|
|
287
|
+
}
|
|
288
|
+
if (this.isDecoderComplete(state.ct1Decoder)) {
|
|
289
|
+
// CT1 complete (NO MAC verification here - combined MAC verified with CT2)
|
|
290
|
+
// Signal authenticates ct1||ct2 together with a single MAC attached to CT2
|
|
291
|
+
const ct1 = await this.getDecodedMessage(state.ct1Decoder);
|
|
292
|
+
// Store CT1 for combined MAC verification when CT2 arrives
|
|
293
|
+
state.ct1_decoded = Uint8Array.from(ct1);
|
|
294
|
+
this.transition(state, 'CT1_COMPLETE');
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
break;
|
|
298
|
+
case MessageType.Ct2:
|
|
299
|
+
// CT2 chunk from Bob
|
|
300
|
+
if (message.data &&
|
|
301
|
+
(state.state === 'Ct1Received' || state.state === 'EkSentCt1Received')) {
|
|
302
|
+
// CT2 is attacker-controlled. Work on a clone so decapsulation and
|
|
303
|
+
// authenticator updates cannot mutate live state before MAC success.
|
|
304
|
+
// Force the portable clone to keep Map identity in cross-realm runtimes.
|
|
305
|
+
const candidateState = cloneProtocolState(state, true);
|
|
306
|
+
const receivedFirstCt2Chunk = candidateState.state === 'Ct1Received';
|
|
307
|
+
if (!candidateState.ct2Decoder) {
|
|
308
|
+
candidateState.ct2Decoder = this.createDecoderState(CT2_SIZE);
|
|
309
|
+
}
|
|
310
|
+
// Use explicit chunkIndex if provided, otherwise fallback to sequential
|
|
311
|
+
const ct2ChunkIndex = message.chunkIndex ?? candidateState.ct2Decoder.receivedChunks;
|
|
312
|
+
this.addDecoderChunk(candidateState.ct2Decoder, ct2ChunkIndex, message.data);
|
|
313
|
+
if (receivedFirstCt2Chunk) {
|
|
314
|
+
this.transition(candidateState, 'RECEIVE_CT2');
|
|
315
|
+
}
|
|
316
|
+
if (this.isDecoderComplete(candidateState.ct2Decoder) &&
|
|
317
|
+
candidateState.state === 'EkSentCt1Received') {
|
|
318
|
+
// CT2 complete - decapsulate, update authenticator, verify MAC, derive key
|
|
319
|
+
// Order: Decapsulate → Update → Verify (Bob updated before computing MAC)
|
|
320
|
+
if (!candidateState.ct1_decoded) {
|
|
321
|
+
throw new Error('CT1 not decoded - state corruption');
|
|
322
|
+
}
|
|
323
|
+
const ct2Data = await this.getDecodedMessage(candidateState.ct2Decoder);
|
|
324
|
+
// Extract CT2 and combined MAC
|
|
325
|
+
const ct1 = candidateState.ct1_decoded;
|
|
326
|
+
const ct2 = ct2Data.subarray(0, MLKEM_768_SIZES.CT2_SIZE);
|
|
327
|
+
const combinedMac = ct2Data.subarray(MLKEM_768_SIZES.CT2_SIZE);
|
|
328
|
+
const combined = new Uint8Array(ct1.length + ct2.length);
|
|
329
|
+
combined.set(ct1, 0);
|
|
330
|
+
combined.set(ct2, ct1.length);
|
|
331
|
+
let shared_secret;
|
|
332
|
+
let outputKeyBytes;
|
|
333
|
+
let outputRetained = false;
|
|
334
|
+
try {
|
|
335
|
+
// Decapsulate first (ML-KEM implicit rejection makes tampering pseudorandom).
|
|
336
|
+
shared_secret = await this.kem.Decaps(candidateState.dk, ct1, ct2);
|
|
337
|
+
outputKeyBytes = await KDF_OK(shared_secret, candidateState.epoch);
|
|
338
|
+
await this.authenticator.Update(candidateState.auth, candidateState.epoch, outputKeyBytes);
|
|
339
|
+
this.authenticator.VfyCt(candidateState.auth, message.epoch, combined, combinedMac);
|
|
340
|
+
result.output_key = {
|
|
341
|
+
epoch: candidateState.epoch,
|
|
342
|
+
epoch_secret: outputKeyBytes,
|
|
343
|
+
};
|
|
344
|
+
this.transition(candidateState, 'CT2_COMPLETE');
|
|
345
|
+
candidateState.epoch += 1n;
|
|
346
|
+
this.resetForNewEpoch(candidateState, candidateState.state);
|
|
347
|
+
// The candidate is now authenticated; commit it in one assignment boundary.
|
|
348
|
+
Object.assign(state, candidateState);
|
|
349
|
+
outputRetained = true;
|
|
350
|
+
}
|
|
351
|
+
finally {
|
|
352
|
+
if (shared_secret)
|
|
353
|
+
secureZeroBytes(shared_secret);
|
|
354
|
+
if (!outputRetained && outputKeyBytes)
|
|
355
|
+
secureZeroBytes(outputKeyBytes);
|
|
356
|
+
secureZeroBytes(combined);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
// Persist only unauthenticated erasure-decoder progress. No key or
|
|
361
|
+
// authenticator state has been changed on this path.
|
|
362
|
+
Object.assign(state, candidateState);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
// ===========================================================================
|
|
370
|
+
// Private: Bob Send Handlers
|
|
371
|
+
// ===========================================================================
|
|
372
|
+
async sendBob(state) {
|
|
373
|
+
switch (state.state) {
|
|
374
|
+
case 'NoHeaderReceived':
|
|
375
|
+
// Nothing to send yet
|
|
376
|
+
return {
|
|
377
|
+
message: { epoch: state.epoch, type: MessageType.None },
|
|
378
|
+
sending_epoch: state.epoch,
|
|
379
|
+
};
|
|
380
|
+
case 'HeaderReceived':
|
|
381
|
+
return this.bobSendFromHeaderReceived(state);
|
|
382
|
+
case 'Ct1Sampled':
|
|
383
|
+
return this.bobSendFromCt1Sampled(state);
|
|
384
|
+
case 'EkReceivedCt1Sampled':
|
|
385
|
+
return this.bobSendFromEkReceivedCt1Sampled(state);
|
|
386
|
+
case 'Ct1Acknowledged':
|
|
387
|
+
return {
|
|
388
|
+
message: { epoch: state.epoch, type: MessageType.None },
|
|
389
|
+
sending_epoch: state.epoch,
|
|
390
|
+
};
|
|
391
|
+
case 'Ct2Sampled':
|
|
392
|
+
return this.bobSendFromCt2Sampled(state);
|
|
393
|
+
default:
|
|
394
|
+
throw StateTransitionError.invalidTransition(state.state, 'SEND');
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
async bobSendFromHeaderReceived(state) {
|
|
398
|
+
// Sample CT1
|
|
399
|
+
if (!state.ek_seed || !state.hek) {
|
|
400
|
+
throw new Error('Missing ek_seed or hek');
|
|
401
|
+
}
|
|
402
|
+
const randomness = await this.randomBytes(32);
|
|
403
|
+
let sharedSecret;
|
|
404
|
+
let outputKeyBytes;
|
|
405
|
+
let completed = false;
|
|
406
|
+
try {
|
|
407
|
+
const encapsulation = await this.kem.Encaps1(state.ek_seed, state.hek, randomness);
|
|
408
|
+
sharedSecret = encapsulation.shared_secret;
|
|
409
|
+
state.encaps_secret = encapsulation.encaps_secret;
|
|
410
|
+
state.ct1 = encapsulation.ct1;
|
|
411
|
+
// Create CT1 encoder (NO MAC - will be combined with CT2).
|
|
412
|
+
state.ct1Encoder = await this.createEncoderState(encapsulation.ct1);
|
|
413
|
+
state.ct1_for_mac = Uint8Array.from(encapsulation.ct1);
|
|
414
|
+
outputKeyBytes = await KDF_OK(sharedSecret, state.epoch);
|
|
415
|
+
// the profile updates at the current epoch.
|
|
416
|
+
await this.authenticator.Update(state.auth, state.epoch, outputKeyBytes);
|
|
417
|
+
this.transition(state, 'SAMPLE_CT1');
|
|
418
|
+
const { chunk, index } = this.getNextEncoderChunk(state.ct1Encoder);
|
|
419
|
+
completed = true;
|
|
420
|
+
return {
|
|
421
|
+
message: {
|
|
422
|
+
epoch: state.epoch,
|
|
423
|
+
type: MessageType.Ct1,
|
|
424
|
+
chunkIndex: index,
|
|
425
|
+
data: chunk,
|
|
426
|
+
},
|
|
427
|
+
sending_epoch: state.epoch,
|
|
428
|
+
output_key: {
|
|
429
|
+
epoch: state.epoch,
|
|
430
|
+
epoch_secret: outputKeyBytes,
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
finally {
|
|
435
|
+
secureZeroBytes(randomness);
|
|
436
|
+
if (sharedSecret)
|
|
437
|
+
secureZeroBytes(sharedSecret);
|
|
438
|
+
// A successfully returned OutputKey transfers ownership to the caller.
|
|
439
|
+
if (!completed && outputKeyBytes)
|
|
440
|
+
secureZeroBytes(outputKeyBytes);
|
|
441
|
+
if (!completed) {
|
|
442
|
+
if (state.encaps_secret)
|
|
443
|
+
secureZeroBytes(state.encaps_secret);
|
|
444
|
+
if (state.ct1_for_mac)
|
|
445
|
+
secureZeroBytes(state.ct1_for_mac);
|
|
446
|
+
state.encaps_secret = undefined;
|
|
447
|
+
state.ct1_for_mac = undefined;
|
|
448
|
+
state.ct1 = undefined;
|
|
449
|
+
state.ct1Encoder = undefined;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
async bobSendFromCt1Sampled(state) {
|
|
454
|
+
// Continue sending CT1 chunks
|
|
455
|
+
return this.bobSendCt1Chunk(state);
|
|
456
|
+
}
|
|
457
|
+
async bobSendFromEkReceivedCt1Sampled(state) {
|
|
458
|
+
// EK is complete, but Signal waits for CT1 acknowledgement before CT2.
|
|
459
|
+
// Continue sending CT1 chunks, including parity, until the peer ACK arrives.
|
|
460
|
+
return this.bobSendCt1Chunk(state);
|
|
461
|
+
}
|
|
462
|
+
async bobSendCt1Chunk(state) {
|
|
463
|
+
if (!state.ct1Encoder) {
|
|
464
|
+
throw new Error('No CT1 encoder');
|
|
465
|
+
}
|
|
466
|
+
const { chunk, index } = this.getNextEncoderChunk(state.ct1Encoder);
|
|
467
|
+
return {
|
|
468
|
+
message: {
|
|
469
|
+
epoch: state.epoch,
|
|
470
|
+
type: MessageType.Ct1,
|
|
471
|
+
chunkIndex: index,
|
|
472
|
+
data: chunk,
|
|
473
|
+
},
|
|
474
|
+
sending_epoch: state.epoch,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
async bobSendFromCt2Sampled(state) {
|
|
478
|
+
if (!state.ct2Encoder) {
|
|
479
|
+
throw new Error('No CT2 encoder');
|
|
480
|
+
}
|
|
481
|
+
const { chunk, index } = this.getNextEncoderChunk(state.ct2Encoder);
|
|
482
|
+
return {
|
|
483
|
+
message: {
|
|
484
|
+
epoch: state.epoch,
|
|
485
|
+
type: MessageType.Ct2,
|
|
486
|
+
chunkIndex: index,
|
|
487
|
+
data: chunk,
|
|
488
|
+
},
|
|
489
|
+
sending_epoch: state.epoch,
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
// ===========================================================================
|
|
493
|
+
// Private: Bob Receive Handlers
|
|
494
|
+
// ===========================================================================
|
|
495
|
+
async receiveBob(state, message) {
|
|
496
|
+
const result = {
|
|
497
|
+
receiving_epoch: message.epoch,
|
|
498
|
+
};
|
|
499
|
+
if (message.epoch < state.epoch) {
|
|
500
|
+
return result;
|
|
501
|
+
}
|
|
502
|
+
// Ct2Sampled: next-epoch message triggers role swap
|
|
503
|
+
// Signal does NOT re-process the message — just transitions and returns
|
|
504
|
+
if (state.state === 'Ct2Sampled' && message.epoch === state.epoch + 1n) {
|
|
505
|
+
this.transition(state, 'BOB_NEW_EPOCH');
|
|
506
|
+
state.epoch += 1n;
|
|
507
|
+
this.resetForNewEpoch(state, state.state);
|
|
508
|
+
return { receiving_epoch: message.epoch };
|
|
509
|
+
}
|
|
510
|
+
if (message.epoch > state.epoch) {
|
|
511
|
+
throw StateTransitionError.epochMismatch(state.epoch, message.epoch);
|
|
512
|
+
}
|
|
513
|
+
switch (message.type) {
|
|
514
|
+
case MessageType.Hdr:
|
|
515
|
+
// Header chunk from Alice
|
|
516
|
+
if (message.data && state.state === 'NoHeaderReceived') {
|
|
517
|
+
// The completing chunk is unauthenticated until the reconstructed
|
|
518
|
+
// header MAC verifies. Work against a candidate and commit once.
|
|
519
|
+
const candidateState = cloneProtocolState(state, true);
|
|
520
|
+
if (!candidateState.headerDecoder) {
|
|
521
|
+
candidateState.headerDecoder = this.createDecoderState(HEADER_SIZE);
|
|
522
|
+
}
|
|
523
|
+
// Use explicit chunkIndex if provided, otherwise fallback to sequential
|
|
524
|
+
const hdrChunkIndex = message.chunkIndex ?? candidateState.headerDecoder.receivedChunks;
|
|
525
|
+
this.addDecoderChunk(candidateState.headerDecoder, hdrChunkIndex, message.data);
|
|
526
|
+
if (this.isDecoderComplete(candidateState.headerDecoder)) {
|
|
527
|
+
// Header complete - parse and verify
|
|
528
|
+
const headerData = await this.getDecodedMessage(candidateState.headerDecoder);
|
|
529
|
+
// Extract header components and MAC
|
|
530
|
+
const headerSize = MLKEM_768_SIZES.EK_SEED_SIZE + 32; // ek_seed + hek
|
|
531
|
+
const header = headerData.subarray(0, headerSize);
|
|
532
|
+
const headerMac = headerData.subarray(headerSize);
|
|
533
|
+
// Verify header MAC
|
|
534
|
+
this.authenticator.VfyHdr(candidateState.auth, message.epoch, header, headerMac);
|
|
535
|
+
// Parse ek_seed and hek
|
|
536
|
+
candidateState.ek_seed = Uint8Array.from(header.subarray(0, MLKEM_768_SIZES.EK_SEED_SIZE));
|
|
537
|
+
candidateState.hek = Uint8Array.from(header.subarray(MLKEM_768_SIZES.EK_SEED_SIZE));
|
|
538
|
+
this.transition(candidateState, 'HEADER_COMPLETE');
|
|
539
|
+
}
|
|
540
|
+
Object.assign(state, candidateState);
|
|
541
|
+
}
|
|
542
|
+
break;
|
|
543
|
+
case MessageType.Ek:
|
|
544
|
+
case MessageType.EkCt1Ack:
|
|
545
|
+
// EK vector chunk from Alice
|
|
546
|
+
if (state.state === 'EkReceivedCt1Sampled' && message.type === MessageType.EkCt1Ack) {
|
|
547
|
+
this.transition(state, 'EKCT1_ACK');
|
|
548
|
+
await this.bobSampleCt2(state);
|
|
549
|
+
}
|
|
550
|
+
else if (message.data &&
|
|
551
|
+
(state.state === 'Ct1Sampled' || state.state === 'Ct1Acknowledged')) {
|
|
552
|
+
// EK completion verifies the authenticated header commitment and may
|
|
553
|
+
// consume Encaps2 state, so isolate it until both operations succeed.
|
|
554
|
+
const candidateState = cloneProtocolState(state, true);
|
|
555
|
+
if (!candidateState.ekDecoder) {
|
|
556
|
+
candidateState.ekDecoder = this.createDecoderState(EK_SIZE);
|
|
557
|
+
}
|
|
558
|
+
// Use explicit chunkIndex if provided, otherwise fallback to sequential
|
|
559
|
+
const ekChunkIndex = message.chunkIndex ?? candidateState.ekDecoder.receivedChunks;
|
|
560
|
+
this.addDecoderChunk(candidateState.ekDecoder, ekChunkIndex, message.data);
|
|
561
|
+
// Handle state transitions based on EK completion
|
|
562
|
+
if (this.isDecoderComplete(candidateState.ekDecoder)) {
|
|
563
|
+
const ekVector = await this.getDecodedMessage(candidateState.ekDecoder);
|
|
564
|
+
// Verify the specification's seed-first hash binding.
|
|
565
|
+
// The hek was transmitted in the authenticated header, so this provides integrity
|
|
566
|
+
this.verifyEkHashBinding(candidateState.ek_seed, ekVector, candidateState.hek, message.epoch);
|
|
567
|
+
candidateState.ek_vector = Uint8Array.from(ekVector);
|
|
568
|
+
if (candidateState.state === 'Ct1Sampled') {
|
|
569
|
+
if (message.type === MessageType.EkCt1Ack) {
|
|
570
|
+
// EK complete and CT1 acknowledged
|
|
571
|
+
this.transition(candidateState, 'EKCT1_ACK_EK_COMPLETE');
|
|
572
|
+
await this.bobSampleCt2(candidateState);
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
// EK complete, no ack yet
|
|
576
|
+
this.transition(candidateState, 'EK_COMPLETE_NO_ACK');
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
else if (candidateState.state === 'Ct1Acknowledged') {
|
|
580
|
+
this.transition(candidateState, 'EK_COMPLETE');
|
|
581
|
+
await this.bobSampleCt2(candidateState);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
else if (message.type === MessageType.EkCt1Ack &&
|
|
585
|
+
candidateState.state === 'Ct1Sampled') {
|
|
586
|
+
// CT1 was acknowledged, but EK is still incomplete.
|
|
587
|
+
this.transition(candidateState, 'EKCT1_ACK_EK_INCOMPLETE');
|
|
588
|
+
}
|
|
589
|
+
Object.assign(state, candidateState);
|
|
590
|
+
}
|
|
591
|
+
break;
|
|
592
|
+
case MessageType.Ct1Ack:
|
|
593
|
+
if (state.state === 'EkReceivedCt1Sampled') {
|
|
594
|
+
this.transition(state, 'EKCT1_ACK');
|
|
595
|
+
await this.bobSampleCt2(state);
|
|
596
|
+
}
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
599
|
+
return result;
|
|
600
|
+
}
|
|
601
|
+
async bobSampleCt2(state) {
|
|
602
|
+
if (!state.encaps_secret || !state.ek_seed || !state.ek_vector) {
|
|
603
|
+
throw new Error('Missing encaps_secret, ek_seed, or ek_vector');
|
|
604
|
+
}
|
|
605
|
+
// Complete encapsulation. The state machine owns this one-shot secret and
|
|
606
|
+
// clears its field whether Encaps2 succeeds or rejects.
|
|
607
|
+
const encapsSecret = state.encaps_secret;
|
|
608
|
+
let ct2;
|
|
609
|
+
try {
|
|
610
|
+
ct2 = await this.kem.Encaps2(encapsSecret, state.ek_seed, state.ek_vector);
|
|
611
|
+
}
|
|
612
|
+
finally {
|
|
613
|
+
secureZeroBytes(encapsSecret);
|
|
614
|
+
state.encaps_secret = undefined;
|
|
615
|
+
}
|
|
616
|
+
state.ct2 = ct2;
|
|
617
|
+
// Create CT2 encoder with COMBINED MAC on ct1||ct2
|
|
618
|
+
// Signal authenticates both ciphertext components together
|
|
619
|
+
if (!state.ct1_for_mac) {
|
|
620
|
+
throw new Error('CT1 not stored for combined MAC - state corruption');
|
|
621
|
+
}
|
|
622
|
+
const combined = new Uint8Array(state.ct1_for_mac.length + ct2.length);
|
|
623
|
+
combined.set(state.ct1_for_mac, 0);
|
|
624
|
+
combined.set(ct2, state.ct1_for_mac.length);
|
|
625
|
+
const combinedMac = this.authenticator.MacCt(state.auth, state.epoch, combined);
|
|
626
|
+
// Encode ct2 || combinedMac
|
|
627
|
+
const ct2WithMac = new Uint8Array(ct2.length + combinedMac.length);
|
|
628
|
+
ct2WithMac.set(ct2, 0);
|
|
629
|
+
ct2WithMac.set(combinedMac, ct2.length);
|
|
630
|
+
state.ct2Encoder = await this.createEncoderState(ct2WithMac);
|
|
631
|
+
// Best-effort clear ct1_for_mac (no longer needed).
|
|
632
|
+
state.ct1_for_mac.fill(0);
|
|
633
|
+
state.ct1_for_mac = undefined;
|
|
634
|
+
}
|
|
635
|
+
// ===========================================================================
|
|
636
|
+
// Private: Epoch Reset
|
|
637
|
+
// ===========================================================================
|
|
638
|
+
/**
|
|
639
|
+
* Reset state for a new epoch after role swap.
|
|
640
|
+
* Zeros sensitive material and clears role-specific fields.
|
|
641
|
+
* Only epoch and auth survive.
|
|
642
|
+
*/
|
|
643
|
+
resetForNewEpoch(state, newState) {
|
|
644
|
+
// Zero all sensitive Uint8Array fields present on the state
|
|
645
|
+
const uint8Fields = [
|
|
646
|
+
'dk',
|
|
647
|
+
'ek_seed',
|
|
648
|
+
'ek_vector',
|
|
649
|
+
'hek',
|
|
650
|
+
'encaps_secret',
|
|
651
|
+
'ct1',
|
|
652
|
+
'ct2',
|
|
653
|
+
'ct1_for_mac',
|
|
654
|
+
'ct1_decoded',
|
|
655
|
+
];
|
|
656
|
+
for (const field of uint8Fields) {
|
|
657
|
+
const val = state[field];
|
|
658
|
+
if (val instanceof Uint8Array && val.length > 0)
|
|
659
|
+
val.fill(0);
|
|
660
|
+
}
|
|
661
|
+
// Zero encoder data buffers
|
|
662
|
+
for (const field of ['headerEncoder', 'ekEncoder', 'ct1Encoder', 'ct2Encoder']) {
|
|
663
|
+
if (state[field]?.data instanceof Uint8Array)
|
|
664
|
+
state[field].data.fill(0);
|
|
665
|
+
}
|
|
666
|
+
// Zero decoder chunk Map entries
|
|
667
|
+
for (const field of ['headerDecoder', 'ekDecoder', 'ct1Decoder', 'ct2Decoder']) {
|
|
668
|
+
const decoder = state[field];
|
|
669
|
+
if (decoder?.chunks) {
|
|
670
|
+
for (const chunk of decoder.chunks.values()) {
|
|
671
|
+
chunk.fill(0);
|
|
672
|
+
}
|
|
673
|
+
decoder.chunks.clear();
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
// Clear all role-specific fields
|
|
677
|
+
state.dk = undefined;
|
|
678
|
+
state.ek_seed = undefined;
|
|
679
|
+
state.ek_vector = undefined;
|
|
680
|
+
state.hek = undefined;
|
|
681
|
+
state.encaps_secret = undefined;
|
|
682
|
+
state.ct1 = undefined;
|
|
683
|
+
state.ct2 = undefined;
|
|
684
|
+
state.ct1_for_mac = undefined;
|
|
685
|
+
state.ct1_decoded = undefined;
|
|
686
|
+
state.headerEncoder = undefined;
|
|
687
|
+
state.ekEncoder = undefined;
|
|
688
|
+
state.ct1Decoder = undefined;
|
|
689
|
+
state.ct2Decoder = undefined;
|
|
690
|
+
state.headerDecoder = undefined;
|
|
691
|
+
state.ekDecoder = undefined;
|
|
692
|
+
state.ct1Encoder = undefined;
|
|
693
|
+
state.ct2Encoder = undefined;
|
|
694
|
+
// Update the state
|
|
695
|
+
state.state = newState;
|
|
696
|
+
// Initialize role-specific state for the new epoch
|
|
697
|
+
if (BOB_STATES.has(newState)) {
|
|
698
|
+
// Bob needs a header decoder immediately
|
|
699
|
+
state.headerDecoder = this.createDecoderState(HEADER_SIZE);
|
|
700
|
+
}
|
|
701
|
+
// Alice needs nothing — keys generated lazily on first Send()
|
|
702
|
+
}
|
|
703
|
+
// ===========================================================================
|
|
704
|
+
// Private: Encoder/Decoder Helpers
|
|
705
|
+
// ===========================================================================
|
|
706
|
+
async createEncoderState(data) {
|
|
707
|
+
// Use Signal-compliant polynomial encoder (PolyEncoder)
|
|
708
|
+
// PolyEncoder validates message size internally (max 1152 bytes)
|
|
709
|
+
const encoder = await createEncoder(data);
|
|
710
|
+
const totalChunks = Math.ceil(data.length / PROTOCOL_CONSTANTS.CHUNK_SIZE);
|
|
711
|
+
return {
|
|
712
|
+
data,
|
|
713
|
+
currentChunk: 0,
|
|
714
|
+
totalChunks: Math.ceil(totalChunks * 1.3), // Include ~30% parity
|
|
715
|
+
isComplete: false,
|
|
716
|
+
encoder, // Cache encoder for O(1) chunk retrieval
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
createDecoderState(messageSize) {
|
|
720
|
+
return {
|
|
721
|
+
receivedChunks: 0,
|
|
722
|
+
requiredChunks: Math.ceil(messageSize / PROTOCOL_CONSTANTS.CHUNK_SIZE),
|
|
723
|
+
messageSize,
|
|
724
|
+
chunks: new Map(),
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
normalizeEncoderData(data) {
|
|
728
|
+
if (data instanceof Uint8Array) {
|
|
729
|
+
return data;
|
|
730
|
+
}
|
|
731
|
+
if (ArrayBuffer.isView(data) && !(data instanceof DataView)) {
|
|
732
|
+
const view = data;
|
|
733
|
+
return new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
|
|
734
|
+
}
|
|
735
|
+
if (Array.isArray(data)) {
|
|
736
|
+
return new Uint8Array(data);
|
|
737
|
+
}
|
|
738
|
+
if (data && typeof data === 'object') {
|
|
739
|
+
const record = data;
|
|
740
|
+
if (record.type === 'Buffer' && Array.isArray(record.data)) {
|
|
741
|
+
return new Uint8Array(record.data);
|
|
742
|
+
}
|
|
743
|
+
const numericKeys = Object.keys(record)
|
|
744
|
+
.filter((key) => /^\d+$/.test(key))
|
|
745
|
+
.sort((a, b) => Number(a) - Number(b));
|
|
746
|
+
if (numericKeys.length > 0) {
|
|
747
|
+
return new Uint8Array(numericKeys.map((key) => Number(record[key])));
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
throw new Error('Cannot restore Braid encoder data from persisted state');
|
|
751
|
+
}
|
|
752
|
+
restoreEncoder(state) {
|
|
753
|
+
const cachedEncoder = state.encoder;
|
|
754
|
+
if (cachedEncoder &&
|
|
755
|
+
typeof cachedEncoder.nextChunk === 'function' &&
|
|
756
|
+
typeof cachedEncoder.isDataComplete === 'function') {
|
|
757
|
+
return cachedEncoder;
|
|
758
|
+
}
|
|
759
|
+
state.data = this.normalizeEncoderData(state.data);
|
|
760
|
+
const encoder = PolyEncoder.restore(state.data, state.currentChunk);
|
|
761
|
+
state.encoder = encoder;
|
|
762
|
+
return encoder;
|
|
763
|
+
}
|
|
764
|
+
getNextEncoderChunk(state) {
|
|
765
|
+
// Encoder instances are runtime caches. Storage/decrypt-attempt clone
|
|
766
|
+
// boundaries can restore them as plain objects, so rebuild on demand from
|
|
767
|
+
// the durable encoder state before emitting the next chunk.
|
|
768
|
+
const encoder = this.restoreEncoder(state);
|
|
769
|
+
if (!encoder.hasMoreChunks()) {
|
|
770
|
+
throw new Error('Braid encoder exhausted all GF(2^16) evaluation points');
|
|
771
|
+
}
|
|
772
|
+
const index = state.currentChunk;
|
|
773
|
+
const chunk = encoder.nextChunk();
|
|
774
|
+
state.currentChunk++;
|
|
775
|
+
state.isComplete = encoder.isDataComplete();
|
|
776
|
+
return { chunk, index };
|
|
777
|
+
}
|
|
778
|
+
restoreDecoderChunks(state) {
|
|
779
|
+
if (state.chunks instanceof Map) {
|
|
780
|
+
return state.chunks;
|
|
781
|
+
}
|
|
782
|
+
const rawChunks = state.chunks;
|
|
783
|
+
const chunks = new Map();
|
|
784
|
+
if (Array.isArray(rawChunks)) {
|
|
785
|
+
for (const entry of rawChunks) {
|
|
786
|
+
if (!Array.isArray(entry) || entry.length !== 2) {
|
|
787
|
+
continue;
|
|
788
|
+
}
|
|
789
|
+
const [index, chunk] = entry;
|
|
790
|
+
if (Number.isInteger(Number(index))) {
|
|
791
|
+
chunks.set(Number(index), this.normalizeEncoderData(chunk));
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
else if (rawChunks && typeof rawChunks === 'object') {
|
|
796
|
+
const maybeTaggedMap = rawChunks;
|
|
797
|
+
if (maybeTaggedMap.__signalProtocolJsonType === 'map' &&
|
|
798
|
+
Array.isArray(maybeTaggedMap.entries)) {
|
|
799
|
+
for (const entry of maybeTaggedMap.entries) {
|
|
800
|
+
if (!Array.isArray(entry) || entry.length !== 2) {
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
const [index, chunk] = entry;
|
|
804
|
+
if (Number.isInteger(Number(index))) {
|
|
805
|
+
chunks.set(Number(index), this.normalizeEncoderData(chunk));
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
else {
|
|
810
|
+
for (const [index, chunk] of Object.entries(rawChunks)) {
|
|
811
|
+
if (Number.isInteger(Number(index))) {
|
|
812
|
+
chunks.set(Number(index), this.normalizeEncoderData(chunk));
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
state.chunks = chunks;
|
|
818
|
+
state.receivedChunks = chunks.size;
|
|
819
|
+
return chunks;
|
|
820
|
+
}
|
|
821
|
+
addDecoderChunk(state, chunkIndex, chunk) {
|
|
822
|
+
const chunks = this.restoreDecoderChunks(state);
|
|
823
|
+
assertBraidChunkIndex(chunkIndex);
|
|
824
|
+
if (chunk.length !== PROTOCOL_CONSTANTS.CHUNK_SIZE) {
|
|
825
|
+
throw new Error(`Braid chunk must contain exactly ${PROTOCOL_CONSTANTS.CHUNK_SIZE} bytes`);
|
|
826
|
+
}
|
|
827
|
+
const existing = chunks.get(chunkIndex);
|
|
828
|
+
if (existing) {
|
|
829
|
+
if (!constantTimeEqual(existing, chunk)) {
|
|
830
|
+
throw new Error(`Conflicting duplicate Braid chunk at index ${chunkIndex}`);
|
|
831
|
+
}
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
chunks.set(chunkIndex, Uint8Array.from(chunk));
|
|
835
|
+
state.receivedChunks = chunks.size;
|
|
836
|
+
}
|
|
837
|
+
isDecoderComplete(state) {
|
|
838
|
+
return this.restoreDecoderChunks(state).size >= state.requiredChunks;
|
|
839
|
+
}
|
|
840
|
+
async getDecodedMessage(state) {
|
|
841
|
+
const decoder = await createDecoder(state.messageSize);
|
|
842
|
+
this.restoreDecoderChunks(state).forEach((chunk, index) => {
|
|
843
|
+
decoder.addChunk(index, chunk);
|
|
844
|
+
});
|
|
845
|
+
const message = decoder.message();
|
|
846
|
+
if (!message) {
|
|
847
|
+
throw new Error('Failed to decode message');
|
|
848
|
+
}
|
|
849
|
+
return message;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Verify EK vector integrity via hash binding
|
|
853
|
+
*
|
|
854
|
+
* The ML-KEM Braid specification authenticates EK through the header's hek:
|
|
855
|
+
* hek = SHA3-256(ek_seed || ek_vector)
|
|
856
|
+
*
|
|
857
|
+
* The header (containing hek) is MAC-authenticated, so verifying
|
|
858
|
+
* the hash provides integrity for the EK vector.
|
|
859
|
+
*
|
|
860
|
+
* @param ekSeed - The ek_seed (rho) from the header
|
|
861
|
+
* @param ekVector - The received EK vector (tHat)
|
|
862
|
+
* @param expectedHek - The hek from the authenticated header
|
|
863
|
+
* @param epoch - Current epoch for error reporting
|
|
864
|
+
* @throws AuthenticatorError if hash doesn't match
|
|
865
|
+
*/
|
|
866
|
+
verifyEkHashBinding(ekSeed, ekVector, expectedHek, epoch) {
|
|
867
|
+
const computedHek = computeHek(ekSeed, ekVector);
|
|
868
|
+
// Best-effort full-scan comparison; JavaScript provides no timing guarantee.
|
|
869
|
+
if (!constantTimeEqual(computedHek, expectedHek)) {
|
|
870
|
+
throw AuthenticatorError.ekHashBindingFailed(epoch);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Transition state machine
|
|
875
|
+
*
|
|
876
|
+
* @param state - Current state (will be mutated)
|
|
877
|
+
* @param event - Transition event name
|
|
878
|
+
*/
|
|
879
|
+
transition(state, event) {
|
|
880
|
+
const transitions = STATE_TRANSITIONS[state.state];
|
|
881
|
+
const nextState = transitions?.[event];
|
|
882
|
+
if (!nextState) {
|
|
883
|
+
throw StateTransitionError.invalidTransition(state.state, event);
|
|
884
|
+
}
|
|
885
|
+
state.state = nextState;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Create a new ML-KEM Braid state machine
|
|
890
|
+
*/
|
|
891
|
+
export function createStateMachine(randomBytes) {
|
|
892
|
+
return new MLKEMBraidStateMachine(randomBytes);
|
|
893
|
+
}
|
|
894
|
+
//# sourceMappingURL=state-machine.js.map
|