This commit is contained in:
Paul Miller 2024-01-25 11:41:48 +00:00
parent 943edbceba
commit b8ddb603c1
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B

@ -385,7 +385,12 @@ export const elligatorSwift = /* @__PURE__ */ {
return numberToBytesBE(point.multiply(d).x, 32); return numberToBytesBE(point.multiply(d).x, 32);
}, },
// BIP324 shared secret // BIP324 shared secret
getSharedSecretBip324: (privateKeyOurs: Hex, publicKeyTheirs: Hex, publicKeyOurs: Hex, initiating: boolean) => { getSharedSecretBip324: (
privateKeyOurs: Hex,
publicKeyTheirs: Hex,
publicKeyOurs: Hex,
initiating: boolean
) => {
const ours = ensureBytes('publicKeyOurs', publicKeyOurs); const ours = ensureBytes('publicKeyOurs', publicKeyOurs);
const theirs = ensureBytes('publicKeyTheirs', publicKeyTheirs); const theirs = ensureBytes('publicKeyTheirs', publicKeyTheirs);
const ecdhPoint = elligatorSwift.getSharedSecret(privateKeyOurs, theirs); const ecdhPoint = elligatorSwift.getSharedSecret(privateKeyOurs, theirs);