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

17 lines (16 loc) 825 B
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]>;