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

15 lines 697 B
import { composeBufferEncoders, encode } from "../codec/tlsEncoder.js"; import { varLenDataEncoder } from "../codec/variableLength.js"; export async function signWithLabel(signKey, label, content, s) { return s.sign(signKey, encode(composeBufferEncoders([varLenDataEncoder, varLenDataEncoder]))([ new TextEncoder().encode(`MLS 1.0 ${label}`), content, ])); } export async function verifyWithLabel(publicKey, label, content, signature, s) { return s.verify(publicKey, encode(composeBufferEncoders([varLenDataEncoder, varLenDataEncoder]))([ new TextEncoder().encode(`MLS 1.0 ${label}`), content, ]), signature); } //# sourceMappingURL=signature.js.map