ts-mls
Version:
[](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [](https://badge.fury.io/js/ts-mls) [ • 1.23 kB
TypeScript
import { Decoder } from "./codec/tlsDecoder";
import { Encoder } from "./codec/tlsEncoder";
import { Hash } from "./crypto/hash";
import { LeafNode } from "./leafNode";
import { ParentNode } from "./parentNode";
import { RatchetTree } from "./ratchetTree";
export type TreeHashInput = LeafNodeHashInput | ParentNodeHashInput;
type LeafNodeHashInput = {
nodeType: "leaf";
leafIndex: number;
leafNode: LeafNode | undefined;
};
type ParentNodeHashInput = {
nodeType: "parent";
parentNode: ParentNode | undefined;
leftHash: Uint8Array;
rightHash: Uint8Array;
};
export declare const encodeLeafNodeHashInput: Encoder<LeafNodeHashInput>;
export declare const decodeLeafNodeHashInput: Decoder<LeafNodeHashInput>;
export declare const encodeParentNodeHashInput: Encoder<ParentNodeHashInput>;
export declare const decodeParentNodeHashInput: Decoder<ParentNodeHashInput>;
export declare const encodeTreeHashInput: Encoder<TreeHashInput>;
export declare const decodeTreeHashInput: Decoder<TreeHashInput>;
export declare function treeHashRoot(tree: RatchetTree, h: Hash): Promise<Uint8Array>;
export declare function treeHash(tree: RatchetTree, subtreeIndex: number, h: Hash): Promise<Uint8Array>;
export {};