Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bitgo/sdk-lib-mpc

Package Overview
Dependencies
Maintainers
14
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitgo/sdk-lib-mpc - npm Package Compare versions

Comparing version 9.1.1 to 9.2.0

dist/src/safePrime.d.ts

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

# [9.2.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-lib-mpc@9.1.1...@bitgo/sdk-lib-mpc@9.2.0) (2024-04-05)
### Features
- **sdk-lib-mpc:** use crypto module for safe prime ([3113e6a](https://github.com/BitGo/BitGoJS/commit/3113e6ad2e536a5c16cefa60bb318543895c8497))
## [9.1.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-lib-mpc@9.1.0...@bitgo/sdk-lib-mpc@9.1.1) (2024-03-19)

@@ -8,0 +14,0 @@

24

dist/src/curves/ed25519.js

@@ -25,30 +25,30 @@ "use strict";

scalarRandom() {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_reduce(util_1.bigIntFromBufferLE(crypto_1.randomBytes(64)))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_reduce((0, util_1.bigIntFromBufferLE)((0, crypto_1.randomBytes)(64)))));
}
scalarReduce(s) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_reduce(util_1.bigIntToBufferLE(s, 64))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_reduce((0, util_1.bigIntToBufferLE)(s, 64))));
}
scalarNegate(s) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_negate(util_1.bigIntToBufferLE(s, privateKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_negate((0, util_1.bigIntToBufferLE)(s, privateKeySize))));
}
scalarInvert(s) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_invert(util_1.bigIntToBufferLE(s, privateKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_invert((0, util_1.bigIntToBufferLE)(s, privateKeySize))));
}
scalarAdd(x, y) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_add(util_1.bigIntToBufferLE(x, privateKeySize), util_1.bigIntToBufferLE(y, privateKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_add((0, util_1.bigIntToBufferLE)(x, privateKeySize), (0, util_1.bigIntToBufferLE)(y, privateKeySize))));
}
scalarSub(x, y) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_sub(util_1.bigIntToBufferLE(x, privateKeySize), util_1.bigIntToBufferLE(y, privateKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_sub((0, util_1.bigIntToBufferLE)(x, privateKeySize), (0, util_1.bigIntToBufferLE)(y, privateKeySize))));
}
scalarMult(x, y) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_mul(util_1.bigIntToBufferLE(x, privateKeySize), util_1.bigIntToBufferLE(y, privateKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_scalar_mul((0, util_1.bigIntToBufferLE)(x, privateKeySize), (0, util_1.bigIntToBufferLE)(y, privateKeySize))));
}
basePointMult(n) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_scalarmult_ed25519_base_noclamp(util_1.bigIntToBufferLE(n, privateKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_scalarmult_ed25519_base_noclamp((0, util_1.bigIntToBufferLE)(n, privateKeySize))));
}
pointAdd(p, q) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_add(util_1.bigIntToBufferLE(p, publicKeySize), util_1.bigIntToBufferLE(q, publicKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_core_ed25519_add((0, util_1.bigIntToBufferLE)(p, publicKeySize), (0, util_1.bigIntToBufferLE)(q, publicKeySize))));
}
pointMultiply(p, s) {
return util_1.bigIntFromBufferLE(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_scalarmult_ed25519_noclamp(util_1.bigIntToBufferLE(s, publicKeySize), util_1.bigIntToBufferLE(p, publicKeySize))));
return (0, util_1.bigIntFromBufferLE)(Buffer.from(libsodium_wrappers_sumo_1.default.crypto_scalarmult_ed25519_noclamp((0, util_1.bigIntToBufferLE)(s, publicKeySize), (0, util_1.bigIntToBufferLE)(p, publicKeySize))));
}

@@ -59,3 +59,3 @@ verify(message, signature, publicKey) {

// Returns the message which was signed if the signature is valid
const result = Buffer.from(libsodium_wrappers_sumo_1.default.crypto_sign_open(signedMessage, util_1.bigIntToBufferLE(publicKey, publicKeySize)));
const result = Buffer.from(libsodium_wrappers_sumo_1.default.crypto_sign_open(signedMessage, (0, util_1.bigIntToBufferLE)(publicKey, publicKeySize)));
return Buffer.compare(message, result) === 0;

@@ -74,2 +74,2 @@ }

Ed25519Curve.initialized = false;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWQyNTUxOS5qcyIsInNvdXJjZVJvb3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biAgICAgIHJldHVybiBCdWZmZXIuY29tcGFyZShtZXNzYWdlLCByZXN1bHQpID09PSAwO1xuICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAvLyBJbnZhbGlkIHNpZ25hdHVyZSBjYXVzZXMgYW4gZXhjZXB0aW9uXG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgb3JkZXIoKTogYmlnaW50IHtcbiAgICByZXR1cm4gQmlnSW50KCcweDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMTRkZWY5ZGVhMmY3OWNkNjU4MTI2MzFhNWNmNWQzZWQnKSAqIEJpZ0ludCgnMHgwOCcpO1xuICB9XG5cbiAgc2NhbGFyQnl0ZXMgPSBwcml2YXRlS2V5U2l6ZTtcblxuICBwb2ludEJ5dGVzID0gcHVibGljS2V5U2l6ZTtcbn1cbiJdfQ==

@@ -18,3 +18,3 @@ "use strict";

