ts-mls 1.0.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/LICENSE +21 -0
- package/README.md +194 -0
- package/dist/codec/number.d.ts +10 -0
- package/dist/codec/number.js +73 -0
- package/dist/codec/number.js.map +1 -0
- package/dist/codec/optional.d.ts +4 -0
- package/dist/codec/optional.js +24 -0
- package/dist/codec/optional.js.map +1 -0
- package/dist/codec/tlsDecoder.d.ts +16 -0
- package/dist/codec/tlsDecoder.js +98 -0
- package/dist/codec/tlsDecoder.js.map +1 -0
- package/dist/codec/tlsEncoder.d.ts +9 -0
- package/dist/codec/tlsEncoder.js +29 -0
- package/dist/codec/tlsEncoder.js.map +1 -0
- package/dist/codec/variableLength.d.ts +10 -0
- package/dist/codec/variableLength.js +102 -0
- package/dist/codec/variableLength.js.map +1 -0
- package/dist/codec/vector.d.ts +10 -0
- package/dist/codec/vector.js +76 -0
- package/dist/codec/vector.js.map +1 -0
- package/dist/crypto/aead.d.ts +5 -0
- package/dist/crypto/aead.js +56 -0
- package/dist/crypto/aead.js.map +1 -0
- package/dist/crypto/ciphersuite.d.ts +47 -0
- package/dist/crypto/ciphersuite.js +208 -0
- package/dist/crypto/ciphersuite.js.map +1 -0
- package/dist/crypto/hash.d.ts +8 -0
- package/dist/crypto/hash.js +36 -0
- package/dist/crypto/hash.js.map +1 -0
- package/dist/crypto/hpke.d.ts +46 -0
- package/dist/crypto/hpke.js +73 -0
- package/dist/crypto/hpke.js.map +1 -0
- package/dist/crypto/kdf.d.ts +12 -0
- package/dist/crypto/kdf.js +49 -0
- package/dist/crypto/kdf.js.map +1 -0
- package/dist/crypto/kem.d.ts +3 -0
- package/dist/crypto/kem.js +29 -0
- package/dist/crypto/kem.js.map +1 -0
- package/dist/crypto/rng.d.ts +4 -0
- package/dist/crypto/rng.js +9 -0
- package/dist/crypto/rng.js.map +1 -0
- package/dist/crypto/signature.d.ts +12 -0
- package/dist/crypto/signature.js +73 -0
- package/dist/crypto/signature.js.map +1 -0
- package/dist/src/AuthenticationService.d.ts +7 -0
- package/dist/src/AuthenticationService.js +9 -0
- package/dist/src/AuthenticationService.js.map +1 -0
- package/dist/src/IncomingMessageAction.d.ts +10 -0
- package/dist/src/IncomingMessageAction.d.ts.map +1 -0
- package/dist/src/IncomingMessageAction.js +6 -0
- package/dist/src/IncomingMessageAction.js.map +1 -0
- package/dist/src/PaddingConfig.d.ts +9 -0
- package/dist/src/PaddingConfig.js +12 -0
- package/dist/src/PaddingConfig.js.map +1 -0
- package/dist/src/authenticatedContent.d.ts +32 -0
- package/dist/src/authenticatedContent.d.ts.map +1 -0
- package/dist/src/authenticatedContent.js +32 -0
- package/dist/src/authenticatedContent.js.map +1 -0
- package/dist/src/authenticationService.d.ts.map +1 -0
- package/dist/src/capabilities.d.ts +14 -0
- package/dist/src/capabilities.d.ts.map +1 -0
- package/dist/src/capabilities.js +31 -0
- package/dist/src/capabilities.js.map +1 -0
- package/dist/src/clientConfig.d.ts +21 -0
- package/dist/src/clientConfig.d.ts.map +1 -0
- package/dist/src/clientConfig.js +16 -0
- package/dist/src/clientConfig.js.map +1 -0
- package/dist/src/clientState.d.ts +122 -0
- package/dist/src/clientState.d.ts.map +1 -0
- package/dist/src/clientState.js +562 -0
- package/dist/src/clientState.js.map +1 -0
- package/dist/src/codec/number.d.ts +10 -0
- package/dist/src/codec/number.d.ts.map +1 -0
- package/dist/src/codec/number.js +67 -0
- package/dist/src/codec/number.js.map +1 -0
- package/dist/src/codec/optional.d.ts +4 -0
- package/dist/src/codec/optional.d.ts.map +1 -0
- package/dist/src/codec/optional.js +24 -0
- package/dist/src/codec/optional.js.map +1 -0
- package/dist/src/codec/tlsDecoder.d.ts +14 -0
- package/dist/src/codec/tlsDecoder.d.ts.map +1 -0
- package/dist/src/codec/tlsDecoder.js +90 -0
- package/dist/src/codec/tlsDecoder.js.map +1 -0
- package/dist/src/codec/tlsEncoder.d.ts +9 -0
- package/dist/src/codec/tlsEncoder.d.ts.map +1 -0
- package/dist/src/codec/tlsEncoder.js +29 -0
- package/dist/src/codec/tlsEncoder.js.map +1 -0
- package/dist/src/codec/variableLength.d.ts +11 -0
- package/dist/src/codec/variableLength.d.ts.map +1 -0
- package/dist/src/codec/variableLength.js +104 -0
- package/dist/src/codec/variableLength.js.map +1 -0
- package/dist/src/commit.d.ts +10 -0
- package/dist/src/commit.d.ts.map +1 -0
- package/dist/src/commit.js +12 -0
- package/dist/src/commit.js.map +1 -0
- package/dist/src/contentType.d.ts +12 -0
- package/dist/src/contentType.d.ts.map +1 -0
- package/dist/src/contentType.js +15 -0
- package/dist/src/contentType.js.map +1 -0
- package/dist/src/createCommit.d.ts +32 -0
- package/dist/src/createCommit.d.ts.map +1 -0
- package/dist/src/createCommit.js +260 -0
- package/dist/src/createCommit.js.map +1 -0
- package/dist/src/createMessage.d.ts +24 -0
- package/dist/src/createMessage.d.ts.map +1 -0
- package/dist/src/createMessage.js +36 -0
- package/dist/src/createMessage.js.map +1 -0
- package/dist/src/credential.d.ts +21 -0
- package/dist/src/credential.d.ts.map +1 -0
- package/dist/src/credential.js +35 -0
- package/dist/src/credential.js.map +1 -0
- package/dist/src/credentialType.d.ts +11 -0
- package/dist/src/credentialType.d.ts.map +1 -0
- package/dist/src/credentialType.js +14 -0
- package/dist/src/credentialType.js.map +1 -0
- package/dist/src/crypto/aead.d.ts +8 -0
- package/dist/src/crypto/aead.d.ts.map +1 -0
- package/dist/src/crypto/aead.js +105 -0
- package/dist/src/crypto/aead.js.map +1 -0
- package/dist/src/crypto/ciphersuite.d.ts +51 -0
- package/dist/src/crypto/ciphersuite.d.ts.map +1 -0
- package/dist/src/crypto/ciphersuite.js +252 -0
- package/dist/src/crypto/ciphersuite.js.map +1 -0
- package/dist/src/crypto/hash.d.ts +8 -0
- package/dist/src/crypto/hash.d.ts.map +1 -0
- package/dist/src/crypto/hash.js +36 -0
- package/dist/src/crypto/hash.js.map +1 -0
- package/dist/src/crypto/hpke.d.ts +51 -0
- package/dist/src/crypto/hpke.d.ts.map +1 -0
- package/dist/src/crypto/hpke.js +114 -0
- package/dist/src/crypto/hpke.js.map +1 -0
- package/dist/src/crypto/kdf.d.ts +12 -0
- package/dist/src/crypto/kdf.d.ts.map +1 -0
- package/dist/src/crypto/kdf.js +49 -0
- package/dist/src/crypto/kdf.js.map +1 -0
- package/dist/src/crypto/kem.d.ts +3 -0
- package/dist/src/crypto/kem.d.ts.map +1 -0
- package/dist/src/crypto/kem.js +85 -0
- package/dist/src/crypto/kem.js.map +1 -0
- package/dist/src/crypto/rng.d.ts +4 -0
- package/dist/src/crypto/rng.d.ts.map +1 -0
- package/dist/src/crypto/rng.js +9 -0
- package/dist/src/crypto/rng.js.map +1 -0
- package/dist/src/crypto/signature.d.ts +12 -0
- package/dist/src/crypto/signature.d.ts.map +1 -0
- package/dist/src/crypto/signature.js +165 -0
- package/dist/src/crypto/signature.js.map +1 -0
- package/dist/src/customCredential.d.ts +2 -0
- package/dist/src/customCredential.d.ts.map +1 -0
- package/dist/src/customCredential.js +14 -0
- package/dist/src/customCredential.js.map +1 -0
- package/dist/src/customExtension.d.ts +2 -0
- package/dist/src/customExtension.js +11 -0
- package/dist/src/customExtension.js.map +1 -0
- package/dist/src/customProposal.d.ts +2 -0
- package/dist/src/customProposal.js +11 -0
- package/dist/src/customProposal.js.map +1 -0
- package/dist/src/defaultCapabilities.d.ts +2 -0
- package/dist/src/defaultCapabilities.d.ts.map +1 -0
- package/dist/src/defaultCapabilities.js +15 -0
- package/dist/src/defaultCapabilities.js.map +1 -0
- package/dist/src/defaultExtensionType.d.ts +13 -0
- package/dist/src/defaultExtensionType.d.ts.map +1 -0
- package/dist/src/defaultExtensionType.js +17 -0
- package/dist/src/defaultExtensionType.js.map +1 -0
- package/dist/src/defaultProposalType.d.ts +15 -0
- package/dist/src/defaultProposalType.d.ts.map +1 -0
- package/dist/src/defaultProposalType.js +19 -0
- package/dist/src/defaultProposalType.js.map +1 -0
- package/dist/src/extension.d.ts +18 -0
- package/dist/src/extension.d.ts.map +1 -0
- package/dist/src/extension.js +38 -0
- package/dist/src/extension.js.map +1 -0
- package/dist/src/extensionType.d.ts +13 -0
- package/dist/src/extensionType.js +17 -0
- package/dist/src/extensionType.js.map +1 -0
- package/dist/src/externalProposal.d.ts +7 -0
- package/dist/src/externalProposal.d.ts.map +1 -0
- package/dist/src/externalProposal.js +44 -0
- package/dist/src/externalProposal.js.map +1 -0
- package/dist/src/externalSender.d.ts +9 -0
- package/dist/src/externalSender.d.ts.map +1 -0
- package/dist/src/externalSender.js +10 -0
- package/dist/src/externalSender.js.map +1 -0
- package/dist/src/framedContent.d.ts +113 -0
- package/dist/src/framedContent.d.ts.map +1 -0
- package/dist/src/framedContent.js +144 -0
- package/dist/src/framedContent.js.map +1 -0
- package/dist/src/grease.d.ts +16 -0
- package/dist/src/grease.d.ts.map +1 -0
- package/dist/src/grease.js +37 -0
- package/dist/src/grease.js.map +1 -0
- package/dist/src/groupContext.d.ts +19 -0
- package/dist/src/groupContext.d.ts.map +1 -0
- package/dist/src/groupContext.js +49 -0
- package/dist/src/groupContext.js.map +1 -0
- package/dist/src/groupInfo.d.ts +26 -0
- package/dist/src/groupInfo.d.ts.map +1 -0
- package/dist/src/groupInfo.js +55 -0
- package/dist/src/groupInfo.js.map +1 -0
- package/dist/src/groupSecrets.d.ts +10 -0
- package/dist/src/groupSecrets.d.ts.map +1 -0
- package/dist/src/groupSecrets.js +11 -0
- package/dist/src/groupSecrets.js.map +1 -0
- package/dist/src/hpkeCiphertext.d.ts +8 -0
- package/dist/src/hpkeCiphertext.d.ts.map +1 -0
- package/dist/src/hpkeCiphertext.js +9 -0
- package/dist/src/hpkeCiphertext.js.map +1 -0
- package/dist/src/index.d.ts +32 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +68 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/keyPackage.d.ts +38 -0
- package/dist/src/keyPackage.d.ts.map +1 -0
- package/dist/src/keyPackage.js +79 -0
- package/dist/src/keyPackage.js.map +1 -0
- package/dist/src/keyPackageEqualityConfig.d.ts +7 -0
- package/dist/src/keyPackageEqualityConfig.d.ts.map +1 -0
- package/dist/src/keyPackageEqualityConfig.js +13 -0
- package/dist/src/keyPackageEqualityConfig.js.map +1 -0
- package/dist/src/keyRetentionConfig.d.ts +6 -0
- package/dist/src/keyRetentionConfig.d.ts.map +1 -0
- package/dist/src/keyRetentionConfig.js +9 -0
- package/dist/src/keyRetentionConfig.js.map +1 -0
- package/dist/src/keySchedule.d.ts +24 -0
- package/dist/src/keySchedule.d.ts.map +1 -0
- package/dist/src/keySchedule.js +49 -0
- package/dist/src/keySchedule.js.map +1 -0
- package/dist/src/leafNode.d.ts +78 -0
- package/dist/src/leafNode.d.ts.map +1 -0
- package/dist/src/leafNode.js +96 -0
- package/dist/src/leafNode.js.map +1 -0
- package/dist/src/leafNodeSource.d.ts +12 -0
- package/dist/src/leafNodeSource.d.ts.map +1 -0
- package/dist/src/leafNodeSource.js +15 -0
- package/dist/src/leafNodeSource.js.map +1 -0
- package/dist/src/lifetime.d.ts +9 -0
- package/dist/src/lifetime.d.ts.map +1 -0
- package/dist/src/lifetime.js +16 -0
- package/dist/src/lifetime.js.map +1 -0
- package/dist/src/lifetimeConfig.d.ts +5 -0
- package/dist/src/lifetimeConfig.d.ts.map +1 -0
- package/dist/src/lifetimeConfig.js +8 -0
- package/dist/src/lifetimeConfig.js.map +1 -0
- package/dist/src/message.d.ts +42 -0
- package/dist/src/message.d.ts.map +1 -0
- package/dist/src/message.js +49 -0
- package/dist/src/message.js.map +1 -0
- package/dist/src/messageProtection.d.ts +36 -0
- package/dist/src/messageProtection.d.ts.map +1 -0
- package/dist/src/messageProtection.js +135 -0
- package/dist/src/messageProtection.js.map +1 -0
- package/dist/src/messageProtectionPublic.d.ts +17 -0
- package/dist/src/messageProtectionPublic.d.ts.map +1 -0
- package/dist/src/messageProtectionPublic.js +105 -0
- package/dist/src/messageProtectionPublic.js.map +1 -0
- package/dist/src/mlsError.d.ts +24 -0
- package/dist/src/mlsError.d.ts.map +1 -0
- package/dist/src/mlsError.js +60 -0
- package/dist/src/mlsError.js.map +1 -0
- package/dist/src/nodeType.d.ts +11 -0
- package/dist/src/nodeType.d.ts.map +1 -0
- package/dist/src/nodeType.js +14 -0
- package/dist/src/nodeType.js.map +1 -0
- package/dist/src/paddingConfig.d.ts.map +1 -0
- package/dist/src/parentHash.d.ts +16 -0
- package/dist/src/parentHash.d.ts.map +1 -0
- package/dist/src/parentHash.js +108 -0
- package/dist/src/parentHash.js.map +1 -0
- package/dist/src/parentNode.d.ts +9 -0
- package/dist/src/parentNode.d.ts.map +1 -0
- package/dist/src/parentNode.js +14 -0
- package/dist/src/parentNode.js.map +1 -0
- package/dist/src/pathSecrets.d.ts +10 -0
- package/dist/src/pathSecrets.d.ts.map +1 -0
- package/dist/src/pathSecrets.js +36 -0
- package/dist/src/pathSecrets.js.map +1 -0
- package/dist/src/presharedkey.d.ts +51 -0
- package/dist/src/presharedkey.d.ts.map +1 -0
- package/dist/src/presharedkey.js +65 -0
- package/dist/src/presharedkey.js.map +1 -0
- package/dist/src/privateKeyPath.d.ts +12 -0
- package/dist/src/privateKeyPath.d.ts.map +1 -0
- package/dist/src/privateKeyPath.js +26 -0
- package/dist/src/privateKeyPath.js.map +1 -0
- package/dist/src/privateMessage.d.ts +41 -0
- package/dist/src/privateMessage.d.ts.map +1 -0
- package/dist/src/privateMessage.js +122 -0
- package/dist/src/privateMessage.js.map +1 -0
- package/dist/src/processMessages.d.ts +26 -0
- package/dist/src/processMessages.d.ts.map +1 -0
- package/dist/src/processMessages.js +201 -0
- package/dist/src/processMessages.js.map +1 -0
- package/dist/src/proposal.d.ts +97 -0
- package/dist/src/proposal.d.ts.map +1 -0
- package/dist/src/proposal.js +96 -0
- package/dist/src/proposal.js.map +1 -0
- package/dist/src/proposalOrRefType.d.ts +25 -0
- package/dist/src/proposalOrRefType.d.ts.map +1 -0
- package/dist/src/proposalOrRefType.js +35 -0
- package/dist/src/proposalOrRefType.js.map +1 -0
- package/dist/src/proposalType.d.ts +15 -0
- package/dist/src/proposalType.js +19 -0
- package/dist/src/proposalType.js.map +1 -0
- package/dist/src/protectMessages.d.ts +20 -0
- package/dist/src/protectMessages.js +116 -0
- package/dist/src/protectMessages.js.map +1 -0
- package/dist/src/protocolVersion.d.ts +9 -0
- package/dist/src/protocolVersion.d.ts.map +1 -0
- package/dist/src/protocolVersion.js +13 -0
- package/dist/src/protocolVersion.js.map +1 -0
- package/dist/src/pskIndex.d.ts +7 -0
- package/dist/src/pskIndex.d.ts.map +1 -0
- package/dist/src/pskIndex.js +22 -0
- package/dist/src/pskIndex.js.map +1 -0
- package/dist/src/publicMessage.d.ts +29 -0
- package/dist/src/publicMessage.d.ts.map +1 -0
- package/dist/src/publicMessage.js +78 -0
- package/dist/src/publicMessage.js.map +1 -0
- package/dist/src/ratchetTree.d.ts +46 -0
- package/dist/src/ratchetTree.d.ts.map +1 -0
- package/dist/src/ratchetTree.js +276 -0
- package/dist/src/ratchetTree.js.map +1 -0
- package/dist/src/requiredCapabilites.d.ts +12 -0
- package/dist/src/requiredCapabilites.js +12 -0
- package/dist/src/requiredCapabilites.js.map +1 -0
- package/dist/src/requiredCapabilities.d.ts +10 -0
- package/dist/src/requiredCapabilities.d.ts.map +1 -0
- package/dist/src/requiredCapabilities.js +11 -0
- package/dist/src/requiredCapabilities.js.map +1 -0
- package/dist/src/resumption.d.ts +18 -0
- package/dist/src/resumption.d.ts.map +1 -0
- package/dist/src/resumption.js +82 -0
- package/dist/src/resumption.js.map +1 -0
- package/dist/src/secretTree.d.ts +29 -0
- package/dist/src/secretTree.d.ts.map +1 -0
- package/dist/src/secretTree.js +146 -0
- package/dist/src/secretTree.js.map +1 -0
- package/dist/src/sender.d.ts +56 -0
- package/dist/src/sender.d.ts.map +1 -0
- package/dist/src/sender.js +91 -0
- package/dist/src/sender.js.map +1 -0
- package/dist/src/transcriptHash.d.ts +14 -0
- package/dist/src/transcriptHash.d.ts.map +1 -0
- package/dist/src/transcriptHash.js +28 -0
- package/dist/src/transcriptHash.js.map +1 -0
- package/dist/src/treeHash.d.ts +27 -0
- package/dist/src/treeHash.d.ts.map +1 -0
- package/dist/src/treeHash.js +76 -0
- package/dist/src/treeHash.js.map +1 -0
- package/dist/src/treemath.d.ts +14 -0
- package/dist/src/treemath.d.ts.map +1 -0
- package/dist/src/treemath.js +103 -0
- package/dist/src/treemath.js.map +1 -0
- package/dist/src/unappliedProposals.d.ts +7 -0
- package/dist/src/unappliedProposals.d.ts.map +1 -0
- package/dist/src/unappliedProposals.js +12 -0
- package/dist/src/unappliedProposals.js.map +1 -0
- package/dist/src/updatePath.d.ts +34 -0
- package/dist/src/updatePath.d.ts.map +1 -0
- package/dist/src/updatePath.js +170 -0
- package/dist/src/updatePath.js.map +1 -0
- package/dist/src/util/addToMap.d.ts +1 -0
- package/dist/src/util/addToMap.d.ts.map +1 -0
- package/dist/src/util/addToMap.js +9 -0
- package/dist/src/util/addToMap.js.map +1 -0
- package/dist/src/util/array.d.ts +2 -0
- package/dist/src/util/array.d.ts.map +1 -0
- package/dist/src/util/array.js +13 -0
- package/dist/src/util/array.js.map +1 -0
- package/dist/src/util/byteArray.d.ts +3 -0
- package/dist/src/util/byteArray.d.ts.map +1 -0
- package/dist/src/util/byteArray.js +32 -0
- package/dist/src/util/byteArray.js.map +1 -0
- package/dist/src/util/constantTimeCompare.d.ts +1 -0
- package/dist/src/util/constantTimeCompare.d.ts.map +1 -0
- package/dist/src/util/constantTimeCompare.js +13 -0
- package/dist/src/util/constantTimeCompare.js.map +1 -0
- package/dist/src/util/enumHelpers.d.ts +4 -0
- package/dist/src/util/enumHelpers.d.ts.map +1 -0
- package/dist/src/util/enumHelpers.js +34 -0
- package/dist/src/util/enumHelpers.js.map +1 -0
- package/dist/src/util/repeat.d.ts +1 -0
- package/dist/src/util/repeat.d.ts.map +1 -0
- package/dist/src/util/repeat.js +11 -0
- package/dist/src/util/repeat.js.map +1 -0
- package/dist/src/welcome.d.ts +29 -0
- package/dist/src/welcome.d.ts.map +1 -0
- package/dist/src/welcome.js +55 -0
- package/dist/src/welcome.js.map +1 -0
- package/dist/src/wireformat.d.ts +13 -0
- package/dist/src/wireformat.d.ts.map +1 -0
- package/dist/src/wireformat.js +18 -0
- package/dist/src/wireformat.js.map +1 -0
- package/dist/test/base64.test.d.ts +1 -0
- package/dist/test/base64.test.d.ts.map +1 -0
- package/dist/test/base64.test.js +69 -0
- package/dist/test/base64.test.js.map +1 -0
- package/dist/test/codec/authenticatedContent.test.d.ts +1 -0
- package/dist/test/codec/authenticatedContent.test.d.ts.map +1 -0
- package/dist/test/codec/authenticatedContent.test.js +40 -0
- package/dist/test/codec/authenticatedContent.test.js.map +1 -0
- package/dist/test/codec/capabilities.test.d.ts +1 -0
- package/dist/test/codec/capabilities.test.d.ts.map +1 -0
- package/dist/test/codec/capabilities.test.js +28 -0
- package/dist/test/codec/capabilities.test.js.map +1 -0
- package/dist/test/codec/commit.test.d.ts +1 -0
- package/dist/test/codec/commit.test.d.ts.map +1 -0
- package/dist/test/codec/commit.test.js +17 -0
- package/dist/test/codec/commit.test.js.map +1 -0
- package/dist/test/codec/composite.test.d.ts +1 -0
- package/dist/test/codec/composite.test.d.ts.map +1 -0
- package/dist/test/codec/composite.test.js +63 -0
- package/dist/test/codec/composite.test.js.map +1 -0
- package/dist/test/codec/contentType.test.d.ts +1 -0
- package/dist/test/codec/contentType.test.d.ts.map +1 -0
- package/dist/test/codec/contentType.test.js +14 -0
- package/dist/test/codec/contentType.test.js.map +1 -0
- package/dist/test/codec/credential.test.d.ts +1 -0
- package/dist/test/codec/credential.test.d.ts.map +1 -0
- package/dist/test/codec/credential.test.js +19 -0
- package/dist/test/codec/credential.test.js.map +1 -0
- package/dist/test/codec/credentialType.test.d.ts +1 -0
- package/dist/test/codec/credentialType.test.d.ts.map +1 -0
- package/dist/test/codec/credentialType.test.js +14 -0
- package/dist/test/codec/credentialType.test.js.map +1 -0
- package/dist/test/codec/encryptedGroupSecrets.test.d.ts +1 -0
- package/dist/test/codec/encryptedGroupSecrets.test.d.ts.map +1 -0
- package/dist/test/codec/encryptedGroupSecrets.test.js +20 -0
- package/dist/test/codec/encryptedGroupSecrets.test.js.map +1 -0
- package/dist/test/codec/extension.test.d.ts +1 -0
- package/dist/test/codec/extension.test.d.ts.map +1 -0
- package/dist/test/codec/extension.test.js +22 -0
- package/dist/test/codec/extension.test.js.map +1 -0
- package/dist/test/codec/extensionType.test.d.ts +1 -0
- package/dist/test/codec/extensionType.test.d.ts.map +1 -0
- package/dist/test/codec/extensionType.test.js +14 -0
- package/dist/test/codec/extensionType.test.js.map +1 -0
- package/dist/test/codec/externalSender.test.d.ts +1 -0
- package/dist/test/codec/externalSender.test.d.ts.map +1 -0
- package/dist/test/codec/externalSender.test.js +22 -0
- package/dist/test/codec/externalSender.test.js.map +1 -0
- package/dist/test/codec/framedContent.test.d.ts +1 -0
- package/dist/test/codec/framedContent.test.d.ts.map +1 -0
- package/dist/test/codec/framedContent.test.js +28 -0
- package/dist/test/codec/framedContent.test.js.map +1 -0
- package/dist/test/codec/groupContext.test.d.ts +1 -0
- package/dist/test/codec/groupContext.test.d.ts.map +1 -0
- package/dist/test/codec/groupContext.test.js +32 -0
- package/dist/test/codec/groupContext.test.js.map +1 -0
- package/dist/test/codec/groupInfo.test.d.ts +1 -0
- package/dist/test/codec/groupInfo.test.d.ts.map +1 -0
- package/dist/test/codec/groupInfo.test.js +47 -0
- package/dist/test/codec/groupInfo.test.js.map +1 -0
- package/dist/test/codec/groupSecrets.test.d.ts +1 -0
- package/dist/test/codec/groupSecrets.test.d.ts.map +1 -0
- package/dist/test/codec/groupSecrets.test.js +18 -0
- package/dist/test/codec/groupSecrets.test.js.map +1 -0
- package/dist/test/codec/hpkeCiphertext.test.d.ts +1 -0
- package/dist/test/codec/hpkeCiphertext.test.d.ts.map +1 -0
- package/dist/test/codec/hpkeCiphertext.test.js +15 -0
- package/dist/test/codec/hpkeCiphertext.test.js.map +1 -0
- package/dist/test/codec/keyPackage.test.d.ts +1 -0
- package/dist/test/codec/keyPackage.test.d.ts.map +1 -0
- package/dist/test/codec/keyPackage.test.js +60 -0
- package/dist/test/codec/keyPackage.test.js.map +1 -0
- package/dist/test/codec/keyPackageTBS.test.d.ts +1 -0
- package/dist/test/codec/keyPackageTBS.test.d.ts.map +1 -0
- package/dist/test/codec/keyPackageTBS.test.js +61 -0
- package/dist/test/codec/keyPackageTBS.test.js.map +1 -0
- package/dist/test/codec/leafNode.test.d.ts +1 -0
- package/dist/test/codec/leafNode.test.d.ts.map +1 -0
- package/dist/test/codec/leafNode.test.js +45 -0
- package/dist/test/codec/leafNode.test.js.map +1 -0
- package/dist/test/codec/leafNodeData.test.d.ts +1 -0
- package/dist/test/codec/leafNodeData.test.d.ts.map +1 -0
- package/dist/test/codec/leafNodeData.test.js +38 -0
- package/dist/test/codec/leafNodeData.test.js.map +1 -0
- package/dist/test/codec/leafNodeSource.test.d.ts +1 -0
- package/dist/test/codec/leafNodeSource.test.d.ts.map +1 -0
- package/dist/test/codec/leafNodeSource.test.js +17 -0
- package/dist/test/codec/leafNodeSource.test.js.map +1 -0
- package/dist/test/codec/lifetime.test.d.ts +1 -0
- package/dist/test/codec/lifetime.test.d.ts.map +1 -0
- package/dist/test/codec/lifetime.test.js +14 -0
- package/dist/test/codec/lifetime.test.js.map +1 -0
- package/dist/test/codec/message.test.d.ts +1 -0
- package/dist/test/codec/message.test.d.ts.map +1 -0
- package/dist/test/codec/message.test.js +102 -0
- package/dist/test/codec/message.test.js.map +1 -0
- package/dist/test/codec/nodeType.test.d.ts +1 -0
- package/dist/test/codec/nodeType.test.d.ts.map +1 -0
- package/dist/test/codec/nodeType.test.js +14 -0
- package/dist/test/codec/nodeType.test.js.map +1 -0
- package/dist/test/codec/number.test.d.ts +1 -0
- package/dist/test/codec/number.test.d.ts.map +1 -0
- package/dist/test/codec/number.test.js +76 -0
- package/dist/test/codec/number.test.js.map +1 -0
- package/dist/test/codec/optional.test.d.ts +1 -0
- package/dist/test/codec/optional.test.d.ts.map +1 -0
- package/dist/test/codec/optional.test.js +44 -0
- package/dist/test/codec/optional.test.js.map +1 -0
- package/dist/test/codec/padding.test.d.ts +1 -0
- package/dist/test/codec/padding.test.d.ts.map +1 -0
- package/dist/test/codec/padding.test.js +42 -0
- package/dist/test/codec/padding.test.js.map +1 -0
- package/dist/test/codec/parentHash.test.d.ts +1 -0
- package/dist/test/codec/parentHash.test.d.ts.map +1 -0
- package/dist/test/codec/parentHash.test.js +15 -0
- package/dist/test/codec/parentHash.test.js.map +1 -0
- package/dist/test/codec/parentNode.test.d.ts +1 -0
- package/dist/test/codec/parentNode.test.d.ts.map +1 -0
- package/dist/test/codec/parentNode.test.js +24 -0
- package/dist/test/codec/parentNode.test.js.map +1 -0
- package/dist/test/codec/presharedkey.test.d.ts +1 -0
- package/dist/test/codec/presharedkey.test.d.ts.map +1 -0
- package/dist/test/codec/presharedkey.test.js +37 -0
- package/dist/test/codec/presharedkey.test.js.map +1 -0
- package/dist/test/codec/privateContentAAD.test.d.ts +1 -0
- package/dist/test/codec/privateContentAAD.test.d.ts.map +1 -0
- package/dist/test/codec/privateContentAAD.test.js +32 -0
- package/dist/test/codec/privateContentAAD.test.js.map +1 -0
- package/dist/test/codec/privateMessage.test.d.ts +1 -0
- package/dist/test/codec/privateMessage.test.d.ts.map +1 -0
- package/dist/test/codec/privateMessage.test.js +38 -0
- package/dist/test/codec/privateMessage.test.js.map +1 -0
- package/dist/test/codec/proposal.test.d.ts +1 -0
- package/dist/test/codec/proposal.test.d.ts.map +1 -0
- package/dist/test/codec/proposal.test.js +46 -0
- package/dist/test/codec/proposal.test.js.map +1 -0
- package/dist/test/codec/proposalOrRef.test.d.ts +1 -0
- package/dist/test/codec/proposalOrRef.test.d.ts.map +1 -0
- package/dist/test/codec/proposalOrRef.test.js +14 -0
- package/dist/test/codec/proposalOrRef.test.js.map +1 -0
- package/dist/test/codec/proposalOrRefType.test.d.ts +1 -0
- package/dist/test/codec/proposalOrRefType.test.d.ts.map +1 -0
- package/dist/test/codec/proposalOrRefType.test.js +14 -0
- package/dist/test/codec/proposalOrRefType.test.js.map +1 -0
- package/dist/test/codec/proposalType.test.d.ts +1 -0
- package/dist/test/codec/proposalType.test.d.ts.map +1 -0
- package/dist/test/codec/proposalType.test.js +14 -0
- package/dist/test/codec/proposalType.test.js.map +1 -0
- package/dist/test/codec/protocolVersion.test.d.ts +1 -0
- package/dist/test/codec/protocolVersion.test.d.ts.map +1 -0
- package/dist/test/codec/protocolVersion.test.js +11 -0
- package/dist/test/codec/protocolVersion.test.js.map +1 -0
- package/dist/test/codec/pskId.test.d.ts +1 -0
- package/dist/test/codec/pskId.test.d.ts.map +1 -0
- package/dist/test/codec/pskId.test.js +20 -0
- package/dist/test/codec/pskId.test.js.map +1 -0
- package/dist/test/codec/pskInfo.test.d.ts +1 -0
- package/dist/test/codec/pskInfo.test.d.ts.map +1 -0
- package/dist/test/codec/pskInfo.test.js +14 -0
- package/dist/test/codec/pskInfo.test.js.map +1 -0
- package/dist/test/codec/pskLabel.test.d.ts +1 -0
- package/dist/test/codec/pskLabel.test.d.ts.map +1 -0
- package/dist/test/codec/pskLabel.test.js +28 -0
- package/dist/test/codec/pskLabel.test.js.map +1 -0
- package/dist/test/codec/pskType.test.d.ts +1 -0
- package/dist/test/codec/pskType.test.d.ts.map +1 -0
- package/dist/test/codec/pskType.test.js +14 -0
- package/dist/test/codec/pskType.test.js.map +1 -0
- package/dist/test/codec/publicMessage.test.d.ts +1 -0
- package/dist/test/codec/publicMessage.test.d.ts.map +1 -0
- package/dist/test/codec/publicMessage.test.js +41 -0
- package/dist/test/codec/publicMessage.test.js.map +1 -0
- package/dist/test/codec/ratchetTree.test.d.ts +1 -0
- package/dist/test/codec/ratchetTree.test.d.ts.map +1 -0
- package/dist/test/codec/ratchetTree.test.js +85 -0
- package/dist/test/codec/ratchetTree.test.js.map +1 -0
- package/dist/test/codec/requiredCapabilities.test.d.ts +1 -0
- package/dist/test/codec/requiredCapabilities.test.d.ts.map +1 -0
- package/dist/test/codec/requiredCapabilities.test.js +32 -0
- package/dist/test/codec/requiredCapabilities.test.js.map +1 -0
- package/dist/test/codec/resumptionPSKUsage.test.d.ts +1 -0
- package/dist/test/codec/resumptionPSKUsage.test.d.ts.map +1 -0
- package/dist/test/codec/resumptionPSKUsage.test.js +17 -0
- package/dist/test/codec/resumptionPSKUsage.test.js.map +1 -0
- package/dist/test/codec/reuseGuard.test.d.ts +1 -0
- package/dist/test/codec/reuseGuard.test.d.ts.map +1 -0
- package/dist/test/codec/reuseGuard.test.js +11 -0
- package/dist/test/codec/reuseGuard.test.js.map +1 -0
- package/dist/test/codec/roundtrip.d.ts +3 -0
- package/dist/test/codec/roundtrip.d.ts.map +1 -0
- package/dist/test/codec/roundtrip.js +11 -0
- package/dist/test/codec/roundtrip.js.map +1 -0
- package/dist/test/codec/sender.test.d.ts +1 -0
- package/dist/test/codec/sender.test.d.ts.map +1 -0
- package/dist/test/codec/sender.test.js +20 -0
- package/dist/test/codec/sender.test.js.map +1 -0
- package/dist/test/codec/senderData.test.d.ts +1 -0
- package/dist/test/codec/senderData.test.d.ts.map +1 -0
- package/dist/test/codec/senderData.test.js +14 -0
- package/dist/test/codec/senderData.test.js.map +1 -0
- package/dist/test/codec/senderDataAAD.test.d.ts +1 -0
- package/dist/test/codec/senderDataAAD.test.d.ts.map +1 -0
- package/dist/test/codec/senderDataAAD.test.js +14 -0
- package/dist/test/codec/senderDataAAD.test.js.map +1 -0
- package/dist/test/codec/senderType.test.d.ts +1 -0
- package/dist/test/codec/senderType.test.d.ts.map +1 -0
- package/dist/test/codec/senderType.test.js +20 -0
- package/dist/test/codec/senderType.test.js.map +1 -0
- package/dist/test/codec/transcriptHash.test.d.ts +1 -0
- package/dist/test/codec/transcriptHash.test.d.ts.map +1 -0
- package/dist/test/codec/transcriptHash.test.js +40 -0
- package/dist/test/codec/transcriptHash.test.js.map +1 -0
- package/dist/test/codec/treeHash.test.d.ts +1 -0
- package/dist/test/codec/treeHash.test.d.ts.map +1 -0
- package/dist/test/codec/treeHash.test.js +19 -0
- package/dist/test/codec/treeHash.test.js.map +1 -0
- package/dist/test/codec/updatePath.test.d.ts +1 -0
- package/dist/test/codec/updatePath.test.d.ts.map +1 -0
- package/dist/test/codec/updatePath.test.js +83 -0
- package/dist/test/codec/updatePath.test.js.map +1 -0
- package/dist/test/codec/updatePathNode.test.d.ts +1 -0
- package/dist/test/codec/updatePathNode.test.d.ts.map +1 -0
- package/dist/test/codec/updatePathNode.test.js +25 -0
- package/dist/test/codec/updatePathNode.test.js.map +1 -0
- package/dist/test/codec/varLengthEncoding.test.d.ts +1 -0
- package/dist/test/codec/varLengthEncoding.test.d.ts.map +1 -0
- package/dist/test/codec/varLengthEncoding.test.js +92 -0
- package/dist/test/codec/varLengthEncoding.test.js.map +1 -0
- package/dist/test/codec/welcome.test.d.ts +1 -0
- package/dist/test/codec/welcome.test.d.ts.map +1 -0
- package/dist/test/codec/welcome.test.js +27 -0
- package/dist/test/codec/welcome.test.js.map +1 -0
- package/dist/test/codec/wireformat.test.d.ts +1 -0
- package/dist/test/codec/wireformat.test.d.ts.map +1 -0
- package/dist/test/codec/wireformat.test.js +23 -0
- package/dist/test/codec/wireformat.test.js.map +1 -0
- package/dist/test/crypto/aead.test.d.ts +1 -0
- package/dist/test/crypto/aead.test.d.ts.map +1 -0
- package/dist/test/crypto/aead.test.js +46 -0
- package/dist/test/crypto/aead.test.js.map +1 -0
- package/dist/test/crypto/hpke.test.d.ts +1 -0
- package/dist/test/crypto/hpke.test.d.ts.map +1 -0
- package/dist/test/crypto/hpke.test.js +60 -0
- package/dist/test/crypto/hpke.test.js.map +1 -0
- package/dist/test/crypto/keyMatch.d.ts +7 -0
- package/dist/test/crypto/keyMatch.d.ts.map +1 -0
- package/dist/test/crypto/keyMatch.js +27 -0
- package/dist/test/crypto/keyMatch.js.map +1 -0
- package/dist/test/extensionsEqual.test.d.ts +1 -0
- package/dist/test/extensionsEqual.test.d.ts.map +1 -0
- package/dist/test/extensionsEqual.test.js +53 -0
- package/dist/test/extensionsEqual.test.js.map +1 -0
- package/dist/test/groupinfo.test.d.ts +1 -0
- package/dist/test/groupinfo.test.d.ts.map +1 -0
- package/dist/test/groupinfo.test.js +42 -0
- package/dist/test/groupinfo.test.js.map +1 -0
- package/dist/test/scenario/common.d.ts +8 -0
- package/dist/test/scenario/common.d.ts.map +1 -0
- package/dist/test/scenario/common.js +47 -0
- package/dist/test/scenario/common.js.map +1 -0
- package/dist/test/scenario/customCredentials.test.d.ts +1 -0
- package/dist/test/scenario/customCredentials.test.js +3 -0
- package/dist/test/scenario/customCredentials.test.js.map +1 -0
- package/dist/test/scenario/customExtensions.test.d.ts +1 -0
- package/dist/test/scenario/customExtensions.test.d.ts.map +1 -0
- package/dist/test/scenario/customExtensions.test.js +58 -0
- package/dist/test/scenario/customExtensions.test.js.map +1 -0
- package/dist/test/scenario/customProposal.test.d.ts +1 -0
- package/dist/test/scenario/customProposal.test.d.ts.map +1 -0
- package/dist/test/scenario/customProposal.test.js +73 -0
- package/dist/test/scenario/customProposal.test.js.map +1 -0
- package/dist/test/scenario/epochOutOfOrder.test.d.ts +1 -0
- package/dist/test/scenario/epochOutOfOrder.test.d.ts.map +1 -0
- package/dist/test/scenario/epochOutOfOrder.test.js +164 -0
- package/dist/test/scenario/epochOutOfOrder.test.js.map +1 -0
- package/dist/test/scenario/externalAddProposal.test.d.ts +1 -0
- package/dist/test/scenario/externalAddProposal.test.d.ts.map +1 -0
- package/dist/test/scenario/externalAddProposal.test.js +71 -0
- package/dist/test/scenario/externalAddProposal.test.js.map +1 -0
- package/dist/test/scenario/externalJoin.test.d.ts +1 -0
- package/dist/test/scenario/externalJoin.test.d.ts.map +1 -0
- package/dist/test/scenario/externalJoin.test.js +53 -0
- package/dist/test/scenario/externalJoin.test.js.map +1 -0
- package/dist/test/scenario/externalJoinResync.test.d.ts +1 -0
- package/dist/test/scenario/externalJoinResync.test.d.ts.map +1 -0
- package/dist/test/scenario/externalJoinResync.test.js +61 -0
- package/dist/test/scenario/externalJoinResync.test.js.map +1 -0
- package/dist/test/scenario/externalProposal.test.d.ts +1 -0
- package/dist/test/scenario/externalProposal.test.d.ts.map +1 -0
- package/dist/test/scenario/externalProposal.test.js +71 -0
- package/dist/test/scenario/externalProposal.test.js.map +1 -0
- package/dist/test/scenario/externalPsk.test.d.ts +1 -0
- package/dist/test/scenario/externalPsk.test.d.ts.map +1 -0
- package/dist/test/scenario/externalPsk.test.js +75 -0
- package/dist/test/scenario/externalPsk.test.js.map +1 -0
- package/dist/test/scenario/externalPskJoin.test.d.ts +1 -0
- package/dist/test/scenario/externalPskJoin.test.d.ts.map +1 -0
- package/dist/test/scenario/externalPskJoin.test.js +53 -0
- package/dist/test/scenario/externalPskJoin.test.js.map +1 -0
- package/dist/test/scenario/generationOutOfOrder.test.d.ts +1 -0
- package/dist/test/scenario/generationOutOfOrder.test.d.ts.map +1 -0
- package/dist/test/scenario/generationOutOfOrder.test.js +113 -0
- package/dist/test/scenario/generationOutOfOrder.test.js.map +1 -0
- package/dist/test/scenario/grease.test.d.ts +1 -0
- package/dist/test/scenario/grease.test.d.ts.map +1 -0
- package/dist/test/scenario/grease.test.js +46 -0
- package/dist/test/scenario/grease.test.js.map +1 -0
- package/dist/test/scenario/largeGroupFullLifecycle.test.d.ts +1 -0
- package/dist/test/scenario/largeGroupFullLifecycle.test.d.ts.map +1 -0
- package/dist/test/scenario/largeGroupFullLifecycle.test.js +129 -0
- package/dist/test/scenario/largeGroupFullLifecycle.test.js.map +1 -0
- package/dist/test/scenario/leaveProposal.test.d.ts +1 -0
- package/dist/test/scenario/leaveProposal.test.d.ts.map +1 -0
- package/dist/test/scenario/leaveProposal.test.js +79 -0
- package/dist/test/scenario/leaveProposal.test.js.map +1 -0
- package/dist/test/scenario/multipleJoinsAtOnce.test.d.ts +1 -0
- package/dist/test/scenario/multipleJoinsAtOnce.test.d.ts.map +1 -0
- package/dist/test/scenario/multipleJoinsAtOnce.test.js +50 -0
- package/dist/test/scenario/multipleJoinsAtOnce.test.js.map +1 -0
- package/dist/test/scenario/oneToOneJoin.test.d.ts +1 -0
- package/dist/test/scenario/oneToOneJoin.test.d.ts.map +1 -0
- package/dist/test/scenario/oneToOneJoin.test.js +100 -0
- package/dist/test/scenario/oneToOneJoin.test.js.map +1 -0
- package/dist/test/scenario/processMessage.d.ts +1 -0
- package/dist/test/scenario/processMessage.js +3 -0
- package/dist/test/scenario/processMessage.js.map +1 -0
- package/dist/test/scenario/ratchetTreeExtension.test.d.ts +1 -0
- package/dist/test/scenario/ratchetTreeExtension.test.d.ts.map +1 -0
- package/dist/test/scenario/ratchetTreeExtension.test.js +50 -0
- package/dist/test/scenario/ratchetTreeExtension.test.js.map +1 -0
- package/dist/test/scenario/reinit.test.d.ts +1 -0
- package/dist/test/scenario/reinit.test.d.ts.map +1 -0
- package/dist/test/scenario/reinit.test.js +59 -0
- package/dist/test/scenario/reinit.test.js.map +1 -0
- package/dist/test/scenario/rejectIncomingMessage.test.d.ts +1 -0
- package/dist/test/scenario/rejectIncomingMessage.test.d.ts.map +1 -0
- package/dist/test/scenario/rejectIncomingMessage.test.js +69 -0
- package/dist/test/scenario/rejectIncomingMessage.test.js.map +1 -0
- package/dist/test/scenario/remove.test.d.ts +1 -0
- package/dist/test/scenario/remove.test.d.ts.map +1 -0
- package/dist/test/scenario/remove.test.js +70 -0
- package/dist/test/scenario/remove.test.js.map +1 -0
- package/dist/test/scenario/requiredCapabilites.test.d.ts +1 -0
- package/dist/test/scenario/requiredCapabilites.test.d.ts.map +1 -0
- package/dist/test/scenario/requiredCapabilites.test.js +67 -0
- package/dist/test/scenario/requiredCapabilites.test.js.map +1 -0
- package/dist/test/scenario/resumption.test.d.ts +1 -0
- package/dist/test/scenario/resumption.test.d.ts.map +1 -0
- package/dist/test/scenario/resumption.test.js +45 -0
- package/dist/test/scenario/resumption.test.js.map +1 -0
- package/dist/test/scenario/threePartyJoin.test.d.ts +1 -0
- package/dist/test/scenario/threePartyJoin.test.d.ts.map +1 -0
- package/dist/test/scenario/threePartyJoin.test.js +58 -0
- package/dist/test/scenario/threePartyJoin.test.js.map +1 -0
- package/dist/test/scenario/update.test.d.ts +1 -0
- package/dist/test/scenario/update.test.d.ts.map +1 -0
- package/dist/test/scenario/update.test.js +52 -0
- package/dist/test/scenario/update.test.js.map +1 -0
- package/dist/test/test-vectors/cryptoBasics.test.d.ts +1 -0
- package/dist/test/test-vectors/cryptoBasics.test.d.ts.map +1 -0
- package/dist/test/test-vectors/cryptoBasics.test.js +65 -0
- package/dist/test/test-vectors/cryptoBasics.test.js.map +1 -0
- package/dist/test/test-vectors/deserialization.test.d.ts +1 -0
- package/dist/test/test-vectors/deserialization.test.d.ts.map +1 -0
- package/dist/test/test-vectors/deserialization.test.js +18 -0
- package/dist/test/test-vectors/deserialization.test.js.map +1 -0
- package/dist/test/test-vectors/keySchedule.test.d.ts +1 -0
- package/dist/test/test-vectors/keySchedule.test.d.ts.map +1 -0
- package/dist/test/test-vectors/keySchedule.test.js +53 -0
- package/dist/test/test-vectors/keySchedule.test.js.map +1 -0
- package/dist/test/test-vectors/messageProtection.test.d.ts +1 -0
- package/dist/test/test-vectors/messageProtection.test.d.ts.map +1 -0
- package/dist/test/test-vectors/messageProtection.test.js +220 -0
- package/dist/test/test-vectors/messageProtection.test.js.map +1 -0
- package/dist/test/test-vectors/messages.test.d.ts +1 -0
- package/dist/test/test-vectors/messages.test.d.ts.map +1 -0
- package/dist/test/test-vectors/messages.test.js +141 -0
- package/dist/test/test-vectors/messages.test.js.map +1 -0
- package/dist/test/test-vectors/passiveClientScenarios.test.d.ts +1 -0
- package/dist/test/test-vectors/passiveClientScenarios.test.d.ts.map +1 -0
- package/dist/test/test-vectors/passiveClientScenarios.test.js +91 -0
- package/dist/test/test-vectors/passiveClientScenarios.test.js.map +1 -0
- package/dist/test/test-vectors/pskSecret.test.d.ts +1 -0
- package/dist/test/test-vectors/pskSecret.test.d.ts.map +1 -0
- package/dist/test/test-vectors/pskSecret.test.js +23 -0
- package/dist/test/test-vectors/pskSecret.test.js.map +1 -0
- package/dist/test/test-vectors/secretTree.test.d.ts +1 -0
- package/dist/test/test-vectors/secretTree.test.d.ts.map +1 -0
- package/dist/test/test-vectors/secretTree.test.js +53 -0
- package/dist/test/test-vectors/secretTree.test.js.map +1 -0
- package/dist/test/test-vectors/transcriptHashes.test.d.ts +1 -0
- package/dist/test/test-vectors/transcriptHashes.test.d.ts.map +1 -0
- package/dist/test/test-vectors/transcriptHashes.test.js +31 -0
- package/dist/test/test-vectors/transcriptHashes.test.js.map +1 -0
- package/dist/test/test-vectors/treeOperations.test.d.ts +1 -0
- package/dist/test/test-vectors/treeOperations.test.d.ts.map +1 -0
- package/dist/test/test-vectors/treeOperations.test.js +50 -0
- package/dist/test/test-vectors/treeOperations.test.js.map +1 -0
- package/dist/test/test-vectors/treeValidation.test.d.ts +1 -0
- package/dist/test/test-vectors/treeValidation.test.d.ts.map +1 -0
- package/dist/test/test-vectors/treeValidation.test.js +41 -0
- package/dist/test/test-vectors/treeValidation.test.js.map +1 -0
- package/dist/test/test-vectors/treekem.test.d.ts +1 -0
- package/dist/test/test-vectors/treekem.test.d.ts.map +1 -0
- package/dist/test/test-vectors/treekem.test.js +105 -0
- package/dist/test/test-vectors/treekem.test.js.map +1 -0
- package/dist/test/test-vectors/treemath.test.d.ts +1 -0
- package/dist/test/test-vectors/treemath.test.d.ts.map +1 -0
- package/dist/test/test-vectors/treemath.test.js +60 -0
- package/dist/test/test-vectors/treemath.test.js.map +1 -0
- package/dist/test/test-vectors/welcome.test.d.ts +1 -0
- package/dist/test/test-vectors/welcome.test.d.ts.map +1 -0
- package/dist/test/test-vectors/welcome.test.js +45 -0
- package/dist/test/test-vectors/welcome.test.js.map +1 -0
- package/dist/test/validation/byteArrayValidation.test.d.ts +1 -0
- package/dist/test/validation/byteArrayValidation.test.js +76 -0
- package/dist/test/validation/byteArrayValidation.test.js.map +1 -0
- package/dist/test/validation/clientStateComprehensiveValidation.test.d.ts +1 -0
- package/dist/test/validation/clientStateComprehensiveValidation.test.js +280 -0
- package/dist/test/validation/clientStateComprehensiveValidation.test.js.map +1 -0
- package/dist/test/validation/clientStateExtendedValidation.test.d.ts +1 -0
- package/dist/test/validation/clientStateExtendedValidation.test.js +376 -0
- package/dist/test/validation/clientStateExtendedValidation.test.js.map +1 -0
- package/dist/test/validation/clientStateValidation.test.d.ts +1 -0
- package/dist/test/validation/clientStateValidation.test.js +190 -0
- package/dist/test/validation/clientStateValidation.test.js.map +1 -0
- package/dist/test/validation/errorHandlingValidation.test.d.ts +1 -0
- package/dist/test/validation/errorHandlingValidation.test.js +92 -0
- package/dist/test/validation/errorHandlingValidation.test.js.map +1 -0
- package/dist/test/validation/extensionValidation.test.d.ts +1 -0
- package/dist/test/validation/extensionValidation.test.js +120 -0
- package/dist/test/validation/extensionValidation.test.js.map +1 -0
- package/dist/test/validation/greaseValidation.test.d.ts +1 -0
- package/dist/test/validation/greaseValidation.test.js +136 -0
- package/dist/test/validation/greaseValidation.test.js.map +1 -0
- package/dist/test/validation/index.test.d.ts +5 -0
- package/dist/test/validation/index.test.js +19 -0
- package/dist/test/validation/index.test.js.map +1 -0
- package/dist/test/validation/mlsErrorValidation.test.d.ts +1 -0
- package/dist/test/validation/mlsErrorValidation.test.js +92 -0
- package/dist/test/validation/mlsErrorValidation.test.js.map +1 -0
- package/dist/test/validation/proposalValidation.test.d.ts +1 -0
- package/dist/test/validation/proposalValidation.test.d.ts.map +1 -0
- package/dist/test/validation/proposalValidation.test.js +233 -0
- package/dist/test/validation/proposalValidation.test.js.map +1 -0
- package/dist/test/validation/ratchetTreeValidation.test.d.ts +1 -0
- package/dist/test/validation/ratchetTreeValidation.test.d.ts.map +1 -0
- package/dist/test/validation/ratchetTreeValidation.test.js +53 -0
- package/dist/test/validation/ratchetTreeValidation.test.js.map +1 -0
- package/dist/test/validation/resumptionValidation.test.d.ts +1 -0
- package/dist/test/validation/resumptionValidation.test.d.ts.map +1 -0
- package/dist/test/validation/resumptionValidation.test.js +81 -0
- package/dist/test/validation/resumptionValidation.test.js.map +1 -0
- package/dist/test/validation/utilityValidation.test.d.ts +1 -0
- package/dist/test/validation/utilityValidation.test.js +71 -0
- package/dist/test/validation/utilityValidation.test.js.map +1 -0
- package/dist/test_vectors/crypto-basics.json +303 -0
- package/dist/test_vectors/deserialization.json +58 -0
- package/dist/test_vectors/key-schedule.json +926 -0
- package/dist/test_vectors/message-protection.json +142 -0
- package/dist/test_vectors/messages.json +5702 -0
- package/dist/test_vectors/passive-client-handling-commit.json +2683 -0
- package/dist/test_vectors/passive-client-random.json +2657 -0
- package/dist/test_vectors/passive-client-welcome.json +814 -0
- package/dist/test_vectors/psk_secret.json +2382 -0
- package/dist/test_vectors/secret-tree.json +4846 -0
- package/dist/test_vectors/transcript-hashes.json +58 -0
- package/dist/test_vectors/tree-math.json +8156 -0
- package/dist/test_vectors/tree-operations.json +47 -0
- package/dist/test_vectors/tree-validation.json +6204 -0
- package/dist/test_vectors/treekem.json +14859 -0
- package/dist/test_vectors/welcome.json +51 -0
- package/dist/ts-mls.d.ts +781 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/util/addToMap.d.ts +1 -0
- package/dist/util/addToMap.js +9 -0
- package/dist/util/addToMap.js.map +1 -0
- package/dist/util/array.d.ts +1 -0
- package/dist/util/array.js +7 -0
- package/dist/util/array.js.map +1 -0
- package/dist/util/byteArray.d.ts +3 -0
- package/dist/util/byteArray.js +32 -0
- package/dist/util/byteArray.js.map +1 -0
- package/dist/util/constantTimeCompare.d.ts +1 -0
- package/dist/util/constantTimeCompare.js +13 -0
- package/dist/util/constantTimeCompare.js.map +1 -0
- package/dist/util/enumHelpers.d.ts +4 -0
- package/dist/util/enumHelpers.js +34 -0
- package/dist/util/enumHelpers.js.map +1 -0
- package/dist/util/repeat.d.ts +1 -0
- package/dist/util/repeat.js +11 -0
- package/dist/util/repeat.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkCanSendApplicationMessages = checkCanSendApplicationMessages;
|
|
4
|
+
exports.checkCanSendHandshakeMessages = checkCanSendHandshakeMessages;
|
|
5
|
+
exports.validateRatchetTree = validateRatchetTree;
|
|
6
|
+
exports.validateLeafNodeUpdateOrCommit = validateLeafNodeUpdateOrCommit;
|
|
7
|
+
exports.throwIfDefined = throwIfDefined;
|
|
8
|
+
exports.applyProposals = applyProposals;
|
|
9
|
+
exports.makePskIndex = makePskIndex;
|
|
10
|
+
exports.nextEpochContext = nextEpochContext;
|
|
11
|
+
exports.joinGroup = joinGroup;
|
|
12
|
+
exports.createGroup = createGroup;
|
|
13
|
+
exports.exportSecret = exportSecret;
|
|
14
|
+
exports.processProposal = processProposal;
|
|
15
|
+
exports.addHistoricalReceiverData = addHistoricalReceiverData;
|
|
16
|
+
const authenticatedContent_1 = require("./authenticatedContent");
|
|
17
|
+
const extension_1 = require("./extension");
|
|
18
|
+
const framedContent_1 = require("./framedContent");
|
|
19
|
+
const groupInfo_1 = require("./groupInfo");
|
|
20
|
+
const keyPackage_1 = require("./keyPackage");
|
|
21
|
+
const keySchedule_1 = require("./keySchedule");
|
|
22
|
+
const presharedkey_1 = require("./presharedkey");
|
|
23
|
+
const ratchetTree_1 = require("./ratchetTree");
|
|
24
|
+
const secretTree_1 = require("./secretTree");
|
|
25
|
+
const transcriptHash_1 = require("./transcriptHash");
|
|
26
|
+
const treeHash_1 = require("./treeHash");
|
|
27
|
+
const treemath_1 = require("./treemath");
|
|
28
|
+
const updatePath_1 = require("./updatePath");
|
|
29
|
+
const byteArray_1 = require("./util/byteArray");
|
|
30
|
+
const constantTimeCompare_1 = require("./util/constantTimeCompare");
|
|
31
|
+
const welcome_1 = require("./welcome");
|
|
32
|
+
const pathSecrets_1 = require("./pathSecrets");
|
|
33
|
+
const privateKeyPath_1 = require("./privateKeyPath");
|
|
34
|
+
const unappliedProposals_1 = require("./unappliedProposals");
|
|
35
|
+
const pskIndex_1 = require("./pskIndex");
|
|
36
|
+
const sender_1 = require("./sender");
|
|
37
|
+
const addToMap_1 = require("./util/addToMap");
|
|
38
|
+
const mlsError_1 = require("./mlsError");
|
|
39
|
+
const leafNode_1 = require("./leafNode");
|
|
40
|
+
const protocolVersion_1 = require("./protocolVersion");
|
|
41
|
+
const requiredCapabilities_1 = require("./requiredCapabilities");
|
|
42
|
+
const parentHash_1 = require("./parentHash");
|
|
43
|
+
const clientConfig_1 = require("./clientConfig");
|
|
44
|
+
const externalSender_1 = require("./externalSender");
|
|
45
|
+
const array_1 = require("./util/array");
|
|
46
|
+
function checkCanSendApplicationMessages(state) {
|
|
47
|
+
if (Object.keys(state.unappliedProposals).length !== 0)
|
|
48
|
+
throw new mlsError_1.UsageError("Cannot send application message with unapplied proposals");
|
|
49
|
+
checkCanSendHandshakeMessages(state);
|
|
50
|
+
}
|
|
51
|
+
function checkCanSendHandshakeMessages(state) {
|
|
52
|
+
if (state.groupActiveState.kind === "suspendedPendingReinit")
|
|
53
|
+
throw new mlsError_1.UsageError("Cannot send messages while Group is suspended pending reinit");
|
|
54
|
+
else if (state.groupActiveState.kind === "removedFromGroup")
|
|
55
|
+
throw new mlsError_1.UsageError("Cannot send messages after being removed from group");
|
|
56
|
+
}
|
|
57
|
+
const emptyProposals = {
|
|
58
|
+
add: [],
|
|
59
|
+
update: [],
|
|
60
|
+
remove: [],
|
|
61
|
+
psk: [],
|
|
62
|
+
reinit: [],
|
|
63
|
+
external_init: [],
|
|
64
|
+
group_context_extensions: [],
|
|
65
|
+
};
|
|
66
|
+
function flattenExtensions(groupContextExtensions) {
|
|
67
|
+
return groupContextExtensions.reduce((acc, { proposal }) => {
|
|
68
|
+
return [...acc, ...proposal.groupContextExtensions.extensions];
|
|
69
|
+
}, []);
|
|
70
|
+
}
|
|
71
|
+
async function validateProposals(p, committerLeafIndex, groupContext, config, authService, tree) {
|
|
72
|
+
const containsUpdateByCommitter = p.update.some((o) => o.senderLeafIndex !== undefined && o.senderLeafIndex === committerLeafIndex);
|
|
73
|
+
if (containsUpdateByCommitter)
|
|
74
|
+
return new mlsError_1.ValidationError("Commit cannot contain an update proposal sent by committer");
|
|
75
|
+
const containsRemoveOfCommitter = p.remove.some((o) => o.proposal.remove.removed === committerLeafIndex);
|
|
76
|
+
if (containsRemoveOfCommitter)
|
|
77
|
+
return new mlsError_1.ValidationError("Commit cannot contain a remove proposal removing committer");
|
|
78
|
+
const multipleUpdateRemoveForSameLeaf = p.update.some(({ senderLeafIndex: a }, indexA) => p.update.some(({ senderLeafIndex: b }, indexB) => a === b && indexA !== indexB) ||
|
|
79
|
+
p.remove.some((r) => r.proposal.remove.removed === a)) ||
|
|
80
|
+
p.remove.some((a, indexA) => p.remove.some((b, indexB) => b.proposal.remove.removed === a.proposal.remove.removed && indexA !== indexB) ||
|
|
81
|
+
p.update.some(({ senderLeafIndex }) => a.proposal.remove.removed === senderLeafIndex));
|
|
82
|
+
if (multipleUpdateRemoveForSameLeaf)
|
|
83
|
+
return new mlsError_1.ValidationError("Commit cannot contain multiple update and/or remove proposals that apply to the same leaf");
|
|
84
|
+
const multipleAddsContainSameKeypackage = p.add.some(({ proposal: a }, indexA) => p.add.some(({ proposal: b }, indexB) => config.compareKeyPackages(a.add.keyPackage, b.add.keyPackage) && indexA !== indexB));
|
|
85
|
+
if (multipleAddsContainSameKeypackage)
|
|
86
|
+
return new mlsError_1.ValidationError("Commit cannot contain multiple Add proposals that contain KeyPackages that represent the same client");
|
|
87
|
+
// checks if there is an Add proposal with a KeyPackage that matches a client already in the group
|
|
88
|
+
// unless there is a Remove proposal in the list removing the matching client from the group.
|
|
89
|
+
const addsContainExistingKeypackage = p.add.some(({ proposal }) => tree.some((node, nodeIndex) => node !== undefined &&
|
|
90
|
+
node.nodeType === "leaf" &&
|
|
91
|
+
config.compareKeyPackageToLeafNode(proposal.add.keyPackage, node.leaf) &&
|
|
92
|
+
p.remove.every((r) => r.proposal.remove.removed !== (0, treemath_1.nodeToLeafIndex)(nodeIndex))));
|
|
93
|
+
if (addsContainExistingKeypackage)
|
|
94
|
+
return new mlsError_1.ValidationError("Commit cannot contain an Add proposal for someone already in the group");
|
|
95
|
+
const everyLeafSupportsGroupExtensions = p.add.every(({ proposal }) => (0, extension_1.extensionsSupportedByCapabilities)(groupContext.extensions, proposal.add.keyPackage.leafNode.capabilities));
|
|
96
|
+
if (!everyLeafSupportsGroupExtensions)
|
|
97
|
+
return new mlsError_1.ValidationError("Added leaf node that doesn't support extension in GroupContext");
|
|
98
|
+
const multiplePskWithSamePskId = p.psk.some((a, indexA) => p.psk.some((b, indexB) => (0, constantTimeCompare_1.constantTimeEqual)((0, presharedkey_1.encodePskId)(a.proposal.psk.preSharedKeyId), (0, presharedkey_1.encodePskId)(b.proposal.psk.preSharedKeyId)) &&
|
|
99
|
+
indexA !== indexB));
|
|
100
|
+
if (multiplePskWithSamePskId)
|
|
101
|
+
return new mlsError_1.ValidationError("Commit cannot contain PreSharedKey proposals that reference the same PreSharedKeyID");
|
|
102
|
+
const multipleGroupContextExtensions = p.group_context_extensions.length > 1;
|
|
103
|
+
if (multipleGroupContextExtensions)
|
|
104
|
+
return new mlsError_1.ValidationError("Commit cannot contain multiple GroupContextExtensions proposals");
|
|
105
|
+
const allExtensions = flattenExtensions(p.group_context_extensions);
|
|
106
|
+
const requiredCapabilities = allExtensions.find((e) => e.extensionType === "required_capabilities");
|
|
107
|
+
if (requiredCapabilities !== undefined) {
|
|
108
|
+
const caps = (0, requiredCapabilities_1.decodeRequiredCapabilities)(requiredCapabilities.extensionData, 0);
|
|
109
|
+
if (caps === undefined)
|
|
110
|
+
return new mlsError_1.CodecError("Could not decode required_capabilities");
|
|
111
|
+
const everyLeafSupportsCapabilities = tree
|
|
112
|
+
.filter((n) => n !== undefined && n.nodeType === "leaf")
|
|
113
|
+
.every((l) => capabiltiesAreSupported(caps[0], l.leaf.capabilities));
|
|
114
|
+
if (!everyLeafSupportsCapabilities)
|
|
115
|
+
return new mlsError_1.ValidationError("Not all members support required capabilities");
|
|
116
|
+
const allAdditionsSupportCapabilities = p.add.every((a) => capabiltiesAreSupported(caps[0], a.proposal.add.keyPackage.leafNode.capabilities));
|
|
117
|
+
if (!allAdditionsSupportCapabilities)
|
|
118
|
+
return new mlsError_1.ValidationError("Commit contains add proposals of member without required capabilities");
|
|
119
|
+
}
|
|
120
|
+
return await validateExternalSenders(allExtensions, authService);
|
|
121
|
+
}
|
|
122
|
+
async function validateExternalSenders(extensions, authService) {
|
|
123
|
+
const externalSenders = extensions.filter((e) => e.extensionType === "external_senders");
|
|
124
|
+
for (const externalSender of externalSenders) {
|
|
125
|
+
const decoded = (0, externalSender_1.decodeExternalSender)(externalSender.extensionData, 0);
|
|
126
|
+
if (decoded === undefined)
|
|
127
|
+
return new mlsError_1.CodecError("Could not decode external_senders");
|
|
128
|
+
const validCredential = await authService.validateCredential(decoded[0].credential, decoded[0].signaturePublicKey);
|
|
129
|
+
if (!validCredential)
|
|
130
|
+
return new mlsError_1.ValidationError("Could not validate external credential");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function capabiltiesAreSupported(caps, cs) {
|
|
134
|
+
return (caps.credentialTypes.every((c) => cs.credentials.includes(c)) &&
|
|
135
|
+
caps.extensionTypes.every((e) => cs.extensions.includes(e)) &&
|
|
136
|
+
caps.proposalTypes.every((p) => cs.proposals.includes(p)));
|
|
137
|
+
}
|
|
138
|
+
async function validateRatchetTree(tree, groupContext, config, authService, treeHash, cs) {
|
|
139
|
+
const treeIsStructurallySound = tree.every((n, index) => (0, treemath_1.isLeaf)(index) ? n === undefined || n.nodeType === "leaf" : n === undefined || n.nodeType === "parent");
|
|
140
|
+
if (!treeIsStructurallySound)
|
|
141
|
+
return new mlsError_1.ValidationError("Received Ratchet Tree is not structurally sound");
|
|
142
|
+
const parentHashesVerified = await (0, parentHash_1.verifyParentHashes)(tree, cs.hash);
|
|
143
|
+
if (!parentHashesVerified)
|
|
144
|
+
return new mlsError_1.CryptoVerificationError("Unable to verify parent hash");
|
|
145
|
+
if (!(0, constantTimeCompare_1.constantTimeEqual)(treeHash, await (0, treeHash_1.treeHashRoot)(tree, cs.hash)))
|
|
146
|
+
return new mlsError_1.ValidationError("Unable to verify tree hash");
|
|
147
|
+
//validate all parent nodes
|
|
148
|
+
for (const [parentIndex, n] of tree.entries()) {
|
|
149
|
+
if (n?.nodeType === "parent") {
|
|
150
|
+
// verify unmerged leaves
|
|
151
|
+
for (const unmergedLeaf of n.parent.unmergedLeaves) {
|
|
152
|
+
const dp = (0, treemath_1.directPath)((0, treemath_1.leafToNodeIndex)(unmergedLeaf), (0, treemath_1.leafWidth)(tree.length));
|
|
153
|
+
const nodeIndex = (0, treemath_1.leafToNodeIndex)(unmergedLeaf);
|
|
154
|
+
if (tree[nodeIndex]?.nodeType !== "leaf" && !dp.includes(parentIndex))
|
|
155
|
+
return new mlsError_1.ValidationError("Unmerged leaf did not represent a non-blank descendant leaf node");
|
|
156
|
+
for (const parentIdx of dp) {
|
|
157
|
+
const dpNode = tree[parentIdx];
|
|
158
|
+
if (dpNode !== undefined) {
|
|
159
|
+
if (dpNode.nodeType !== "parent")
|
|
160
|
+
return new mlsError_1.InternalError("Expected parent node");
|
|
161
|
+
if (!(0, array_1.arraysEqual)(dpNode.parent.unmergedLeaves, n.parent.unmergedLeaves))
|
|
162
|
+
return new mlsError_1.ValidationError("non-blank intermediate node must list leaf node in its unmerged_leaves");
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const duplicateHpkeKeys = hasDuplicateUint8Arrays(tree.map((n) => (n !== undefined ? (0, ratchetTree_1.getHpkePublicKey)(n) : undefined)));
|
|
169
|
+
if (duplicateHpkeKeys)
|
|
170
|
+
return new mlsError_1.ValidationError("Multiple public keys with the same value");
|
|
171
|
+
// validate all leaf nodes
|
|
172
|
+
for (const [index, n] of tree.entries()) {
|
|
173
|
+
if (n?.nodeType === "leaf") {
|
|
174
|
+
const err = n.leaf.leafNodeSource === "key_package"
|
|
175
|
+
? await validateLeafNodeKeyPackage(n.leaf, groupContext, tree, false, config, authService, (0, treemath_1.nodeToLeafIndex)(index), cs.signature)
|
|
176
|
+
: await validateLeafNodeUpdateOrCommit(n.leaf, (0, treemath_1.nodeToLeafIndex)(index), groupContext, tree, authService, cs.signature);
|
|
177
|
+
if (err !== undefined)
|
|
178
|
+
return err;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function hasDuplicateUint8Arrays(byteArrays) {
|
|
183
|
+
const seen = new Set();
|
|
184
|
+
for (const data of byteArrays) {
|
|
185
|
+
if (data === undefined)
|
|
186
|
+
continue;
|
|
187
|
+
const key = (0, byteArray_1.bytesToBase64)(data);
|
|
188
|
+
if (seen.has(key)) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
seen.add(key);
|
|
192
|
+
}
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
async function validateLeafNodeUpdateOrCommit(leafNode, leafIndex, groupContext, tree, authService, s) {
|
|
196
|
+
const signatureValid = await (0, leafNode_1.verifyLeafNodeSignature)(leafNode, groupContext.groupId, leafIndex, s);
|
|
197
|
+
if (!signatureValid)
|
|
198
|
+
return new mlsError_1.CryptoVerificationError("Could not verify leaf node signature");
|
|
199
|
+
const commonError = await validateLeafNodeCommon(leafNode, groupContext, tree, authService, leafIndex);
|
|
200
|
+
if (commonError !== undefined)
|
|
201
|
+
return commonError;
|
|
202
|
+
}
|
|
203
|
+
function throwIfDefined(err) {
|
|
204
|
+
if (err !== undefined)
|
|
205
|
+
throw err;
|
|
206
|
+
}
|
|
207
|
+
async function validateLeafNodeCommon(leafNode, groupContext, tree, authService, leafIndex) {
|
|
208
|
+
const credentialValid = await authService.validateCredential(leafNode.credential, leafNode.signaturePublicKey);
|
|
209
|
+
if (!credentialValid)
|
|
210
|
+
return new mlsError_1.ValidationError("Could not validate credential");
|
|
211
|
+
const requiredCapabilities = groupContext.extensions.find((e) => e.extensionType === "required_capabilities");
|
|
212
|
+
if (requiredCapabilities !== undefined) {
|
|
213
|
+
const caps = (0, requiredCapabilities_1.decodeRequiredCapabilities)(requiredCapabilities.extensionData, 0);
|
|
214
|
+
if (caps === undefined)
|
|
215
|
+
return new mlsError_1.CodecError("Could not decode required_capabilities");
|
|
216
|
+
const leafSupportsCapabilities = capabiltiesAreSupported(caps[0], leafNode.capabilities);
|
|
217
|
+
if (!leafSupportsCapabilities)
|
|
218
|
+
return new mlsError_1.ValidationError("LeafNode does not support required capabilities");
|
|
219
|
+
}
|
|
220
|
+
const credentialUnsupported = tree.some((node) => node !== undefined &&
|
|
221
|
+
node.nodeType === "leaf" &&
|
|
222
|
+
!node.leaf.capabilities.credentials.includes(leafNode.credential.credentialType));
|
|
223
|
+
if (credentialUnsupported)
|
|
224
|
+
return new mlsError_1.ValidationError("LeafNode has credential that is not supported by member of the group");
|
|
225
|
+
const extensionsSupported = (0, extension_1.extensionsSupportedByCapabilities)(leafNode.extensions, leafNode.capabilities);
|
|
226
|
+
if (!extensionsSupported)
|
|
227
|
+
return new mlsError_1.ValidationError("LeafNode contains extension not listed in capabilities");
|
|
228
|
+
const keysAreNotUnique = tree.some((node, nodeIndex) => node !== undefined &&
|
|
229
|
+
node.nodeType === "leaf" &&
|
|
230
|
+
((0, constantTimeCompare_1.constantTimeEqual)(node.leaf.hpkePublicKey, leafNode.hpkePublicKey) ||
|
|
231
|
+
(0, constantTimeCompare_1.constantTimeEqual)(node.leaf.signaturePublicKey, leafNode.signaturePublicKey)) &&
|
|
232
|
+
leafIndex !== (0, treemath_1.nodeToLeafIndex)(nodeIndex));
|
|
233
|
+
if (keysAreNotUnique)
|
|
234
|
+
return new mlsError_1.ValidationError("hpke and signature keys not unique");
|
|
235
|
+
}
|
|
236
|
+
async function validateLeafNodeKeyPackage(leafNode, groupContext, tree, sentByClient, config, authService, leafIndex, s) {
|
|
237
|
+
const signatureValid = await (0, leafNode_1.verifyLeafNodeSignatureKeyPackage)(leafNode, s);
|
|
238
|
+
if (!signatureValid)
|
|
239
|
+
return new mlsError_1.CryptoVerificationError("Could not verify leaf node signature");
|
|
240
|
+
//verify lifetime
|
|
241
|
+
if (sentByClient || config.validateLifetimeOnReceive) {
|
|
242
|
+
if (leafNode.leafNodeSource === "key_package") {
|
|
243
|
+
const currentTime = BigInt(Math.floor(Date.now() / 1000));
|
|
244
|
+
if (leafNode.lifetime.notBefore > currentTime || leafNode.lifetime.notAfter < currentTime)
|
|
245
|
+
return new mlsError_1.ValidationError("Current time not within Lifetime");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const commonError = await validateLeafNodeCommon(leafNode, groupContext, tree, authService, leafIndex);
|
|
249
|
+
if (commonError !== undefined)
|
|
250
|
+
return commonError;
|
|
251
|
+
}
|
|
252
|
+
async function validateKeyPackage(kp, groupContext, tree, sentByClient, config, authService, s) {
|
|
253
|
+
if (kp.cipherSuite !== groupContext.cipherSuite)
|
|
254
|
+
return new mlsError_1.ValidationError("Invalid CipherSuite");
|
|
255
|
+
if (kp.version !== groupContext.version)
|
|
256
|
+
return new mlsError_1.ValidationError("Invalid mls version");
|
|
257
|
+
const leafNodeError = await validateLeafNodeKeyPackage(kp.leafNode, groupContext, tree, sentByClient, config, authService, undefined, s);
|
|
258
|
+
if (leafNodeError !== undefined)
|
|
259
|
+
return leafNodeError;
|
|
260
|
+
const signatureValid = await (0, keyPackage_1.verifyKeyPackage)(kp, s);
|
|
261
|
+
if (!signatureValid)
|
|
262
|
+
return new mlsError_1.CryptoVerificationError("Invalid keypackage signature");
|
|
263
|
+
if ((0, constantTimeCompare_1.constantTimeEqual)(kp.initKey, kp.leafNode.hpkePublicKey))
|
|
264
|
+
return new mlsError_1.ValidationError("Cannot have identicial init and encryption keys");
|
|
265
|
+
}
|
|
266
|
+
function validateReinit(allProposals, reinit, gc) {
|
|
267
|
+
if (allProposals.length !== 1)
|
|
268
|
+
return new mlsError_1.ValidationError("Reinit proposal needs to be commited by itself");
|
|
269
|
+
if (protocolVersion_1.protocolVersions[reinit.version] < protocolVersion_1.protocolVersions[gc.version])
|
|
270
|
+
return new mlsError_1.ValidationError("A ReInit proposal cannot use a version less than the version for the current group");
|
|
271
|
+
}
|
|
272
|
+
function validateExternalInit(grouped) {
|
|
273
|
+
if (grouped.external_init.length > 1)
|
|
274
|
+
return new mlsError_1.ValidationError("Cannot contain more than one external_init proposal");
|
|
275
|
+
if (grouped.remove.length > 1)
|
|
276
|
+
return new mlsError_1.ValidationError("Cannot contain more than one remove proposal");
|
|
277
|
+
if (grouped.add.length > 0 ||
|
|
278
|
+
grouped.group_context_extensions.length > 0 ||
|
|
279
|
+
grouped.reinit.length > 0 ||
|
|
280
|
+
grouped.update.length > 0)
|
|
281
|
+
return new mlsError_1.ValidationError("Invalid proposals");
|
|
282
|
+
}
|
|
283
|
+
function validateRemove(remove, tree) {
|
|
284
|
+
if (tree[(0, treemath_1.leafToNodeIndex)(remove.removed)] === undefined)
|
|
285
|
+
return new mlsError_1.ValidationError("Tried to remove empty leaf node");
|
|
286
|
+
}
|
|
287
|
+
async function applyProposals(state, proposals, committerLeafIndex, pskSearch, sentByClient, cs) {
|
|
288
|
+
const allProposals = proposals.reduce((acc, cur) => {
|
|
289
|
+
if (cur.proposalOrRefType === "proposal")
|
|
290
|
+
return [...acc, { proposal: cur.proposal, senderLeafIndex: committerLeafIndex }];
|
|
291
|
+
const p = state.unappliedProposals[(0, byteArray_1.bytesToBase64)(cur.reference)];
|
|
292
|
+
if (p === undefined)
|
|
293
|
+
throw new mlsError_1.ValidationError("Could not find proposal with supplied reference");
|
|
294
|
+
return [...acc, p];
|
|
295
|
+
}, []);
|
|
296
|
+
const grouped = allProposals.reduce((acc, cur) => {
|
|
297
|
+
//this skips any custom proposals
|
|
298
|
+
if (typeof cur.proposal.proposalType === "number")
|
|
299
|
+
return acc;
|
|
300
|
+
const proposal = acc[cur.proposal.proposalType] ?? [];
|
|
301
|
+
return { ...acc, [cur.proposal.proposalType]: [...proposal, cur] };
|
|
302
|
+
}, emptyProposals);
|
|
303
|
+
const zeroes = new Uint8Array(cs.kdf.size);
|
|
304
|
+
const isExternalInit = grouped.external_init.length > 0;
|
|
305
|
+
if (!isExternalInit) {
|
|
306
|
+
if (grouped.reinit.length > 0) {
|
|
307
|
+
const reinit = grouped.reinit.at(0).proposal.reinit;
|
|
308
|
+
throwIfDefined(validateReinit(allProposals, reinit, state.groupContext));
|
|
309
|
+
return {
|
|
310
|
+
tree: state.ratchetTree,
|
|
311
|
+
pskSecret: zeroes,
|
|
312
|
+
pskIds: [],
|
|
313
|
+
needsUpdatePath: false,
|
|
314
|
+
additionalResult: {
|
|
315
|
+
kind: "reinit",
|
|
316
|
+
reinit,
|
|
317
|
+
},
|
|
318
|
+
selfRemoved: false,
|
|
319
|
+
allProposals,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
throwIfDefined(await validateProposals(grouped, committerLeafIndex, state.groupContext, state.clientConfig.keyPackageEqualityConfig, state.clientConfig.authService, state.ratchetTree));
|
|
323
|
+
const newExtensions = flattenExtensions(grouped.group_context_extensions);
|
|
324
|
+
const [mutatedTree, addedLeafNodes] = await applyTreeMutations(state.ratchetTree, grouped, state.groupContext, sentByClient, state.clientConfig.authService, state.clientConfig.lifetimeConfig, cs.signature);
|
|
325
|
+
const [updatedPskSecret, pskIds] = await (0, pskIndex_1.accumulatePskSecret)(grouped.psk.map((p) => p.proposal.psk.preSharedKeyId), pskSearch, cs, zeroes);
|
|
326
|
+
const selfRemoved = mutatedTree[(0, treemath_1.leafToNodeIndex)(state.privatePath.leafIndex)] === undefined;
|
|
327
|
+
const needsUpdatePath = allProposals.length === 0 || Object.values(grouped.update).length > 1 || Object.values(grouped.remove).length > 1;
|
|
328
|
+
return {
|
|
329
|
+
tree: mutatedTree,
|
|
330
|
+
pskSecret: updatedPskSecret,
|
|
331
|
+
additionalResult: {
|
|
332
|
+
kind: "memberCommit",
|
|
333
|
+
addedLeafNodes,
|
|
334
|
+
extensions: newExtensions,
|
|
335
|
+
},
|
|
336
|
+
pskIds,
|
|
337
|
+
needsUpdatePath,
|
|
338
|
+
selfRemoved,
|
|
339
|
+
allProposals,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
throwIfDefined(validateExternalInit(grouped));
|
|
344
|
+
const treeAfterRemove = grouped.remove.reduce((acc, { proposal }) => {
|
|
345
|
+
return (0, ratchetTree_1.removeLeafNode)(acc, proposal.remove.removed);
|
|
346
|
+
}, state.ratchetTree);
|
|
347
|
+
const zeroes = new Uint8Array(cs.kdf.size);
|
|
348
|
+
const [updatedPskSecret, pskIds] = await (0, pskIndex_1.accumulatePskSecret)(grouped.psk.map((p) => p.proposal.psk.preSharedKeyId), pskSearch, cs, zeroes);
|
|
349
|
+
const initProposal = grouped.external_init.at(0);
|
|
350
|
+
const externalKeyPair = await cs.hpke.deriveKeyPair(state.keySchedule.externalSecret);
|
|
351
|
+
const externalInitSecret = await importSecret(await cs.hpke.exportPrivateKey(externalKeyPair.privateKey), initProposal.proposal.externalInit.kemOutput, cs);
|
|
352
|
+
return {
|
|
353
|
+
needsUpdatePath: true,
|
|
354
|
+
tree: treeAfterRemove,
|
|
355
|
+
pskSecret: updatedPskSecret,
|
|
356
|
+
pskIds,
|
|
357
|
+
additionalResult: {
|
|
358
|
+
kind: "externalCommit",
|
|
359
|
+
externalInitSecret,
|
|
360
|
+
newMemberLeafIndex: (0, treemath_1.nodeToLeafIndex)((0, ratchetTree_1.findBlankLeafNodeIndexOrExtend)(treeAfterRemove)),
|
|
361
|
+
},
|
|
362
|
+
selfRemoved: false,
|
|
363
|
+
allProposals,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function makePskIndex(state, externalPsks) {
|
|
368
|
+
return {
|
|
369
|
+
findPsk(preSharedKeyId) {
|
|
370
|
+
if (preSharedKeyId.psktype === "external") {
|
|
371
|
+
return externalPsks[(0, byteArray_1.bytesToBase64)(preSharedKeyId.pskId)];
|
|
372
|
+
}
|
|
373
|
+
if (state !== undefined && (0, constantTimeCompare_1.constantTimeEqual)(preSharedKeyId.pskGroupId, state.groupContext.groupId)) {
|
|
374
|
+
if (preSharedKeyId.pskEpoch === state.groupContext.epoch)
|
|
375
|
+
return state.keySchedule.resumptionPsk;
|
|
376
|
+
else
|
|
377
|
+
return state.historicalReceiverData.get(preSharedKeyId.pskEpoch)?.resumptionPsk;
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
async function nextEpochContext(groupContext, wireformat, content, signature, updatedTreeHash, confirmationTag, h) {
|
|
383
|
+
const interimTranscriptHash = await (0, transcriptHash_1.createInterimHash)(groupContext.confirmedTranscriptHash, confirmationTag, h);
|
|
384
|
+
const newConfirmedHash = await (0, transcriptHash_1.createConfirmedHash)(interimTranscriptHash, { wireformat, content, signature }, h);
|
|
385
|
+
return {
|
|
386
|
+
...groupContext,
|
|
387
|
+
epoch: groupContext.epoch + 1n,
|
|
388
|
+
treeHash: updatedTreeHash,
|
|
389
|
+
confirmedTranscriptHash: newConfirmedHash,
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
async function joinGroup(welcome, keyPackage, privateKeys, pskSearch, cs, ratchetTree, resumingFromState, clientConfig = clientConfig_1.defaultClientConfig) {
|
|
393
|
+
const keyPackageRef = await (0, keyPackage_1.makeKeyPackageRef)(keyPackage, cs.hash);
|
|
394
|
+
const privKey = await cs.hpke.importPrivateKey(privateKeys.initPrivateKey);
|
|
395
|
+
const groupSecrets = await (0, welcome_1.decryptGroupSecrets)(privKey, keyPackageRef, welcome, cs.hpke);
|
|
396
|
+
if (groupSecrets === undefined)
|
|
397
|
+
throw new mlsError_1.CodecError("Could not decode group secrets");
|
|
398
|
+
const zeroes = new Uint8Array(cs.kdf.size);
|
|
399
|
+
const [pskSecret, pskIds] = await (0, pskIndex_1.accumulatePskSecret)(groupSecrets.psks, pskSearch, cs, zeroes);
|
|
400
|
+
const gi = await (0, welcome_1.decryptGroupInfo)(welcome, groupSecrets.joinerSecret, pskSecret, cs);
|
|
401
|
+
if (gi === undefined)
|
|
402
|
+
throw new mlsError_1.CodecError("Could not decode group info");
|
|
403
|
+
const resumptionPsk = pskIds.find((id) => id.psktype === "resumption");
|
|
404
|
+
if (resumptionPsk !== undefined) {
|
|
405
|
+
if (resumingFromState === undefined)
|
|
406
|
+
throw new mlsError_1.ValidationError("No prior state passed for resumption");
|
|
407
|
+
if (resumptionPsk.pskEpoch !== resumingFromState.groupContext.epoch)
|
|
408
|
+
throw new mlsError_1.ValidationError("Epoch mismatch");
|
|
409
|
+
if (!(0, constantTimeCompare_1.constantTimeEqual)(resumptionPsk.pskGroupId, resumingFromState.groupContext.groupId))
|
|
410
|
+
throw new mlsError_1.ValidationError("old groupId mismatch");
|
|
411
|
+
if (gi.groupContext.epoch !== 1n)
|
|
412
|
+
throw new mlsError_1.ValidationError("Resumption must be started at epoch 1");
|
|
413
|
+
if (resumptionPsk.usage === "reinit") {
|
|
414
|
+
if (resumingFromState.groupActiveState.kind !== "suspendedPendingReinit")
|
|
415
|
+
throw new mlsError_1.ValidationError("Found reinit psk but no old suspended clientState");
|
|
416
|
+
if (!(0, constantTimeCompare_1.constantTimeEqual)(resumingFromState.groupActiveState.reinit.groupId, gi.groupContext.groupId))
|
|
417
|
+
throw new mlsError_1.ValidationError("new groupId mismatch");
|
|
418
|
+
if (resumingFromState.groupActiveState.reinit.version !== gi.groupContext.version)
|
|
419
|
+
throw new mlsError_1.ValidationError("Version mismatch");
|
|
420
|
+
if (resumingFromState.groupActiveState.reinit.cipherSuite !== gi.groupContext.cipherSuite)
|
|
421
|
+
throw new mlsError_1.ValidationError("Ciphersuite mismatch");
|
|
422
|
+
if (!(0, extension_1.extensionsEqual)(resumingFromState.groupActiveState.reinit.extensions, gi.groupContext.extensions))
|
|
423
|
+
throw new mlsError_1.ValidationError("Extensions mismatch");
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
const allExtensionsSupported = (0, extension_1.extensionsSupportedByCapabilities)(gi.groupContext.extensions, keyPackage.leafNode.capabilities);
|
|
427
|
+
if (!allExtensionsSupported)
|
|
428
|
+
throw new mlsError_1.UsageError("client does not support every extension in the GroupContext");
|
|
429
|
+
const tree = (0, groupInfo_1.ratchetTreeFromExtension)(gi) ?? ratchetTree;
|
|
430
|
+
if (tree === undefined)
|
|
431
|
+
throw new mlsError_1.UsageError("No RatchetTree passed and no ratchet_tree extension");
|
|
432
|
+
const signerNode = tree[(0, treemath_1.leafToNodeIndex)(gi.signer)];
|
|
433
|
+
if (signerNode === undefined) {
|
|
434
|
+
throw new mlsError_1.ValidationError("Could not find signer leafNode");
|
|
435
|
+
}
|
|
436
|
+
if (signerNode.nodeType === "parent")
|
|
437
|
+
throw new mlsError_1.ValidationError("Expected non blank leaf node");
|
|
438
|
+
const credentialVerified = await clientConfig.authService.validateCredential(signerNode.leaf.credential, signerNode.leaf.signaturePublicKey);
|
|
439
|
+
if (!credentialVerified)
|
|
440
|
+
throw new mlsError_1.ValidationError("Could not validate credential");
|
|
441
|
+
const groupInfoSignatureVerified = (0, groupInfo_1.verifyGroupInfoSignature)(gi, signerNode.leaf.signaturePublicKey, cs.signature);
|
|
442
|
+
if (!groupInfoSignatureVerified)
|
|
443
|
+
throw new mlsError_1.CryptoVerificationError("Could not verify groupInfo signature");
|
|
444
|
+
if (gi.groupContext.cipherSuite !== keyPackage.cipherSuite)
|
|
445
|
+
throw new mlsError_1.ValidationError("cipher suite in the GroupInfo does not match the cipher_suite in the KeyPackage");
|
|
446
|
+
throwIfDefined(await validateRatchetTree(tree, gi.groupContext, clientConfig.lifetimeConfig, clientConfig.authService, gi.groupContext.treeHash, cs));
|
|
447
|
+
const newLeaf = (0, ratchetTree_1.findLeafIndex)(tree, keyPackage.leafNode);
|
|
448
|
+
if (newLeaf === undefined)
|
|
449
|
+
throw new mlsError_1.ValidationError("Could not find own leaf when processing welcome");
|
|
450
|
+
const privateKeyPath = {
|
|
451
|
+
leafIndex: newLeaf,
|
|
452
|
+
privateKeys: { [(0, treemath_1.leafToNodeIndex)(newLeaf)]: privateKeys.hpkePrivateKey },
|
|
453
|
+
};
|
|
454
|
+
const ancestorNodeIndex = (0, updatePath_1.firstCommonAncestor)(tree, newLeaf, gi.signer);
|
|
455
|
+
const updatedPkp = groupSecrets.pathSecret === undefined
|
|
456
|
+
? privateKeyPath
|
|
457
|
+
: (0, privateKeyPath_1.mergePrivateKeyPaths)(await (0, privateKeyPath_1.toPrivateKeyPath)(await (0, pathSecrets_1.pathToRoot)(tree, ancestorNodeIndex, groupSecrets.pathSecret, cs.kdf), newLeaf, cs), privateKeyPath);
|
|
458
|
+
const keySchedule = await (0, keySchedule_1.deriveKeySchedule)(groupSecrets.joinerSecret, pskSecret, gi.groupContext, cs.kdf);
|
|
459
|
+
const confirmationTagVerified = await (0, groupInfo_1.verifyGroupInfoConfirmationTag)(gi, groupSecrets.joinerSecret, pskSecret, cs);
|
|
460
|
+
if (!confirmationTagVerified)
|
|
461
|
+
throw new mlsError_1.CryptoVerificationError("Could not verify confirmation tag");
|
|
462
|
+
const secretTree = await (0, secretTree_1.createSecretTree)((0, treemath_1.leafWidth)(tree.length), keySchedule.encryptionSecret, cs.kdf);
|
|
463
|
+
return {
|
|
464
|
+
groupContext: gi.groupContext,
|
|
465
|
+
ratchetTree: tree,
|
|
466
|
+
privatePath: updatedPkp,
|
|
467
|
+
signaturePrivateKey: privateKeys.signaturePrivateKey,
|
|
468
|
+
confirmationTag: gi.confirmationTag,
|
|
469
|
+
unappliedProposals: {},
|
|
470
|
+
keySchedule,
|
|
471
|
+
secretTree,
|
|
472
|
+
historicalReceiverData: new Map(),
|
|
473
|
+
groupActiveState: { kind: "active" },
|
|
474
|
+
clientConfig,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
async function createGroup(groupId, keyPackage, privateKeyPackage, extensions, cs, clientConfig = clientConfig_1.defaultClientConfig) {
|
|
478
|
+
const ratchetTree = [{ nodeType: "leaf", leaf: keyPackage.leafNode }];
|
|
479
|
+
const privatePath = {
|
|
480
|
+
leafIndex: 0,
|
|
481
|
+
privateKeys: { [0]: privateKeyPackage.hpkePrivateKey },
|
|
482
|
+
};
|
|
483
|
+
const confirmedTranscriptHash = new Uint8Array();
|
|
484
|
+
const groupContext = {
|
|
485
|
+
version: "mls10",
|
|
486
|
+
cipherSuite: cs.name,
|
|
487
|
+
epoch: 0n,
|
|
488
|
+
treeHash: await (0, treeHash_1.treeHashRoot)(ratchetTree, cs.hash),
|
|
489
|
+
groupId,
|
|
490
|
+
extensions,
|
|
491
|
+
confirmedTranscriptHash,
|
|
492
|
+
};
|
|
493
|
+
throwIfDefined(await validateExternalSenders(extensions, clientConfig.authService));
|
|
494
|
+
const epochSecret = cs.rng.randomBytes(cs.kdf.size);
|
|
495
|
+
const keySchedule = await (0, keySchedule_1.initializeKeySchedule)(epochSecret, cs.kdf);
|
|
496
|
+
const confirmationTag = await (0, framedContent_1.createConfirmationTag)(keySchedule.confirmationKey, confirmedTranscriptHash, cs.hash);
|
|
497
|
+
const secretTree = await (0, secretTree_1.createSecretTree)(1, keySchedule.encryptionSecret, cs.kdf);
|
|
498
|
+
return {
|
|
499
|
+
ratchetTree,
|
|
500
|
+
keySchedule,
|
|
501
|
+
secretTree,
|
|
502
|
+
privatePath,
|
|
503
|
+
signaturePrivateKey: privateKeyPackage.signaturePrivateKey,
|
|
504
|
+
unappliedProposals: {},
|
|
505
|
+
historicalReceiverData: new Map(),
|
|
506
|
+
groupContext,
|
|
507
|
+
confirmationTag,
|
|
508
|
+
groupActiveState: { kind: "active" },
|
|
509
|
+
clientConfig,
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
async function exportSecret(publicKey, cs) {
|
|
513
|
+
return cs.hpke.exportSecret(await cs.hpke.importPublicKey(publicKey), new TextEncoder().encode("MLS 1.0 external init secret"), cs.kdf.size, new Uint8Array());
|
|
514
|
+
}
|
|
515
|
+
async function importSecret(privateKey, kemOutput, cs) {
|
|
516
|
+
return cs.hpke.importSecret(await cs.hpke.importPrivateKey(privateKey), new TextEncoder().encode("MLS 1.0 external init secret"), kemOutput, cs.kdf.size, new Uint8Array());
|
|
517
|
+
}
|
|
518
|
+
async function applyTreeMutations(ratchetTree, grouped, gc, sentByClient, authService, lifetimeConfig, s) {
|
|
519
|
+
const treeAfterUpdate = await grouped.update.reduce(async (acc, { senderLeafIndex, proposal }) => {
|
|
520
|
+
if (senderLeafIndex === undefined)
|
|
521
|
+
throw new mlsError_1.InternalError("No sender index found for update proposal");
|
|
522
|
+
throwIfDefined(await validateLeafNodeUpdateOrCommit(proposal.update.leafNode, senderLeafIndex, gc, ratchetTree, authService, s));
|
|
523
|
+
return (0, ratchetTree_1.updateLeafNode)(await acc, proposal.update.leafNode, senderLeafIndex);
|
|
524
|
+
}, Promise.resolve(ratchetTree));
|
|
525
|
+
const treeAfterRemove = grouped.remove.reduce((acc, { proposal }) => {
|
|
526
|
+
throwIfDefined(validateRemove(proposal.remove, ratchetTree));
|
|
527
|
+
return (0, ratchetTree_1.removeLeafNode)(acc, proposal.remove.removed);
|
|
528
|
+
}, treeAfterUpdate);
|
|
529
|
+
const [treeAfterAdd, addedLeafNodes] = await grouped.add.reduce(async (acc, { proposal }) => {
|
|
530
|
+
throwIfDefined(await validateKeyPackage(proposal.add.keyPackage, gc, ratchetTree, sentByClient, lifetimeConfig, authService, s));
|
|
531
|
+
const [tree, ws] = await acc;
|
|
532
|
+
const [updatedTree, leafNodeIndex] = (0, ratchetTree_1.addLeafNode)(tree, proposal.add.keyPackage.leafNode);
|
|
533
|
+
return [updatedTree, [...ws, [(0, treemath_1.nodeToLeafIndex)(leafNodeIndex), proposal.add.keyPackage]]];
|
|
534
|
+
}, Promise.resolve([treeAfterRemove, []]));
|
|
535
|
+
return [treeAfterAdd, addedLeafNodes];
|
|
536
|
+
}
|
|
537
|
+
async function processProposal(state, content, proposal, h) {
|
|
538
|
+
const ref = await (0, authenticatedContent_1.makeProposalRef)(content, h);
|
|
539
|
+
return {
|
|
540
|
+
...state,
|
|
541
|
+
unappliedProposals: (0, unappliedProposals_1.addUnappliedProposal)(ref, state.unappliedProposals, proposal, (0, sender_1.getSenderLeafNodeIndex)(content.content.sender)),
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
function addHistoricalReceiverData(state) {
|
|
545
|
+
const withNew = (0, addToMap_1.addToMap)(state.historicalReceiverData, state.groupContext.epoch, {
|
|
546
|
+
secretTree: state.secretTree,
|
|
547
|
+
ratchetTree: state.ratchetTree,
|
|
548
|
+
senderDataSecret: state.keySchedule.senderDataSecret,
|
|
549
|
+
groupContext: state.groupContext,
|
|
550
|
+
resumptionPsk: state.keySchedule.resumptionPsk,
|
|
551
|
+
});
|
|
552
|
+
const epochs = [...withNew.keys()];
|
|
553
|
+
const result = epochs.length >= state.clientConfig.keyRetentionConfig.retainKeysForEpochs
|
|
554
|
+
? removeOldHistoricalReceiverData(withNew, state.clientConfig.keyRetentionConfig.retainKeysForEpochs)
|
|
555
|
+
: withNew;
|
|
556
|
+
return result;
|
|
557
|
+
}
|
|
558
|
+
function removeOldHistoricalReceiverData(historicalReceiverData, max) {
|
|
559
|
+
const sortedEpochs = [...historicalReceiverData.keys()].sort((a, b) => (a < b ? -1 : 1));
|
|
560
|
+
return new Map(sortedEpochs.slice(-max).map((epoch) => [epoch, historicalReceiverData.get(epoch)]));
|
|
561
|
+
}
|
|
562
|
+
//# sourceMappingURL=clientState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientState.js","sourceRoot":"","sources":["../../src/clientState.ts"],"names":[],"mappings":";;AAmGA,0EAKC;AAED,sEAKC;AAiKD,kDA8EC;AAkBD,wEAeC;AAED,wCAEC;AA0JD,wCAwIC;AAED,oCAaC;AAED,4CAkBC;AAED,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AE,CAAC,CAAC,CAAC,CAAA;AACtG,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Decoder } from "./tlsDecoder";
|
|
2
|
+
import { Encoder } from "./tlsEncoder";
|
|
3
|
+
export declare const encodeUint8: Encoder<number>;
|
|
4
|
+
export declare const decodeUint8: Decoder<number>;
|
|
5
|
+
export declare const encodeUint16: Encoder<number>;
|
|
6
|
+
export declare const decodeUint16: Decoder<number>;
|
|
7
|
+
export declare const encodeUint32: Encoder<number>;
|
|
8
|
+
export declare const decodeUint32: Decoder<number>;
|
|
9
|
+
export declare const encodeUint64: Encoder<bigint>;
|
|
10
|
+
export declare const decodeUint64: Decoder<bigint>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/codec/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,CAKvC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,CAGvC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAKxC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAOxC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAKxC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAOxC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAKxC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAOxC,CAAA"}
|