ts-mls
Version:
[](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [](https://badge.fury.io/js/ts-mls) [ => [a.wireformat, a.content, a.auth]);
export const decodeAuthenticatedContent = mapDecoders([
decodeWireformat,
flatMapDecoder(decodeFramedContent, (content) => {
return mapDecoder(decodeFramedContentAuthData(content.contentType), (auth) => ({ content, auth }));
}),
], (wireformat, contentAuth) => ({
wireformat,
...contentAuth,
}));
export const encodeAuthenticatedContentTBM = contramapEncoders([encodeFramedContentTBS, encodeFramedContentAuthData], (t) => [t.contentTbs, t.auth]);
export function createMembershipTag(membershipKey, tbm, h) {
return h.mac(membershipKey, encodeAuthenticatedContentTBM(tbm));
}
export function verifyMembershipTag(membershipKey, tbm, tag, h) {
return h.verifyMac(membershipKey, tag, encodeAuthenticatedContentTBM(tbm));
}
export function makeProposalRef(proposal, h) {
return refhash("MLS 1.0 Proposal Reference", encodeAuthenticatedContent(proposal), h);
}
//# sourceMappingURL=authenticatedContent.js.map