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

36 lines 1.46 kB
import { encodeLeafNodeData, decodeLeafNodeData } from "../../src/leafNode"; import { createRoundtripTest } from "./roundtrip"; describe("LeafNodeData roundtrip", () => { const roundtrip = createRoundtripTest(encodeLeafNodeData, decodeLeafNodeData); test("roundtrips minimal", () => { const data = { hpkePublicKey: new Uint8Array([1, 2, 3]), signaturePublicKey: new Uint8Array([4, 5, 6]), credential: { credentialType: "basic", identity: new Uint8Array([7, 8, 9]) }, capabilities: { versions: [], ciphersuites: [], extensions: [], proposals: [], credentials: [], }, }; roundtrip(data); }); test("roundtrips nontrivial", () => { const data = { hpkePublicKey: new Uint8Array([10, 11, 12, 13, 14]), signaturePublicKey: new Uint8Array([15, 16, 17, 18, 19]), credential: { credentialType: "x509", certificates: [new Uint8Array([20, 21]), new Uint8Array([22, 23, 24])] }, capabilities: { versions: ["mls10"], ciphersuites: ["MLS_256_XWING_AES256GCM_SHA512_Ed25519"], extensions: [], proposals: [73, 101], credentials: ["basic", "x509"], }, }; roundtrip(data); }); }); //# sourceMappingURL=leafNodeData.test.js.map