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

29 lines (28 loc) 1.29 kB
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 {};