@bitgo/sdk-core 8.5.0 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/src/account-lib/mpc/curves/baseCurve.d.ts +2 -17
- package/dist/src/account-lib/mpc/curves/baseCurve.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/curves/baseCurve.js +1 -4
- package/dist/src/account-lib/mpc/curves/secp256k1.d.ts +4 -16
- package/dist/src/account-lib/mpc/curves/secp256k1.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/curves/secp256k1.js +6 -67
- package/dist/src/account-lib/mpc/hdTree.d.ts +2 -1
- package/dist/src/account-lib/mpc/hdTree.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/hdTree.js +3 -2
- package/dist/src/account-lib/mpc/tss/ecdsa/ecdsa.d.ts +38 -12
- package/dist/src/account-lib/mpc/tss/ecdsa/ecdsa.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/tss/ecdsa/ecdsa.js +571 -179
- package/dist/src/account-lib/mpc/tss/ecdsa/rangeproof.d.ts +6 -90
- package/dist/src/account-lib/mpc/tss/ecdsa/rangeproof.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/tss/ecdsa/rangeproof.js +6 -417
- package/dist/src/account-lib/mpc/tss/ecdsa/types.d.ts +92 -155
- package/dist/src/account-lib/mpc/tss/ecdsa/types.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/tss/ecdsa/types.js +1 -1
- package/dist/src/account-lib/mpc/tss/eddsa/eddsa.d.ts +1 -0
- package/dist/src/account-lib/mpc/tss/eddsa/eddsa.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/tss/eddsa/eddsa.js +16 -1
- package/dist/src/account-lib/mpc/tss/eddsa/types.d.ts +4 -0
- package/dist/src/account-lib/mpc/tss/eddsa/types.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/tss/eddsa/types.js +1 -1
- package/dist/src/account-lib/mpc/util.d.ts +3 -30
- package/dist/src/account-lib/mpc/util.d.ts.map +1 -1
- package/dist/src/account-lib/mpc/util.js +10 -68
- package/dist/src/account-lib/util/crypto.d.ts +5 -25
- package/dist/src/account-lib/util/crypto.d.ts.map +1 -1
- package/dist/src/account-lib/util/crypto.js +10 -55
- package/dist/src/bitgo/enterprise/enterprise.d.ts +3 -3
- package/dist/src/bitgo/enterprise/enterprise.d.ts.map +1 -1
- package/dist/src/bitgo/enterprise/enterprise.js +7 -6
- package/dist/src/bitgo/enterprise/iEnterprise.d.ts +3 -3
- package/dist/src/bitgo/enterprise/iEnterprise.d.ts.map +1 -1
- package/dist/src/bitgo/enterprise/iEnterprise.js +1 -1
- package/dist/src/bitgo/environments.d.ts +2 -0
- package/dist/src/bitgo/environments.d.ts.map +1 -1
- package/dist/src/bitgo/environments.js +7 -3
- package/dist/src/bitgo/pendingApproval/iPendingApproval.d.ts +1 -0
- package/dist/src/bitgo/pendingApproval/iPendingApproval.d.ts.map +1 -1
- package/dist/src/bitgo/pendingApproval/iPendingApproval.js +1 -1
- package/dist/src/bitgo/pendingApproval/pendingApproval.d.ts.map +1 -1
- package/dist/src/bitgo/pendingApproval/pendingApproval.js +9 -1
- package/dist/src/bitgo/tss/common.d.ts +5 -6
- package/dist/src/bitgo/tss/common.d.ts.map +1 -1
- package/dist/src/bitgo/tss/common.js +7 -11
- package/dist/src/bitgo/tss/ecdsa/ecdsa.d.ts +11 -8
- package/dist/src/bitgo/tss/ecdsa/ecdsa.d.ts.map +1 -1
- package/dist/src/bitgo/tss/ecdsa/ecdsa.js +46 -33
- package/dist/src/bitgo/tss/ecdsa/types.d.ts +2 -2
- package/dist/src/bitgo/tss/ecdsa/types.d.ts.map +1 -1
- package/dist/src/bitgo/tss/ecdsa/types.js +1 -1
- package/dist/src/bitgo/tss/types.d.ts +4 -0
- package/dist/src/bitgo/tss/types.d.ts.map +1 -1
- package/dist/src/bitgo/tss/types.js +1 -1
- package/dist/src/bitgo/utils/opengpgUtils.d.ts +13 -0
- package/dist/src/bitgo/utils/opengpgUtils.d.ts.map +1 -1
- package/dist/src/bitgo/utils/opengpgUtils.js +22 -5
- package/dist/src/bitgo/utils/tss/ecdsa/ecdsa.d.ts +12 -10
- package/dist/src/bitgo/utils/tss/ecdsa/ecdsa.d.ts.map +1 -1
- package/dist/src/bitgo/utils/tss/ecdsa/ecdsa.js +79 -53
- package/dist/src/bitgo/utils/tss/ecdsa/types.d.ts +4 -3
- package/dist/src/bitgo/utils/tss/ecdsa/types.d.ts.map +1 -1
- package/dist/src/bitgo/utils/tss/ecdsa/types.js +1 -1
- package/dist/src/bitgo/wallet/iWallet.d.ts +5 -0
- package/dist/src/bitgo/wallet/iWallet.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/iWallet.js +1 -1
- package/dist/src/bitgo/wallet/wallet.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/wallet.js +8 -3
- package/dist/tsconfig.tsbuildinfo +453 -338
- package/package.json +5 -5
|
@@ -1,95 +1,11 @@
|
|
|
1
|
-
import BaseCurve from '../../curves';
|
|
2
|
-
import { PublicKey } from 'paillier-bigint';
|
|
3
|
-
import { DeserializedNtilde, DeserializedNtildeProof, RangeProof, RangeProofWithCheck } from './types';
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Zero Knowledge Range Proofs as described in (Two-party generation of DSA signatures)[1].
|
|
3
|
+
* [1]: https://reitermk.github.io/papers/2004/IJIS.pdf
|
|
7
4
|
*/
|
|
8
|
-
|
|
5
|
+
import { EcdsaRangeProof, randomPositiveCoPrimeTo } from '@bitgo/sdk-lib-mpc';
|
|
6
|
+
declare const generateSafePrimes: typeof EcdsaRangeProof.generateSafePrimes, generateNtilde: typeof EcdsaRangeProof.generateNtilde, generateNtildeProof: typeof EcdsaRangeProof.generateNtildeProof, verifyNtildeProof: typeof EcdsaRangeProof.verifyNtildeProof, prove: typeof EcdsaRangeProof.prove, proveWithCheck: typeof EcdsaRangeProof.proveWithCheck, verify: typeof EcdsaRangeProof.verify, verifyWithCheck: typeof EcdsaRangeProof.verifyWithCheck;
|
|
9
7
|
/**
|
|
10
|
-
* @deprecated
|
|
11
|
-
* @param x
|
|
8
|
+
* @deprecated Use EcdsaRangeProof from sdk-lib-mpc instead
|
|
12
9
|
*/
|
|
13
|
-
export
|
|
14
|
-
/**
|
|
15
|
-
* Generate "challenge" values for range proofs.
|
|
16
|
-
* @param {number} bitlength The bit length of the modulus to generate. This should
|
|
17
|
-
* be the same as the bit length of the paillier public keys used for MtA.
|
|
18
|
-
* @returns {DeserializedNtilde} The generated Ntilde values.
|
|
19
|
-
* @deprecated Use generateNtilde from sdk-lib-mpc instead
|
|
20
|
-
*/
|
|
21
|
-
export declare function generateNtilde(bitlength: number): Promise<DeserializedNtilde>;
|
|
22
|
-
/**
|
|
23
|
-
* Generate iterations of Ntilde, h1, h2 discrete log proofs.
|
|
24
|
-
* @param {DeserializedNtilde} ntilde Ntilde, h1, h2 to generate the proofs for.
|
|
25
|
-
* @param {bigint} x Either alpha or beta depending on whether it is a discrete log proof of
|
|
26
|
-
* h1 w.r.t h2 or h2 w.r.t h1.
|
|
27
|
-
* @param {bigint} q1 The Sophie Germain prime associated with the first safe prime p1 used to generate Ntilde.
|
|
28
|
-
* @param {bigint} q2 The Sophie Germain prime associated with the second safe prime p2 used to generate Ntilde.
|
|
29
|
-
* @returns {NtildeProof} The generated Ntilde Proofs.
|
|
30
|
-
* @deprecated use generateNtildeProof from sdk-lib-mpc instead
|
|
31
|
-
*/
|
|
32
|
-
export declare function generateNtildeProof(ntilde: DeserializedNtilde, x: bigint, q1: bigint, q2: bigint): Promise<DeserializedNtildeProof>;
|
|
33
|
-
/**
|
|
34
|
-
* Verify discrete log proofs of h1 and h2 mod Ntilde.
|
|
35
|
-
* @param {DeserializedNtilde} ntilde Ntilde, h1, h2 to generate the proofs for.
|
|
36
|
-
* @param {DeserializedNtildeProof} ntildeProof Ntilde Proofs
|
|
37
|
-
* @returns {boolean} true if proof is verified, false otherwise.
|
|
38
|
-
*/
|
|
39
|
-
export declare function verifyNtildeProof(ntilde: DeserializedNtilde, ntildeProof: DeserializedNtildeProof): Promise<boolean>;
|
|
40
|
-
/**
|
|
41
|
-
* Generate a zero-knowledge range proof that an encrypted value is "small".
|
|
42
|
-
* @param {BaseCurve} curve An elliptic curve to use for group operations.
|
|
43
|
-
* @param {number} modulusBits The bit count of the prover's public key.
|
|
44
|
-
* @param {PublicKey} pk The prover's public key.
|
|
45
|
-
* @param {DeserializedNtilde} ntilde The verifier's Ntilde values.
|
|
46
|
-
* @param {bigint} c The ciphertext.
|
|
47
|
-
* @param {bigint} m The plaintext.
|
|
48
|
-
* @param {bigint} r The obfuscation value used to encrypt m.
|
|
49
|
-
* @returns {RangeProof} The generated proof.
|
|
50
|
-
* @deprecated use prove from sdk-lib-mpc instead
|
|
51
|
-
*/
|
|
52
|
-
export declare function prove(curve: BaseCurve, modulusBits: number, pk: PublicKey, ntilde: DeserializedNtilde, c: bigint, m: bigint, r: bigint): Promise<RangeProof>;
|
|
53
|
-
/**
|
|
54
|
-
* Verify a zero-knowledge range proof that an encrypted value is "small".
|
|
55
|
-
* @param {BaseCurve} curve An elliptic curve to use for group operations.
|
|
56
|
-
* @param {number} modulusBits The bit count of the prover's public key.
|
|
57
|
-
* @param {PublicKey} pk The prover's public key.
|
|
58
|
-
* @param {DeserializedNtilde} ntilde The verifier's Ntilde values.
|
|
59
|
-
* @param {RangeProof} proof The range proof.
|
|
60
|
-
* @param {bigint} c The ciphertext.
|
|
61
|
-
* @returns {boolean} True if verification succeeds.
|
|
62
|
-
* @deprecated use verify from sdk-lib-mpc instead
|
|
63
|
-
*/
|
|
64
|
-
export declare function verify(curve: BaseCurve, modulusBits: number, pk: PublicKey, ntilde: DeserializedNtilde, proof: RangeProof, c: bigint): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Generate a zero-knowledge range proof that a homomorphically manipulated value is "small".
|
|
67
|
-
* @param {BaseCurve} curve An elliptic curve to use for group operations.
|
|
68
|
-
* @param {number} modulusBits The bit count of the prover's public key.
|
|
69
|
-
* @param {PublicKey} pk The prover's public key.
|
|
70
|
-
* @param {DeserializedNtilde} ntilde The verifier's Ntilde values.
|
|
71
|
-
* @param {bigint} c1 The original ciphertext.
|
|
72
|
-
* @param {bigint} c2 The manipulated ciphertext.
|
|
73
|
-
* @param {bigint} x The plaintext value multiplied by the original plaintext.
|
|
74
|
-
* @param {bigint} y The plaintext value that is added to x.
|
|
75
|
-
* @param {bigint} r The obfuscation value used to encrypt x.
|
|
76
|
-
* @param {bigint} X The curve's base point raised to x.
|
|
77
|
-
* @returns {RangeProofWithCheck} The generated proof.
|
|
78
|
-
* @deprecated use proveWithCheck from sdk-lib-mpc instead
|
|
79
|
-
*/
|
|
80
|
-
export declare function proveWithCheck(curve: BaseCurve, modulusBits: number, pk: PublicKey, ntilde: DeserializedNtilde, c1: bigint, c2: bigint, x: bigint, y: bigint, r: bigint, X: bigint): Promise<RangeProofWithCheck>;
|
|
81
|
-
/**
|
|
82
|
-
* Verify a zero-knowledge range proof that a homomorphically manipulated value is "small".
|
|
83
|
-
* @param {BaseCurve} curve An elliptic curve to use for group operations.
|
|
84
|
-
* @param {number} modulusBits The bit count of the prover's public key.
|
|
85
|
-
* @param {PublicKey} pk The prover's public key.
|
|
86
|
-
* @param {DeserializedNtilde} ntilde The verifier's Ntilde values.
|
|
87
|
-
* @param {RangeProofWithCheck} proof The range proof.
|
|
88
|
-
* @param {bigint} c1 The original ciphertext.
|
|
89
|
-
* @param {bigint} c2 The manipulated ciphertext.
|
|
90
|
-
* @param {bigint} X The curve's base point raised to x.
|
|
91
|
-
* @returns {boolean} True if verification succeeds.
|
|
92
|
-
* @deprecated use verifyWithCheck from sdk-lib-mpc instead
|
|
93
|
-
*/
|
|
94
|
-
export declare function verifyWithCheck(curve: BaseCurve, modulusBits: number, pk: PublicKey, ntilde: DeserializedNtilde, proof: RangeProofWithCheck, c1: bigint, c2: bigint, X: bigint): boolean;
|
|
10
|
+
export { generateSafePrimes, randomPositiveCoPrimeTo, generateNtilde, generateNtildeProof, verifyNtildeProof, prove, proveWithCheck, verify, verifyWithCheck, };
|
|
95
11
|
//# sourceMappingURL=rangeproof.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rangeproof.d.ts","sourceRoot":"","sources":["../../../../../../src/account-lib/mpc/tss/ecdsa/rangeproof.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rangeproof.d.ts","sourceRoot":"","sources":["../../../../../../src/account-lib/mpc/tss/ecdsa/rangeproof.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,QAAA,MACE,kBAAkB,6CAClB,cAAc,yCACd,mBAAmB,8CACnB,iBAAiB,4CACjB,KAAK,gCACL,cAAc,yCACd,MAAM,iCACN,eAAe,wCACE,CAAC;AAEpB;;GAEG;AACH,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACL,cAAc,EACd,MAAM,EACN,eAAe,GAChB,CAAC"}
|