publicDerive(keychain, path) {
const indices = util_2.pathToIndices(path);
const indices = (0, util_2.pathToIndices)(path);
function deriveIndex(acc, index) {

@@ -25,5 +25,5 @@ const [pk, chaincode] = acc;

// left = kl + 8 * trunc28(zl)
const t = BigInt(8) * util_1.bigIntFromBufferLE(zl.slice(0, 28));
const t = BigInt(8) * (0, util_1.bigIntFromBufferLE)(zl.slice(0, 28));
const left = Ed25519Bip32HdTree.curve.pointAdd(pk, Ed25519Bip32HdTree.curve.basePointMult(t));
return [left, util_1.bigIntFromBufferBE(iout.slice(32))];
return [left, (0, util_1.bigIntFromBufferBE)(iout.slice(32))];
}

@@ -34,3 +34,3 @@ const subkey = indices.reduce(deriveIndex, deriveIndex([keychain.pk, keychain.chaincode], indices.shift()));

privateDerive(keychain, path) {
const indices = util_2.pathToIndices(path);
const indices = (0, util_2.pathToIndices)(path);
function deriveIndex(acc, index) {

@@ -42,8 +42,8 @@ const [pk, sk, prefix, chaincode] = acc;

// left = kl + 8 * trunc28(zl)
const t = BigInt(8) * util_1.bigIntFromBufferLE(zl.slice(0, 28));
const t = BigInt(8) * (0, util_1.bigIntFromBufferLE)(zl.slice(0, 28));
const left_pk = Ed25519Bip32HdTree.curve.pointAdd(pk, Ed25519Bip32HdTree.curve.basePointMult(t));
const left_sk = Ed25519Bip32HdTree.curve.scalarAdd(sk, t);
// right = zr + kr
const right = (prefix + util_1.bigIntFromBufferBE(zr)) % constant_1.chaincodeBase;
return [left_pk, left_sk, right, util_1.bigIntFromBufferBE(iout.slice(32))];
const right = (prefix + (0, util_1.bigIntFromBufferBE)(zr)) % constant_1.chaincodeBase;
return [left_pk, left_sk, right, (0, util_1.bigIntFromBufferBE)(iout.slice(32))];
}

@@ -58,4 +58,4 @@ const [pk, sk, prefix, chaincode] = indices.reduce(deriveIndex, deriveIndex([keychain.pk, keychain.sk, keychain.prefix, keychain.chaincode], indices.shift()));

function deriveEd25519Helper(index = 0, chaincode, pk, sk) {
const zmac = crypto_1.createHmac('sha512', util_1.bigIntToBufferBE(chaincode, 32));
const imac = crypto_1.createHmac('sha512', util_1.bigIntToBufferBE(chaincode, 32));
const zmac = (0, crypto_1.createHmac)('sha512', (0, util_1.bigIntToBufferBE)(chaincode, 32));
const imac = (0, crypto_1.createHmac)('sha512', (0, util_1.bigIntToBufferBE)(chaincode, 32));
const seri = Buffer.alloc(4);

@@ -68,6 +68,6 @@ seri.writeUInt32LE(index, 0);

zmac.update('\x02');
zmac.update(util_1.bigIntToBufferLE(pk, 32));
zmac.update((0, util_1.bigIntToBufferLE)(pk, 32));
zmac.update(seri);
imac.update('\x03');
imac.update(util_1.bigIntToBufferLE(pk, 32));
imac.update((0, util_1.bigIntToBufferLE)(pk, 32));
imac.update(seri);

@@ -83,6 +83,6 @@ }

zmac.update('\x00');
zmac.update(util_1.bigIntToBufferLE(sk, 32));
zmac.update((0, util_1.bigIntToBufferLE)(sk, 32));
zmac.update(seri);
imac.update('\x01');
imac.update(util_1.bigIntToBufferLE(sk, 32));
imac.update((0, util_1.bigIntToBufferLE)(sk, 32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ZShzZXJpKTtcbiAgfSBlbHNlIHtcbiAgICBpZiAoc2sgPT09IHVuZGVmaW5lZCkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKFwiQ2FuJ3QgcGVyZm9ybWVkIGhhcmRlbmVkIGRlcml2YXRpb24gd2l0aG91dCBwcml2YXRlIGtleVwiKTtcbiAgICB9XG4gICAgLy8gSGFyZGVuZWQgZGVyaXZhdGlvbjpcbiAgICAvLyBaID0gSE1BQy1TSEE1MTIoS2V5ID0gY3BhciwgRGF0YSA9IDB4MDAgfHwgc2VyMjU2KGxlZnQoa3BhcikpIHx8IHNlcjMyKGkpKS5cbiAgICAvLyBJID0gSE1BQy1TSEE1MTIoS2V5ID0gY3BhciwgRGF0YSA9IDB4MDEgfHwgc2VyMjU2KGxlZnQoa3BhcikpIHx8IHNlcjMyKGkpKS5cbiAgICB6bWFjLnVwZGF0ZSgnXFx4MDAnKTtcbiAgICB6bWFjLnVwZGF0ZShiaWdJbnRUb0J1ZmZlckxFKHNrLCAzMikpO1xuICAgIHptYWMudXBkYXRlKHNlcmkpO1xuICAgIGltYWMudXBkYXRlKCdcXHgwMScpO1xuICAgIGltYWMudXBkYXRlKGJpZ0ludFRvQnVmZmVyTEUoc2ssIDMyKSk7XG4gICAgaW1hYy51cGRhdGUoc2VyaSk7XG4gIH1cbiAgcmV0dXJuIFt6bWFjLmRpZ2VzdCgpLCBpbWFjLmRpZ2VzdCgpXTtcbn1cbiJdfQ==
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -20,2 +24,2 @@ if (k2 === undefined) k2 = k;

__exportStar(require("./ed25519Bip32HdTree"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY3VydmVzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUFBLDBDQUF3QjtBQUN4Qix5Q0FBdUI7QUFDdkIsNkNBQTJCO0FBQzNCLDhDQUE0QjtBQUM1Qix5REFBdUM7QUFDdkMsNENBQTBCO0FBQzFCLHVEQUFxQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vdHlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi91dGlsJztcbmV4cG9ydCAqIGZyb20gJy4vY29uc3RhbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9zZWNwMjU2azEnO1xuZXhwb3J0ICogZnJvbSAnLi9zZWNwMjU2azFCaXAzMkhkVHJlZSc7XG5leHBvcnQgKiBmcm9tICcuL2VkMjU1MTknO1xuZXhwb3J0ICogZnJvbSAnLi9lZDI1NTE5QmlwMzJIZFRyZWUnO1xuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY3VydmVzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwwQ0FBd0I7QUFDeEIseUNBQXVCO0FBQ3ZCLDZDQUEyQjtBQUMzQiw4Q0FBNEI7QUFDNUIseURBQXVDO0FBQ3ZDLDRDQUEwQjtBQUMxQix1REFBcUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3R5cGVzJztcbmV4cG9ydCAqIGZyb20gJy4vdXRpbCc7XG5leHBvcnQgKiBmcm9tICcuL2NvbnN0YW50JztcbmV4cG9ydCAqIGZyb20gJy4vc2VjcDI1NmsxJztcbmV4cG9ydCAqIGZyb20gJy4vc2VjcDI1NmsxQmlwMzJIZFRyZWUnO1xuZXhwb3J0ICogZnJvbSAnLi9lZDI1NTE5JztcbmV4cG9ydCAqIGZyb20gJy4vZWQyNTUxOUJpcDMySGRUcmVlJztcbiJdfQ==
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -35,10 +39,10 @@ if (k2 === undefined) k2 = k;

scalarRandom() {
return util_1.bigIntFromU8ABE(secp.utils.randomPrivateKey());
return (0, util_1.bigIntFromU8ABE)(secp.utils.randomPrivateKey());
}
scalarAdd(x, y) {
return util_1.bigIntFromU8ABE(secp.utils.privateAdd(x, util_1.bigIntToBufferBE(y, privateKeySize)));
return (0, util_1.bigIntFromU8ABE)(secp.utils.privateAdd(x, (0, util_1.bigIntToBufferBE)(y, privateKeySize)));
}
scalarSub(x, y) {
const negatedY = secp.utils.privateNegate(y);
return util_1.bigIntFromU8ABE(secp.utils.privateAdd(x, negatedY));
return (0, util_1.bigIntFromU8ABE)(secp.utils.privateAdd(x, negatedY));
}

@@ -52,3 +56,3 @@ scalarMult(x, y) {

scalarNegate(s) {
return util_1.bigIntFromU8ABE(secp.utils.privateNegate(s));
return (0, util_1.bigIntFromU8ABE)(secp.utils.privateNegate(s));
}

@@ -59,16 +63,16 @@ scalarInvert(s) {

pointAdd(a, b) {
const pointA = secp.Point.fromHex(util_1.bigIntToBufferBE(a, privateKeySize));
const pointB = secp.Point.fromHex(util_1.bigIntToBufferBE(b, privateKeySize));
return util_1.bigIntFromU8ABE(pointA.add(pointB).toRawBytes(true));
const pointA = secp.Point.fromHex((0, util_1.bigIntToBufferBE)(a, privateKeySize));
const pointB = secp.Point.fromHex((0, util_1.bigIntToBufferBE)(b, privateKeySize));
return (0, util_1.bigIntFromU8ABE)(pointA.add(pointB).toRawBytes(true));
}
pointMultiply(p, s) {
const pointA = secp.Point.fromHex(util_1.bigIntToBufferBE(p, privateKeySize));
return util_1.bigIntFromU8ABE(pointA.multiply(s).toRawBytes(true));
const pointA = secp.Point.fromHex((0, util_1.bigIntToBufferBE)(p, privateKeySize));
return (0, util_1.bigIntFromU8ABE)(pointA.multiply(s).toRawBytes(true));
}
basePointMult(n) {
const point = util_1.bigIntToBufferBE(n, privateKeySize);
return util_1.bigIntFromU8ABE(secp.getPublicKey(point, true));
const point = (0, util_1.bigIntToBufferBE)(n, privateKeySize);
return (0, util_1.bigIntFromU8ABE)(secp.getPublicKey(point, true));
}
verify(message, signature, publicKey) {
return Buffer.from(secp.recoverPublicKey(message, signature.subarray(1), signature[0], true)).equals(util_1.bigIntToBufferBE(publicKey, publicKeySize));
return Buffer.from(secp.recoverPublicKey(message, signature.subarray(1), signature[0], true)).equals((0, util_1.bigIntToBufferBE)(publicKey, publicKeySize));
}

@@ -80,2 +84,2 @@ order() {

exports.Secp256k1Curve = Secp256k1Curve;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VjcDI1NmsxLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2N1cnZlcy9zZWNwMjU2azEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLGtDQUE0RDtBQUU1RCx1REFBeUM7QUFFekMsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7QUFDM0IsTUFBTSxjQUFjLEdBQU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2ludCk6IGJpZ2ludCB7XG4gICAgY29uc3QgcG9pbnQgPSBiaWdJbnRUb0J1ZmZlckJFKG4sIHByaXZhdGVLZXlTaXplKTtcbiAgICByZXR1cm4gYmlnSW50RnJvbVU4QUJFKHNlY3AuZ2V0UHVibGljS2V5KHBvaW50LCB0cnVlKSk7XG4gIH1cblxuICB2ZXJpZnkobWVzc2FnZTogQnVmZmVyLCBzaWduYXR1cmU6IEJ1ZmZlciwgcHVibGljS2V5OiBiaWdpbnQpOiBib29sZWFuIHtcbiAgICByZXR1cm4gQnVmZmVyLmZyb20oc2VjcC5yZWNvdmVyUHVibGljS2V5KG1lc3NhZ2UsIHNpZ25hdHVyZS5zdWJhcnJheSgxKSwgc2lnbmF0dXJlWzBdLCB0cnVlKSkuZXF1YWxzKFxuICAgICAgYmlnSW50VG9CdWZmZXJCRShwdWJsaWNLZXksIHB1YmxpY0tleVNpemUpXG4gICAgKTtcbiAgfVxuXG4gIG9yZGVyKCk6IGJpZ2ludCB7XG4gICAgcmV0dXJuIG9yZGVyO1xuICB9XG5cbiAgc2NhbGFyQnl0ZXMgPSBwcml2YXRlS2V5U2l6ZTtcblxuICAvLyBBbHdheXMgdXNlIGNvbXByZXNzZWQgcG9pbnRzLlxuICBwb2ludEJ5dGVzID0gcHVibGljS2V5U2l6ZTtcbn1cbiJdfQ==

@@ -10,8 +10,8 @@ "use strict";

publicDerive(keychain, path) {
const indices = util_2.pathToIndices(path);
const indices = (0, util_2.pathToIndices)(path);
function deriveIndex(acc, index) {
const [pk, chaincode] = acc;
const I = deriveSecp256k1Helper(index, chaincode, pk);
const il = util_1.bigIntFromBufferBE(I.slice(0, 32));
const ir = util_1.bigIntFromBufferBE(I.slice(32));
const il = (0, util_1.bigIntFromBufferBE)(I.slice(0, 32));
const ir = (0, util_1.bigIntFromBufferBE)(I.slice(32));
const left_pk = Secp256k1Bip32HdTree.curve.pointAdd(pk, Secp256k1Bip32HdTree.curve.basePointMult(il));

@@ -24,8 +24,8 @@ return [left_pk, ir];

privateDerive(keychain, path) {
const indices = util_2.pathToIndices(path);
const indices = (0, util_2.pathToIndices)(path);
function deriveIndex(acc, index) {
const [pk, sk, chaincode] = acc;
const I = deriveSecp256k1Helper(index, chaincode, pk, sk);
const il = util_1.bigIntFromBufferBE(I.slice(0, 32));
const ir = util_1.bigIntFromBufferBE(I.slice(32));
const il = (0, util_1.bigIntFromBufferBE)(I.slice(0, 32));
const ir = (0, util_1.bigIntFromBufferBE)(I.slice(32));
const left_pk = Secp256k1Bip32HdTree.curve.pointAdd(pk, Secp256k1Bip32HdTree.curve.basePointMult(il));

@@ -44,3 +44,3 @@ const left_sk = Secp256k1Bip32HdTree.curve.scalarAdd(sk, il);

if (((index >>> 0) & 0x80000000) === 0) {
util_1.bigIntToBufferBE(pk, 33).copy(data);
(0, util_1.bigIntToBufferBE)(pk, 33).copy(data);
}

@@ -52,7 +52,7 @@ else {

data[0] = 0;
util_1.bigIntToBufferBE(sk, 32).copy(data, 1);
(0, util_1.bigIntToBufferBE)(sk, 32).copy(data, 1);
}
data.writeUInt32BE(index, 33);
return crypto_1.createHmac('sha512', util_1.bigIntToBufferBE(chaincode, 32)).update(data).digest();
return (0, crypto_1.createHmac)('sha512', (0, util_1.bigIntToBufferBE)(chaincode, 32)).update(data).digest();
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VjcDI1NmsxQmlwMzJIZFRyZWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY3VydmVzL3NlY3AyNTZrMUJpcDMySGRUcmVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1DQUFvQztBQUdwQywyQ0FBNkM7QUFDN0Msa0NBQStEO0FBQy9ELGlDQUF1QztBQUV2QyxNQUFhLG9CQUFvQjtJQUcvQixZQUFZLENBQUMsUUFBd0IsRUFBRSxJQUFZO1FBQ2pELE1BQU0sT0FBTyxHQ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ZCA9IDAsIGNoYWluY29kZTogYmlnaW50LCBwazogYmlnaW50LCBzaz86IGJpZ2ludCk6IEJ1ZmZlciB7XG4gIGNvbnN0IGRhdGEgPSBCdWZmZXIuYWxsb2MoMzMgKyA0KTtcbiAgaWYgKCgoaW5kZXggPj4+IDApICYgMHg4MDAwMDAwMCkgPT09IDApIHtcbiAgICBiaWdJbnRUb0J1ZmZlckJFKHBrLCAzMykuY29weShkYXRhKTtcbiAgfSBlbHNlIHtcbiAgICBpZiAoc2sgPT09IHVuZGVmaW5lZCkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKFwiQ2FuJ3QgcGVyZm9ybWVkIGhhcmRlbmVkIGRlcml2YXRpb24gd2l0aG91dCBwcml2YXRlIGtleVwiKTtcbiAgICB9XG4gICAgZGF0YVswXSA9IDA7XG4gICAgYmlnSW50VG9CdWZmZXJCRShzaywgMzIpLmNvcHkoZGF0YSwgMSk7XG4gIH1cbiAgZGF0YS53cml0ZVVJbnQzMkJFKGluZGV4LCAzMyk7XG4gIHJldHVybiBjcmVhdGVIbWFjKCdzaGE1MTInLCBiaWdJbnRUb0J1ZmZlckJFKGNoYWluY29kZSwgMzIpKS51cGRhdGUoZGF0YSkuZGlnZXN0KCk7XG59XG4iXX0=

@@ -13,3 +13,3 @@ "use strict";

*/
function createCommitment(secret, r = crypto_1.randomBytes(minRandomnessLength)) {
function createCommitment(secret, r = (0, crypto_1.randomBytes)(minRandomnessLength)) {
if (r.length < minRandomnessLength) {

@@ -29,6 +29,6 @@ throw new Error(`randomness must be at least ${minRandomnessLength} bytes long`);

function hash(secret, r) {
return crypto_1.createHash('sha256')
.update(util_1.bigIntToBufferBE(BigInt(secret.length), bytesPerUint32))
return (0, crypto_1.createHash)('sha256')
.update((0, util_1.bigIntToBufferBE)(BigInt(secret.length), bytesPerUint32))
.update(secret)
.update(util_1.bigIntToBufferBE(BigInt(r.length), bytesPerUint32))
.update((0, util_1.bigIntToBufferBE)(BigInt(r.length), bytesPerUint32))
.update(r)

@@ -47,2 +47,2 @@ .digest();

exports.verifyCommitment = verifyCommitment;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFzaENvbW1pdG1lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaGFzaENvbW1pdG1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbUNBQWlEO0FBRWpELGlDQUEwQztBQUUxQyxNQUFNLG1CQUFtQixHQUFHLEVBQUUsQ0FBQztBQUUvQjs7Ozs7R0FLRztBQUNILFNBQWdCLGdCQUFnQixDQUFDLE1BQWMsRUFBRSxJQUFZLG9CQUFXLENBQUMsbUJBQW1CLENBQUM7SUFDM0YsSUFBSSxDQUFDLENBQUMsTUFBTSxHQUFHLG1CQUFtQixFQUFFO1FBQ2xDLE1BQU0sSUFBSSxLQUFLLENBQUMsK0JBQStCLG1CQUFtQixhQUFhLENBQUMsQ0FBQztLQUNsRjtJQUNELE9BQU87UUFDTCxVQUFVLEVBQUUsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7UUFDM0IsWUFBWSxFQUFFO1lBQ1osY0FBYyxFQUFFLENBQUM7WUFDakIsTUFBTSxFQUFFLE1BQU07U0FDZjtLQUNGLENBQUM7QUFDSixDQUFDO0FBWEQsNENBV0M7QUFFRCxNQUFNLGNBQWMsR0FBRyxDQUFDLENBQUM7QUFFekIsU0FBUyxJQUFJLENBQUMsTUFBYyxFQUFFLENBQVM7SUFDckMsT0FBTyxtQkFBVSxDQUFDLFFBQVEsQ0FBQztTQUN4QixNQUFNLENBQUMsdUJBQWdCLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxjQUFjLENBQUMsQ0FBQztTQUMvRCxNQUFNLENBQUMsTUFBTSxDQUFDO1NBQ2QsTUFBTSxDQUFDLHVCQUFnQixDQUFDLE1BQU0sQ0FBQ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iAgICAuZGlnZXN0KCk7XG59XG5cbi8qKlxuICogVmVyaWZ5IGhhc2ggY29tbWl0bWVudCBhbmQgZGVjb21taWV0bWVudCBvZiBhIHNlY3JldCB2YWx1ZS5cbiAqIEBwYXJhbSBjb21taXRtZW50IFRoZSBjb21taXRtZW50LlxuICogQHBhcmFtIGRlY29tbWlldG1lbnQgVGhlIGRlY29tbWl0bWVudC5cbiAqIEByZXR1cm5zIFRydWUgaWYgdmVyaWZpY2F0aW9uIHN1Y2NlZWRzLlxuICovXG5leHBvcnQgZnVuY3Rpb24gdmVyaWZ5Q29tbWl0bWVudChjb21taXRtZW50OiBCdWZmZXIsIGRlY29tbWlldG1lbnQ6IEhhc2hEZWNvbW1pdG1lbnQpOiBib29sZWFuIHtcbiAgcmV0dXJuIGhhc2goZGVjb21taWV0bWVudC5zZWNyZXQsIGRlY29tbWlldG1lbnQuYmxpbmRpbmdGYWN0b3IpLmNvbXBhcmUoY29tbWl0bWVudCkgPT09IDA7XG59XG4iXX0=
export * from './curves';
export * from './openssl';
export * from './safePrime';
export * from './shamir';

@@ -4,0 +4,0 @@ export * from './tss';

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -27,3 +31,3 @@ if (k2 === undefined) k2 = k;

__exportStar(require("./curves"), exports);
__exportStar(require("./openssl"), exports);
__exportStar(require("./safePrime"), exports);
__exportStar(require("./shamir"), exports);

@@ -35,2 +39,2 @@ __exportStar(require("./tss"), exports);

__exportStar(require("./util"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3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nLi9zYWZlUHJpbWUnO1xuZXhwb3J0ICogZnJvbSAnLi9zaGFtaXInO1xuZXhwb3J0ICogZnJvbSAnLi90c3MnO1xuXG5leHBvcnQgKiBhcyBIYXNoQ29tbWl0bWVudCBmcm9tICcuL2hhc2hDb21taXRtZW50JztcbmV4cG9ydCAqIGFzIFNjaG5vcnIgZnJvbSAnLi9zY2hub3JyUHJvb2YnO1xuZXhwb3J0ICogZnJvbSAnLi90eXBlcyc7XG5leHBvcnQgKiBmcm9tICcuL3V0aWwnO1xuIl19

@@ -40,8 +40,8 @@ "use strict";

const G = curve.basePointMult(BigInt(1));
const hash = crypto_1.createHash('sha256');
hash.update(util_1.bigIntToBufferBE(G, 32));
hash.update(util_1.bigIntToBufferBE(V, 32));
hash.update(util_1.bigIntToBufferBE(A, 32));
const hash = (0, crypto_1.createHash)('sha256');
hash.update((0, util_1.bigIntToBufferBE)(G, 32));
hash.update((0, util_1.bigIntToBufferBE)(V, 32));
hash.update((0, util_1.bigIntToBufferBE)(A, 32));
hash.update(additionalCtx);
return util_1.bigIntFromBufferBE(hash.digest());
return (0, util_1.bigIntFromBufferBE)(hash.digest());
}

@@ -63,2 +63,2 @@ /**

exports.verifySchnorrProof = verifySchnorrProof;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Nobm9yclByb29mLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NjaG5vcnJQcm9vZi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQTs7O0dBR0c7QUFDSCxtQ0FBb0M7QUFHcEMsaUNBQThEO0FBRTlEOzs7Ozs7O0dBT0c7QUFDSCxTQUFnQixrQkFBa0IsQ0FDaEMsQ0FBUyxFQUNULENBQVMsRUFDVCxLQUFZLEVBQ1osZ0JBQXdCLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDO0lBRXZDLE1BQU0sQ0FBQyx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5vbkludGVyYWN0aXZlQ2hhbGxlbmdlKHByb29mLnZQb2ludCwgQSwgY3VydmUsIGFkZGl0aW9uYWxDdHgpO1xuXG4gIGNvbnN0IHJHID0gY3VydmUuYmFzZVBvaW50TXVsdChwcm9vZi5yKTtcblxuICBjb25zdCBjQSA9IGN1cnZlLnBvaW50TXVsdGlwbHkoQSwgY3VydmUuc2NhbGFyUmVkdWNlKGMpKTtcblxuICByZXR1cm4gcHJvb2YudlBvaW50ID09PSBjdXJ2ZS5wb2ludEFkZChyRywgY0EpO1xufVxuIl19
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -15,2 +19,2 @@ if (k2 === undefined) k2 = k;

__exportStar(require("./shamir"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2hhbWlyL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUFBLDBDQUF3QjtBQUN4QiwyQ0FBeUIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3R5cGVzJztcbmV4cG9ydCAqIGZyb20gJy4vc2hhbWlyJztcbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2hhbWlyL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwwQ0FBd0I7QUFDeEIsMkNBQXlCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi90eXBlcyc7XG5leHBvcnQgKiBmcm9tICcuL3NoYW1pcic7XG4iXX0=

@@ -51,3 +51,3 @@ "use strict";

for (let ind = 0; ind < threshold - 1; ind++) {
const coeff = util_1.clamp(util_1.bigIntFromBufferLE(crypto_1.default.createHmac('sha256', ind.toString(10)).update(util_1.bigIntToBufferLE(secret, 32)).digest()));
const coeff = (0, util_1.clamp)((0, util_1.bigIntFromBufferLE)(crypto_1.default.createHmac('sha256', ind.toString(10)).update((0, util_1.bigIntToBufferLE)(secret, 32)).digest()));
coefs.push(coeff);

@@ -137,2 +137,2 @@ v.unshift(this.curve.basePointMult(coeff));

exports.Shamir = Shamir;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhbWlyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NoYW1pci9zaGFtaXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsb0RBQTRCO0FBRzVCLGtDQUFzRTtBQUV0RSxNQUFhLE1BQU07SUFHakIsWUFBWSxLQUFnQjtRQUMxQixJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztJQUNyQixDQUFDO0lBRUQ7Ozs7Ozs7Ozs7OztPQVlHO0lBQ0gsS0FBSyxDQUFDLE1BQWMsRUFBRSxTQUFpQixFQUFFLFNBQWlCLEVBQUUsT0FBdUIsRUFBRSxJQUFJLEdBQUcsTUFBTSxDQUFDLENBQUMsQ0FBQztRQUNuRyxJQUFJLFVBQXlCLENBQUM7UUFDOUIsSUFBSSxPQUFPLEVBQUU7WUFDWCxVQUFVLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQ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ICB9XG4gICAgICAgIGNvbnN0IGludmVydGVkID0gdGhpcy5jdXJ2ZS5zY2FsYXJJbnZlcnQoZGVudW0pO1xuICAgICAgICBjb25zdCBpbm5lck11bHRpcGxpZWQgPSB0aGlzLmN1cnZlLnNjYWxhck11bHQobnVtLCBpbnZlcnRlZCk7XG4gICAgICAgIGNvbnN0IG11bHRpcGxpZWQgPSB0aGlzLmN1cnZlLnNjYWxhck11bHQoaW5uZXJNdWx0aXBsaWVkLCB5aSk7XG4gICAgICAgIHMgPSB0aGlzLmN1cnZlLnNjYWxhckFkZChtdWx0aXBsaWVkLCBzKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBzO1xuICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZhaWxlZCB0byBjb21iaW5lIFNoYW1pciBzaGFyZXMgLCAnICsgZXJyb3IpO1xuICAgIH1cbiAgfVxufVxuIl19
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -212,2 +216,2 @@ if (k2 === undefined) k2 = k;

exports.encryptAndAuthOutgoingMessages = encryptAndAuthOutgoingMessages;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbXNMYXllci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy90c3MvZWNkc2EtZGtscy9jb21tc0xheWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFDQSw2Q0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kgPSBwcnZBdXRoZW50aWNhdGlvbkdwZ0tleXMuZmluZCgoaykgPT4gay5wYXJ0eUlkID09PSBtLmZyb20pO1xuICAgICAgICBpZiAoIXBydkdwZ0tleSkge1xuICAgICAgICAgIHRocm93IEVycm9yKGBObyBwcml2YXRlIGtleSBwcm92aWRlZCBmb3Igc2VuZGVyIHdpdGggSUQ6ICR7bS5mcm9tfWApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgZnJvbTogbS5mcm9tLFxuICAgICAgICAgIHBheWxvYWQ6IGF3YWl0IGRldGFjaFNpZ25EYXRhKEJ1ZmZlci5mcm9tKG0ucGF5bG9hZCwgJ2Jhc2U2NCcpLCBwcnZHcGdLZXkuZ3BnS2V5KSxcbiAgICAgICAgfTtcbiAgICAgIH0pXG4gICAgKSxcbiAgfTtcbn1cbiJdfQ==

@@ -24,3 +24,3 @@ "use strict";

}
const round = cbor_1.decode(this.dkgSession.toBytes()).round;
const round = (0, cbor_1.decode)(this.dkgSession.toBytes()).round;
switch (round) {

@@ -154,2 +154,2 @@ case 'WaitMsg1':

exports.Dkg = Dkg;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGtnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3Rzcy9lY2RzYS1ka2xzL2RrZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw4RUFBMEY7QUFDMUYsbUNBQXVGO0FBQ3ZGLCtCQUE4QjtBQUU5QixNQUFhLEdBQUc7SUFVZCxZQUFZLENBQVMsRUFBRSxDQUFTLEVBQUUsUUFBZ0I7UUFGeEMsYUFBUSxHQUFhLGdCQUFRLENBQUMsYUFBYSxDQUFDO1FBR3BELElBQUksQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ1gsSUFBSSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQ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kZXNlcmlhbGl6ZVN0YXRlKCk7XG4gICAgICB9XG4gICAgICBpZiAodGhpcy5ka2dTdGF0ZSA9PSBEa2dTdGF0ZS5Sb3VuZDIpIHtcbiAgICAgICAgdGhpcy5jaGFpbkNvZGVDb21taXRtZW50ID0gdGhpcy5ka2dTZXNzaW9uLmNhbGN1bGF0ZUNoYWluQ29kZUNvbW1pdG1lbnQoKTtcbiAgICAgIH1cbiAgICAgIG5leHRSb3VuZERlc2VyaWFsaXplZE1lc3NhZ2VzID0ge1xuICAgICAgICBwMnBNZXNzYWdlczogbmV4dFJvdW5kTWVzc2FnZXNcbiAgICAgICAgICAuZmlsdGVyKChtKSA9PiBtLnRvX2lkICE9PSB1bmRlZmluZWQpXG4gICAgICAgICAgLm1hcCgobSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgcDJwUmV0dXJuID0ge1xuICAgICAgICAgICAgICBwYXlsb2FkOiBtLnBheWxvYWQsXG4gICAgICAgICAgICAgIGZyb206IG0uZnJvbV9pZCxcbiAgICAgICAgICAgICAgdG86IG0udG9faWQhLFxuICAgICAgICAgICAgICBjb21taXRtZW50OiB0aGlzLmNoYWluQ29kZUNvbW1pdG1lbnQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmV0dXJuIHAycFJldHVybjtcbiAgICAgICAgICB9KSxcbiAgICAgICAgYnJvYWRjYXN0TWVzc2FnZXM6IG5leHRSb3VuZE1lc3NhZ2VzXG4gICAgICAgICAgLmZpbHRlcigobSkgPT4gbS50b19pZCA9PT0gdW5kZWZpbmVkKVxuICAgICAgICAgIC5tYXAoKG0pID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGJyb2FkY2FzdFJldHVybiA9IHtcbiAgICAgICAgICAgICAgcGF5bG9hZDogbS5wYXlsb2FkLFxuICAgICAgICAgICAgICBmcm9tOiBtLmZyb21faWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmV0dXJuIGJyb2FkY2FzdFJldHVybjtcbiAgICAgICAgICB9KSxcbiAgICAgIH07XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgdGhyb3cgYEVycm9yIHdoaWxlIGNyZWF0aW5nIG1lc3NhZ2VzIGZyb20gcGFydHkgJHt0aGlzLnBhcnR5SWR4fSwgcm91bmQgJHt0aGlzLmRrZ1N0YXRlfTogJHtlfWA7XG4gICAgfSBmaW5hbGx5IHtcbiAgICAgIG5leHRSb3VuZE1lc3NhZ2VzLmZvckVhY2goKG0pID0+IG0uZnJlZSgpKTtcbiAgICAgIC8vIFNlc3Npb24gaXMgZnJlZWQgd2hlbiBrZXlzaGFyZSBpcyBjYWxsZWQuXG4gICAgICBpZiAodGhpcy5ka2dTdGF0ZSAhPT0gRGtnU3RhdGUuQ29tcGxldGUpIHtcbiAgICAgICAgdGhpcy5ka2dTZXNzaW9uQnl0ZXMgPSB0aGlzLmRrZ1Nlc3Npb24udG9CeXRlcygpO1xuICAgICAgICB0aGlzLmRrZ1Nlc3Npb24gPSB1bmRlZmluZWQ7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBuZXh0Um91bmREZXNlcmlhbGl6ZWRNZXNzYWdlcztcbiAgfVxufVxuIl19

@@ -27,3 +27,3 @@ "use strict";

}
const round = cbor_1.decode(this.dsgSession.toBytes()).round;
const round = (0, cbor_1.decode)(this.dsgSession.toBytes()).round;
switch (round) {

@@ -170,2 +170,2 @@ case 'WaitMsg1':

exports.Dsg = Dsg;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHNnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3Rzcy9lY2RzYS1ka2xzL2RzZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw4RUFBd0Y7QUFDeEYsbUNBQXNHO0FBQ3RHLCtCQUE4QjtBQUU5QixNQUFhLEdBQUc7SUFVZCxZQUFZLFFBQWdCLEVBQUUsUUFB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sXG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBVcGRhdGUgcm91bmQgZGF0YS5cbiAgICAgICAgdGhpcy5fZGVzZXJpYWxpemVTdGF0ZSgpO1xuICAgICAgfVxuICAgICAgbmV4dFJvdW5kRGVzZXJpYWxpemVkTWVzc2FnZXMgPSB7XG4gICAgICAgIHAycE1lc3NhZ2VzOiBuZXh0Um91bmRNZXNzYWdlc1xuICAgICAgICAgIC5maWx0ZXIoKG0pID0+IG0udG9faWQgIT09IHVuZGVmaW5lZClcbiAgICAgICAgICAubWFwKChtKSA9PiB7XG4gICAgICAgICAgICBpZiAobS50b19pZCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIHRocm93IEVycm9yKCdJbnZhbGlkIFAyUCBtZXNzYWdlLCBtaXNzaW5nIHRvX2lkLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29uc3QgcDJwUmV0dXJuID0ge1xuICAgICAgICAgICAgICBwYXlsb2FkOiBtLnBheWxvYWQsXG4gICAgICAgICAgICAgIGZyb206IG0uZnJvbV9pZCxcbiAgICAgICAgICAgICAgdG86IG0udG9faWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmV0dXJuIHAycFJldHVybjtcbiAgICAgICAgICB9KSxcbiAgICAgICAgYnJvYWRjYXN0TWVzc2FnZXM6IG5leHRSb3VuZE1lc3NhZ2VzXG4gICAgICAgICAgLmZpbHRlcigobSkgPT4gbS50b19pZCA9PT0gdW5kZWZpbmVkKVxuICAgICAgICAgIC5tYXAoKG0pID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGJyb2FkY2FzdFJldHVybiA9IHtcbiAgICAgICAgICAgICAgcGF5bG9hZDogbS5wYXlsb2FkLFxuICAgICAgICAgICAgICBmcm9tOiBtLmZyb21faWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmV0dXJuIGJyb2FkY2FzdFJldHVybjtcbiAgICAgICAgICB9KSxc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k7XG4gICAgICB9XG4gICAgICBuZXh0Um91bmREZXNlcmlhbGl6ZWRNZXNzYWdlcyA9IHtcbiAgICAgICAgcDJwTWVzc2FnZXM6IG5leHRSb3VuZE1lc3NhZ2VzXG4gICAgICAgICAgLmZpbHRlcigobSkgPT4gbS50b19pZCAhPT0gdW5kZWZpbmVkKVxuICAgICAgICAgIC5tYXAoKG0pID0+IHtcbiAgICAgICAgICAgIGlmIChtLnRvX2lkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgdGhyb3cgRXJyb3IoJ0ludmFsaWQgUDJQIG1lc3NhZ2UsIG1pc3NpbmcgdG9faWQuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25zdCBwMnBSZXR1cm4gPSB7XG4gICAgICAgICAgICAgIHBheWxvYWQ6IG0ucGF5bG9hZCxcbiAgICAgICAgICAgICAgZnJvbTogbS5mcm9tX2lkLFxuICAgICAgICAgICAgICB0bzogbS50b19pZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXR1cm4gcDJwUmV0dXJuO1xuICAgICAgICAgIH0pLFxuICAgICAgICBicm9hZGNhc3RNZXNzYWdlczogbmV4dFJvdW5kTWVzc2FnZXNcbiAgICAgICAgICAuZmlsdGVyKChtKSA9PiBtLnRvX2lkID09PSB1bmRlZmluZWQpXG4gICAgICAgICAgLm1hcCgobSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgYnJvYWRjYXN0UmV0dXJuID0ge1xuICAgICAgICAgICAgICBwYXlsb2FkOiBtLnBheWxvYWQsXG4gICAgICAgICAgICAgIGZyb206IG0uZnJvbV9pZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXR1cm4gYnJvYWRjYXN0UmV0dXJuO1xuICAgICAgICAgIH0pLFxuICAgICAgfTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICB0aHJvdyBgRXJyb3Igd2hpbGUgY3JlYXRpbmcgbWVzc2FnZXMgZnJvbSBwYXJ0eSAke3RoaXMucGFydHlJZHh9LCByb3VuZCAke3RoaXMuZHNnU3RhdGV9OiAke2V9YDtcbiAgICB9IGZpbmFsbHkge1xuICAgICAgbmV4dFJvdW5kTWVzc2FnZXMuZm9yRWFjaCgobSkgPT4gbS5mcmVlKCkpO1xuICAgICAgLy8gU2Vzc2lvbiBpcyBmcmVlZCB3aGVuIGNvbWJpbmUgaXMgY2FsbGVkLlxuICAgICAgaWYgKHRoaXMuZHNnU3RhdGUgIT09IERzZ1N0YXRlLkNvbXBsZXRlKSB7XG4gICAgICAgIHRoaXMuZHNnU2Vzc2lvbkJ5dGVzID0gdGhpcy5kc2dTZXNzaW9uLnRvQnl0ZXMoKTtcbiAgICAgICAgdGhpcy5kc2dTZXNzaW9uID0gdW5kZWZpbmVkO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gbmV4dFJvdW5kRGVzZXJpYWxpemVkTWVzc2FnZXM7XG4gIH1cbn1cbiJdfQ==
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -26,2 +30,2 @@ if (k2 === undefined) k2 = k;

exports.DklsTypes = __importStar(require("./types"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdHNzL2VjZHNhLWRrbHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLGlEQUFpQztBQUNqQyxpREFBaUM7QUFDakMscURBQXFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogYXMgRGtsc0RrZyBmcm9tICcuL2RrZyc7XG5leHBvcnQgKiBhcyBEa2xzRHNnIGZyb20gJy4vZHNnJztcbmV4cG9ydCAqIGFzIERrbHNUeXBlcyBmcm9tICcuL3R5cGVzJztcbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdHNzL2VjZHNhLWRrbHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxpREFBaUM7QUFDakMsaURBQWlDO0FBQ2pDLHFEQUFxQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGFzIERrbHNEa2cgZnJvbSAnLi9ka2cnO1xuZXhwb3J0ICogYXMgRGtsc0RzZyBmcm9tICcuL2RzZyc7XG5leHBvcnQgKiBhcyBEa2xzVHlwZXMgZnJvbSAnLi90eXBlcyc7XG4iXX0=
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -28,2 +32,2 @@ if (k2 === undefined) k2 = k;

exports.minModulusBitLength = 3072;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdHNzL2VjZHNhL2luZG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GZyb20gJy4vcGFpbGxpZXJwcm9vZic7XG5leHBvcnQgKiBhcyBFY2RzYVprVlByb29mIGZyb20gJy4vemtWUHJvb2YnO1xuXG5leHBvcnQgY29uc3QgbWluTW9kdWx1c0JpdExlbmd0aCA9IDMwNzI7XG4iXX0=

@@ -21,3 +21,3 @@ "use strict";

async function generateP(n) {
if (bigint_crypto_utils_1.bitLength(n) < index_1.minModulusBitLength) {
if ((0, bigint_crypto_utils_1.bitLength)(n) < index_1.minModulusBitLength) {
throw new Error(`modulus n must have a bit length larger than or equal to ${index_1.minModulusBitLength}`);

@@ -27,3 +27,3 @@ }

.fill(null)
.map(() => util_1.randomPositiveCoPrimeLessThan(n)));
.map(() => (0, util_1.randomPositiveCoPrimeLessThan)(n)));
}

@@ -42,4 +42,4 @@ exports.generateP = generateP;

}
const n_inv = bigint_mod_arith_1.modInv(n, lambda);
return p.map((p_i) => bigint_mod_arith_1.modPow(p_i, n_inv, n));
const n_inv = (0, bigint_mod_arith_1.modInv)(n, lambda);
return p.map((p_i) => (0, bigint_mod_arith_1.modPow)(p_i, n_inv, n));
}

@@ -82,3 +82,3 @@ exports.prove = prove;

for (let i = 0; i < exports.m; i++) {
if (p[i] !== bigint_mod_arith_1.modPow(sigma[i], n, n)) {
if (p[i] !== (0, bigint_mod_arith_1.modPow)(sigma[i], n, n)) {
return false;

@@ -90,2 +90,2 @@ }

exports.verify = verify;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFpbGxpZXJwcm9vZi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy90c3MvZWNkc2EvcGFpbGxpZXJwcm9vZi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2REFBZ0Q7QUFDaEQsdURBQWtEO0FBRWxELHFDQUEyRDtBQUMzRCxtQ0FBOEM7QUFDOUMscUNBQW1EO0FBRW5ELHVCQUF1Qj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W9kUG93KHNpZ21hW2ldLCBuLCBuKSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ==
import { BaseCurve } from '../../curves';
import { PublicKey } from 'paillier-bigint';
import { DeserializedNtilde, DeserializedNtildeProof, RangeProof, RangeProofWithCheck, DeserializedNtildeWithProofs } from './types';
export declare function generateSafePrimes(bitLengths: number[]): Promise<bigint[]>;
/**

@@ -6,0 +5,0 @@ * Generate "challenge" values for range proofs.

@@ -12,5 +12,5 @@ "use strict";

return {
ntilde: util_1.hexToBigInt(challenge.ntilde),
h1: util_1.hexToBigInt(challenge.h1),
h2: util_1.hexToBigInt(challenge.h2),
ntilde: (0, util_1.hexToBigInt)(challenge.ntilde),
h1: (0, util_1.hexToBigInt)(challenge.h1),
h2: (0, util_1.hexToBigInt)(challenge.h2),
};

@@ -25,5 +25,5 @@ }

return {
ntilde: util_1.bigIntToHex(challenge.ntilde),
h1: util_1.bigIntToHex(challenge.h1),
h2: util_1.bigIntToHex(challenge.h2),
ntilde: (0, util_1.bigIntToHex)(challenge.ntilde),
h1: (0, util_1.bigIntToHex)(challenge.h1),
h2: (0, util_1.bigIntToHex)(challenge.h2),
};

@@ -41,8 +41,8 @@ }

h1WrtH2: {
alpha: util_1.convertHexArrToBigIntArr(challenge.ntildeProof.h1WrtH2.alpha),
t: util_1.convertHexArrToBigIntArr(challenge.ntildeProof.h1WrtH2.t),
alpha: (0, util_1.convertHexArrToBigIntArr)(challenge.ntildeProof.h1WrtH2.alpha),
t: (0, util_1.convertHexArrToBigIntArr)(challenge.ntildeProof.h1WrtH2.t),
},
h2WrtH1: {
alpha: util_1.convertHexArrToBigIntArr(challenge.ntildeProof.h2WrtH1.alpha),
t: util_1.convertHexArrToBigIntArr(challenge.ntildeProof.h2WrtH1.t),
alpha: (0, util_1.convertHexArrToBigIntArr)(challenge.ntildeProof.h2WrtH1.alpha),
t: (0, util_1.convertHexArrToBigIntArr)(challenge.ntildeProof.h2WrtH1.t),
},

@@ -62,8 +62,8 @@ },

h1WrtH2: {
alpha: util_1.convertBigIntArrToHexArr(challenge.ntildeProof.h1WrtH2.alpha),
t: util_1.convertBigIntArrToHexArr(challenge.ntildeProof.h1WrtH2.t),
alpha: (0, util_1.convertBigIntArrToHexArr)(challenge.ntildeProof.h1WrtH2.alpha),
t: (0, util_1.convertBigIntArrToHexArr)(challenge.ntildeProof.h1WrtH2.t),
},
h2WrtH1: {
alpha: util_1.convertBigIntArrToHexArr(challenge.ntildeProof.h2WrtH1.alpha),
t: util_1.convertBigIntArrToHexArr(challenge.ntildeProof.h2WrtH1.t),
alpha: (0, util_1.convertBigIntArrToHexArr)(challenge.ntildeProof.h2WrtH1.alpha),
t: (0, util_1.convertBigIntArrToHexArr)(challenge.ntildeProof.h2WrtH1.t),
},

@@ -80,3 +80,3 @@ },

return {
p: util_1.convertHexArrToBigIntArr(challenge.p),
p: (0, util_1.convertHexArrToBigIntArr)(challenge.p),
};

@@ -91,3 +91,3 @@ }

return {
sigma: util_1.convertHexArrToBigIntArr(challenge.sigma),
sigma: (0, util_1.convertHexArrToBigIntArr)(challenge.sigma),
};

@@ -113,3 +113,3 @@ }

return {
p: util_1.convertBigIntArrToHexArr(challenge.p, 768),
p: (0, util_1.convertBigIntArrToHexArr)(challenge.p, 768),
};

@@ -124,3 +124,3 @@ }

return {
sigma: util_1.convertBigIntArrToHexArr(challenge.sigma, 768),
sigma: (0, util_1.convertBigIntArrToHexArr)(challenge.sigma, 768),
};

@@ -140,2 +140,2 @@ }

exports.serializePaillierChallengeWithProofs = serializePaillierChallengeWithProofs;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdHNzL2VjZHNhL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFB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ZXhwb3J0IGludGVyZmFjZSBSU0FNb2R1bHVzIHtcbiAgbjogYmlnaW50O1xuICAvLyBTb3BoaWUgR2VybWFpbiBwcmltZXMuXG4gIHExOiBiaWdpbnQ7XG4gIHEyOiBiaWdpbnQ7XG59XG5cbi8vIFJhbmdlIHByb29mIHZhbHVlc1xuZXhwb3J0IGludGVyZmFjZSBSYW5nZVByb29mIHtcbiAgejogYmlnaW50O1xuICB1OiBiaWdpbnQ7XG4gIHc6IGJpZ2ludDtcbiAgczogYmlnaW50O1xuICBzMTogYmlnaW50O1xuICBzMjogYmlnaW50O1xufVxuXG4vLyBSYW5nZSBwcm9vZiB2YWx1ZXNcbmV4cG9ydCBpbnRlcmZhY2UgUmFuZ2VQcm9vZldpdGhDaGVjayB7XG4gIHo6IGJpZ2ludDtcbiAgenBybTogYmlnaW50O1xuICB0OiBiaWdpbnQ7XG4gIHY6IGJpZ2ludDtcbiAgdzogYmlnaW50O1xuICBzOiBiaWdpbnQ7XG4gIHMxOiBiaWdpbnQ7XG4gIHMyOiBiaWdpbnQ7XG4gIHQxOiBiaWdpbnQ7XG4gIHQyOiBiaWdpbnQ7XG4gIHU6IGJpZ2ludDtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBaa1ZQcm9vZiB7XG4gIEFscGhhOiBiaWdpbnQ7XG4gIHQ6IGJpZ2ludDtcbiAgdTogYmlnaW50O1xufVxuIl19

@@ -47,9 +47,9 @@ "use strict";

const G = curve.basePointMult(BigInt(1));
const hash = crypto_1.createHash('sha256');
hash.update(util_1.bigIntToBufferBE(G, curve.pointBytes));
hash.update(util_1.bigIntToBufferBE(R, curve.pointBytes));
hash.update(util_1.bigIntToBufferBE(V, curve.pointBytes));
hash.update(util_1.bigIntToBufferBE(Alpha, curve.pointBytes));
const hash = (0, crypto_1.createHash)('sha256');
hash.update((0, util_1.bigIntToBufferBE)(G, curve.pointBytes));
hash.update((0, util_1.bigIntToBufferBE)(R, curve.pointBytes));
hash.update((0, util_1.bigIntToBufferBE)(V, curve.pointBytes));
hash.update((0, util_1.bigIntToBufferBE)(Alpha, curve.pointBytes));
hash.update(additionalCtx);
return util_1.bigIntFromBufferBE(hash.digest());
return (0, util_1.bigIntFromBufferBE)(hash.digest());
}

@@ -72,2 +72,2 @@ /**

exports.verifyZkVProof = verifyZkVProof;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiemtWUHJvb2YuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdHNzL2VjZHNhL3prVlByb29mLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7O0dBSUc7QUFDSCxtQ0FBb0M7QUFHcEMscUNBQWtFO0FBRWxFOzs7Ozs7Ozs7R0FTRztBQUNILFNBQWdCLGNBQWMsQ0FDNUIsQ0FBUyxFQUNULENBQVMsRUFDVCxDQUFTLEVBQ1QsQ0FBUyxFQUNULEtBQVksRUFDWixnQkFBd0IsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUM7SUFFdkMsTUFBTSxDQUFDLEdBQUcsS0FBSyxDQUFDLFlBQVksRUFBRSxDQUFDO0lBQy9CLE1BQU0sQ0FBQyxHQUFHLEtBQUssQ0FBQyxZQUFZLEVBQUUsQ0FBQztJQUMvQixNQUFNLEtBQUssR0FBRyxLQUFLLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxhQUFhLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEtBQUssQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUVoRixNQUFNLENBQUMsR0FBRyx1QkFBdUIsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUUsYUFBYSxDQUFDLENBQUM7SUFFckUsTUFBTSxDQUFDLEdBQUcsS0FBSyxDQUFDLFNBQVMsQ0FBQyxDQUFDLE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BvaW50QWRkKHByb29mLkFscGhhLCBjdXJ2ZS5wb2ludE11bHRpcGx5KFYsIGN1cnZlLnNjYWxhclJlZHVjZShjKSkpO1xuXG4gIHJldHVybiBsaHMgPT09IHJocztcbn1cbiJdfQ==
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -15,2 +19,2 @@ if (k2 === undefined) k2 = k;

__exportStar(require("./ecdsa-dkls"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdHNzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUFBLDBDQUF3QjtBQUN4QiwrQ0FBNkIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2VjZHNhJztcbmV4cG9ydCAqIGZyb20gJy4vZWNkc2EtZGtscyc7XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdHNzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwwQ0FBd0I7QUFDeEIsK0NBQTZCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9lY2RzYSc7XG5leHBvcnQgKiBmcm9tICcuL2VjZHNhLWRrbHMnO1xuIl19

@@ -114,4 +114,4 @@ "use strict";

while (true) {
const y = await randomBigInt(bigint_crypto_utils_1.bitLength(x));
if (y > BigInt(0) && bigint_mod_arith_1.gcd(x, y) === BigInt(1)) {
const y = await randomBigInt((0, bigint_crypto_utils_1.bitLength)(x));
if (y > BigInt(0) && (0, bigint_mod_arith_1.gcd)(x, y) === BigInt(1)) {
return y;

@@ -132,4 +132,4 @@ }

while (true) {
const y = await randomBigInt(bigint_crypto_utils_1.bitLength(x));
if (y > BigInt(0) && y < x && bigint_mod_arith_1.gcd(x, y) === BigInt(1)) {
const y = await randomBigInt((0, bigint_crypto_utils_1.bitLength)(x));
if (y > BigInt(0) && y < x && (0, bigint_mod_arith_1.gcd)(x, y) === BigInt(1)) {
return y;

@@ -146,3 +146,3 @@ }

async function randomBigInt(bitlength) {
return bigIntFromBufferBE(Buffer.from(await bigint_crypto_utils_1.randBits(bitlength, true)));
return bigIntFromBufferBE(Buffer.from(await (0, bigint_crypto_utils_1.randBits)(bitlength, true)));
}

@@ -168,2 +168,2 @@ exports.randomBigInt = randomBigInt;

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLHFEQUE0QztBQUM1Qyw2REFBMEQ7QUFDMUQsdURBQXVDO0FBQ3ZDLG9EQUE0QjtBQUU1Qjs7O0dBR0c7QUFDSCxTQUFnQix3QkFBd0IsQ0FBQyxNQUFnQjtJQUN2RCxPQUFPLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxLQUFLLEVBQUUsRUFBRTtRQUMxQixPQUFPLFdBQVcsQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUM1QixDQUFDLENBQUMsQ0FBQztBQUNMLENBQUM7QUFKRCw0REFJQ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yaXZhdGlvblBhdGhJbnB1dCA9IHNoYTI1NihzaGEyNTYoYCR7c2VlZH1gKSkudG9TdHJpbmcoJ2hleCcpO1xuICBjb25zdCBkZXJpdmF0aW9uUGF0aFBhcnRzID0gW1xuICAgIHBhcnNlSW50KGRlcml2YXRpb25QYXRoSW5wdXQuc2xpY2UoMCwgNyksIDE2KSxcbiAgICBwYXJzZUludChkZXJpdmF0aW9uUGF0aElucHV0LnNsaWNlKDcsIDE0KSwgMTYpLFxuICBdO1xuICBjb25zdCBwcmVmaXggPSBpc01hc3RlciA/ICdtLycgOiAnJztcbiAgcmV0dXJuIHByZWZpeCArICc5OTk5OTkvJyArIGRlcml2YXRpb25QYXRoUGFydHMuam9pbignLycpO1xufVxuXG5mdW5jdGlvbiBzaGEyNTYoaW5wdXQ6IGNyeXB0by5CaW5hcnlMaWtlKTogQnVmZmVyIHtcbiAgcmV0dXJuIGNyeXB0by5jcmVhdGVIYXNoKCdzaGEyNTYnKS51cGRhdGUoaW5wdXQpLmRpZ2VzdCgpO1xufVxuIl19
{
"name": "@bitgo/sdk-lib-mpc",
"version": "9.1.1",
"version": "9.2.0",
"description": "library functions for BitGo's MPC solution",

@@ -43,3 +43,2 @@ "main": "./dist/src/index.js",

"@types/superagent": "4.1.15",
"@wasmer/wasi": "^1.2.2",
"bigint-crypto-utils": "3.1.4",

@@ -58,3 +57,3 @@ "bigint-mod-arith": "3.1.2",

},
"gitHead": "b4fdea76c96ed3475899aec21477a6dfb5b7db0e"
"gitHead": "836681179c597c51a4f60f4f8a5a684eebd49f98"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc