ts-mls
Version:
[](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [](https://badge.fury.io/js/ts-mls) [ • 1.29 kB
TypeScript
import { Decoder } from "./codec/tlsDecoder.js";
import { Encoder } from "./codec/tlsEncoder.js";
import { Hash } from "./crypto/hash.js";
import { LeafNode } from "./leafNode.js";
import { ParentNode } from "./parentNode.js";
import { RatchetTree } from "./ratchetTree.js";
import { NodeIndex } from "./treemath.js";
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: NodeIndex, h: Hash): Promise<Uint8Array>;
export {};