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

35 lines (34 loc) 1.7 kB
import { Decoder } from "./codec/tlsDecoder"; import { Encoder } from "./codec/tlsEncoder"; import { CiphersuiteImpl } from "./crypto/ciphersuite"; import { Hash } from "./crypto/hash"; import { PrivateKey } from "./crypto/hpke"; import { GroupContext } from "./groupContext"; import { LeafNodeCommit } from "./leafNode"; import { RatchetTree } from "./ratchetTree"; import { HPKECiphertext } from "./hpkeCiphertext"; export type UpdatePathNode = { hpkePublicKey: Uint8Array; encryptedPathSecret: HPKECiphertext[]; }; export declare const encodeUpdatePathNode: Encoder<UpdatePathNode>; export declare const decodeUpdatePathNode: Decoder<UpdatePathNode>; export type UpdatePath = { leafNode: LeafNodeCommit; nodes: UpdatePathNode[]; }; export declare const encodeUpdatePath: Encoder<UpdatePath>; export declare const decodeUpdatePath: Decoder<UpdatePath>; export type PathSecret = { nodeIndex: number; secret: Uint8Array; sendTo: number[]; }; export declare function createUpdatePath(originalTree: RatchetTree, senderLeafIndex: number, groupContext: GroupContext, signaturePrivateKey: Uint8Array, cs: CiphersuiteImpl): Promise<[RatchetTree, UpdatePath, PathSecret[], PrivateKey]>; export declare function applyUpdatePath(tree: RatchetTree, senderLeafIndex: number, path: UpdatePath, h: Hash, isExternal?: boolean): Promise<RatchetTree>; export declare function firstCommonAncestor(tree: RatchetTree, leafIndex: number, senderLeafIndex: number): number; export declare function firstMatchAncestor(tree: RatchetTree, leafIndex: number, senderLeafIndex: number, path: UpdatePath): { nodeIndex: number; resolution: number[]; updateNode: UpdatePathNode | undefined; };