ts-mls
Version:
[](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [](https://badge.fury.io/js/ts-mls) [ • 825 B
TypeScript
import { Decoder } from "./codec/tlsDecoder";
import { Encoder } from "./codec/tlsEncoder";
import { Hash } from "./crypto/hash";
import { RatchetTree } from "./ratchetTree";
export type ParentHashInput = {
encryptionKey: Uint8Array;
parentHash: Uint8Array;
originalSiblingTreeHash: Uint8Array;
};
export declare const encodeParentHashInput: Encoder<ParentHashInput>;
export declare const decodeParentHashInput: Decoder<ParentHashInput>;
export declare function verifyParentHashes(tree: RatchetTree, h: Hash): Promise<boolean>;
/**
* Calculcates parent hash for a given node or leaf and returns the node index of the parent or undefined if the given node is the root node.
*/
export declare function calculateParentHash(tree: RatchetTree, nodeIndex: number, h: Hash): Promise<[Uint8Array, number | undefined]>;