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

18 lines (17 loc) 888 B
import { Decoder } from "./codec/tlsDecoder.js"; import { Encoder } from "./codec/tlsEncoder.js"; import { Hash } from "./crypto/hash.js"; import { RatchetTree } from "./ratchetTree.js"; import { NodeIndex } from "./treemath.js"; export interface 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: NodeIndex, h: Hash): Promise<[Uint8Array, NodeIndex | undefined]>;