UNPKG

ts-mls

Version:

[![CI](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml/badge.svg)](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/ts-mls.svg)](https://badge.fury.io/js/ts-mls) [![Coverage Status](https://co

30 lines (29 loc) 1.8 kB
import { Decoder } from "./codec/tlsDecoder.js"; import { Encoder } from "./codec/tlsEncoder.js"; import { CiphersuiteImpl, CiphersuiteName } from "./crypto/ciphersuite.js"; import { PublicKey, Hpke, PrivateKey } from "./crypto/hpke.js"; import { GroupInfo } from "./groupInfo.js"; import { GroupSecrets } from "./groupSecrets.js"; import { HPKECiphertext } from "./hpkeCiphertext.js"; export interface EncryptedGroupSecrets { newMember: Uint8Array; encryptedGroupSecrets: HPKECiphertext; } export declare const encodeEncryptedGroupSecrets: Encoder<EncryptedGroupSecrets>; export declare const decodeEncryptedGroupSecrets: Decoder<EncryptedGroupSecrets>; export interface Welcome { cipherSuite: CiphersuiteName; secrets: EncryptedGroupSecrets[]; encryptedGroupInfo: Uint8Array; } export declare const encodeWelcome: Encoder<Welcome>; export declare const decodeWelcome: Decoder<Welcome>; export declare function welcomeNonce(welcomeSecret: Uint8Array, cs: CiphersuiteImpl): Promise<Uint8Array<ArrayBufferLike>>; export declare function welcomeKey(welcomeSecret: Uint8Array, cs: CiphersuiteImpl): Promise<Uint8Array<ArrayBufferLike>>; export declare function encryptGroupInfo(groupInfo: GroupInfo, welcomeSecret: Uint8Array, cs: CiphersuiteImpl): Promise<Uint8Array>; export declare function decryptGroupInfo(w: Welcome, joinerSecret: Uint8Array, pskSecret: Uint8Array, cs: CiphersuiteImpl): Promise<GroupInfo | undefined>; export declare function encryptGroupSecrets(initKey: PublicKey, encryptedGroupInfo: Uint8Array, groupSecrets: GroupSecrets, hpke: Hpke): Promise<{ ct: Uint8Array; enc: Uint8Array; }>; export declare function decryptGroupSecrets(initPrivateKey: PrivateKey, keyPackageRef: Uint8Array, welcome: Welcome, hpke: Hpke): Promise<GroupSecrets | undefined>;