ts-mls
Version:
[](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [](https://badge.fury.io/js/ts-mls) [ {
return { ...a, privateKeys: { ...a.privateKeys, ...b.privateKeys } };
}
export function updateLeafKey(path, newKey) {
return { ...path, privateKeys: { ...path.privateKeys, [leafToNodeIndex(toLeafIndex(path.leafIndex))]: newKey } };
}
export async function toPrivateKeyPath(pathSecrets, leafIndex, cs) {
const asArray = await Promise.all(Object.entries(pathSecrets).map(async ([nodeIndex, pathSecret]) => {
const nodeSecret = await deriveSecret(pathSecret, "node", cs.kdf);
const { privateKey } = await cs.hpke.deriveKeyPair(nodeSecret);
return [Number(nodeIndex), await cs.hpke.exportPrivateKey(privateKey)];
}));
const privateKeys = Object.fromEntries(asArray);
return { leafIndex, privateKeys };
}
//# sourceMappingURL=privateKeyPath.js.map