@noble/curves 1.4.0 → 1.4.1
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/README.md +31 -23
- package/_shortw_utils.d.ts +16 -16
- package/_shortw_utils.d.ts.map +1 -1
- package/_shortw_utils.js +2 -3
- package/_shortw_utils.js.map +1 -1
- package/abstract/bls.d.ts +24 -22
- package/abstract/bls.d.ts.map +1 -1
- package/abstract/bls.js +1 -2
- package/abstract/bls.js.map +1 -1
- package/abstract/curve.d.ts.map +1 -1
- package/abstract/curve.js +2 -3
- package/abstract/curve.js.map +1 -1
- package/abstract/edwards.d.ts +12 -12
- package/abstract/edwards.d.ts.map +1 -1
- package/abstract/edwards.js +12 -5
- package/abstract/edwards.js.map +1 -1
- package/abstract/hash-to-curve.d.ts +2 -1
- package/abstract/hash-to-curve.d.ts.map +1 -1
- package/abstract/hash-to-curve.js +16 -6
- package/abstract/hash-to-curve.js.map +1 -1
- package/abstract/modular.d.ts.map +1 -1
- package/abstract/modular.js +20 -20
- package/abstract/modular.js.map +1 -1
- package/abstract/montgomery.js +1 -2
- package/abstract/montgomery.js.map +1 -1
- package/abstract/poseidon.d.ts +2 -2
- package/abstract/poseidon.d.ts.map +1 -1
- package/abstract/poseidon.js +3 -4
- package/abstract/poseidon.js.map +1 -1
- package/abstract/utils.d.ts +5 -5
- package/abstract/utils.js +24 -24
- package/abstract/utils.js.map +1 -1
- package/abstract/weierstrass.d.ts +17 -17
- package/abstract/weierstrass.d.ts.map +1 -1
- package/abstract/weierstrass.js +18 -8
- package/abstract/weierstrass.js.map +1 -1
- package/bls12-381.d.ts +0 -1
- package/bls12-381.d.ts.map +1 -1
- package/bls12-381.js +41 -39
- package/bls12-381.js.map +1 -1
- package/bn254.js +1 -1
- package/bn254.js.map +1 -1
- package/ed25519.d.ts +4 -4
- package/ed25519.d.ts.map +1 -1
- package/ed25519.js +34 -30
- package/ed25519.js.map +1 -1
- package/ed448.d.ts +3 -3
- package/ed448.d.ts.map +1 -1
- package/ed448.js +6 -3
- package/ed448.js.map +1 -1
- package/esm/_shortw_utils.d.ts +62 -0
- package/esm/_shortw_utils.d.ts.map +1 -0
- package/esm/_shortw_utils.js.map +1 -1
- package/esm/abstract/bls.d.ts +122 -0
- package/esm/abstract/bls.d.ts.map +1 -0
- package/esm/abstract/bls.js.map +1 -1
- package/esm/abstract/curve.d.ts +70 -0
- package/esm/abstract/curve.d.ts.map +1 -0
- package/esm/abstract/edwards.d.ts +89 -0
- package/esm/abstract/edwards.d.ts.map +1 -0
- package/esm/abstract/edwards.js +11 -3
- package/esm/abstract/edwards.js.map +1 -1
- package/esm/abstract/hash-to-curve.d.ts +58 -0
- package/esm/abstract/hash-to-curve.d.ts.map +1 -0
- package/esm/abstract/hash-to-curve.js +12 -1
- package/esm/abstract/hash-to-curve.js.map +1 -1
- package/esm/abstract/modular.d.ts +123 -0
- package/esm/abstract/modular.d.ts.map +1 -0
- package/esm/abstract/modular.js +1 -1
- package/esm/abstract/modular.js.map +1 -1
- package/esm/abstract/montgomery.d.ts +26 -0
- package/esm/abstract/montgomery.d.ts.map +1 -0
- package/esm/abstract/poseidon.d.ts +30 -0
- package/esm/abstract/poseidon.d.ts.map +1 -0
- package/esm/abstract/poseidon.js.map +1 -1
- package/esm/abstract/utils.d.ts +94 -0
- package/esm/abstract/utils.d.ts.map +1 -0
- package/esm/abstract/utils.js +3 -3
- package/esm/abstract/utils.js.map +1 -1
- package/esm/abstract/weierstrass.d.ts +237 -0
- package/esm/abstract/weierstrass.d.ts.map +1 -0
- package/esm/abstract/weierstrass.js +13 -3
- package/esm/abstract/weierstrass.js.map +1 -1
- package/esm/bls12-381.d.ts +67 -0
- package/esm/bls12-381.d.ts.map +1 -0
- package/esm/bls12-381.js +41 -39
- package/esm/bls12-381.js.map +1 -1
- package/esm/bn254.d.ts +9 -0
- package/esm/bn254.d.ts.map +1 -0
- package/esm/bn254.js +1 -1
- package/esm/bn254.js.map +1 -1
- package/esm/ed25519.d.ts +78 -0
- package/esm/ed25519.d.ts.map +1 -0
- package/esm/ed25519.js +31 -27
- package/esm/ed25519.js.map +1 -1
- package/esm/ed448.d.ts +67 -0
- package/esm/ed448.d.ts.map +1 -0
- package/esm/ed448.js +5 -2
- package/esm/ed448.js.map +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/jubjub.d.ts +9 -0
- package/esm/jubjub.d.ts.map +1 -0
- package/esm/jubjub.js +1 -1
- package/esm/jubjub.js.map +1 -1
- package/esm/p256.d.ts +105 -0
- package/esm/p256.d.ts.map +1 -0
- package/esm/p256.js +2 -2
- package/esm/p256.js.map +1 -1
- package/esm/p384.d.ts +105 -0
- package/esm/p384.d.ts.map +1 -0
- package/esm/p384.js +2 -2
- package/esm/p384.js.map +1 -1
- package/esm/p521.d.ts +105 -0
- package/esm/p521.d.ts.map +1 -0
- package/esm/p521.js +2 -2
- package/esm/p521.js.map +1 -1
- package/esm/pasta.d.ts +5 -0
- package/esm/pasta.d.ts.map +1 -0
- package/esm/pasta.js +6 -6
- package/esm/pasta.js.map +1 -1
- package/esm/secp256k1.d.ts +93 -0
- package/esm/secp256k1.d.ts.map +1 -0
- package/esm/secp256k1.js +3 -3
- package/esm/secp256k1.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/jubjub.js +4 -4
- package/jubjub.js.map +1 -1
- package/p256.d.ts +32 -32
- package/p256.d.ts.map +1 -1
- package/p256.js +2 -2
- package/p256.js.map +1 -1
- package/p384.d.ts +32 -32
- package/p384.d.ts.map +1 -1
- package/p384.js +2 -2
- package/p384.js.map +1 -1
- package/p521.d.ts +32 -32
- package/p521.d.ts.map +1 -1
- package/p521.js +2 -2
- package/p521.js.map +1 -1
- package/package.json +26 -47
- package/pasta.js +6 -6
- package/pasta.js.map +1 -1
- package/secp256k1.d.ts +18 -18
- package/secp256k1.d.ts.map +1 -1
- package/secp256k1.js +3 -3
- package/secp256k1.js.map +1 -1
- package/src/_shortw_utils.ts +1 -1
- package/src/abstract/bls.ts +31 -25
- package/src/abstract/edwards.ts +3 -2
- package/src/abstract/hash-to-curve.ts +13 -3
- package/src/abstract/modular.ts +2 -2
- package/src/abstract/poseidon.ts +1 -1
- package/src/abstract/utils.ts +3 -3
- package/src/abstract/weierstrass.ts +1 -1
- package/src/bls12-381.ts +46 -44
- package/src/bn254.ts +1 -1
- package/src/ed25519.ts +76 -68
- package/src/ed448.ts +3 -3
- package/src/index.ts +1 -1
- package/src/jubjub.ts +1 -1
- package/src/p256.ts +2 -2
- package/src/p384.ts +2 -2
- package/src/p521.ts +2 -2
- package/src/pasta.ts +6 -6
- package/src/secp256k1.ts +3 -3
package/p384.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const p384: Readonly<{
|
|
2
2
|
create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
|
|
3
|
-
CURVE: Readonly<{
|
|
3
|
+
CURVE: ReturnType<(curve: import("./abstract/weierstrass.js").CurveType) => Readonly<{
|
|
4
4
|
readonly nBitLength: number;
|
|
5
5
|
readonly nByteLength: number;
|
|
6
6
|
readonly Fp: import("./abstract/modular.js").IField<bigint>;
|
|
7
7
|
readonly n: bigint;
|
|
8
8
|
readonly h: bigint;
|
|
9
|
-
readonly hEff?: bigint
|
|
9
|
+
readonly hEff?: bigint;
|
|
10
10
|
readonly Gx: bigint;
|
|
11
11
|
readonly Gy: bigint;
|
|
12
|
-
readonly allowInfinityPoint?: boolean
|
|
12
|
+
readonly allowInfinityPoint?: boolean;
|
|
13
13
|
readonly a: bigint;
|
|
14
14
|
readonly b: bigint;
|
|
15
|
-
readonly allowedPrivateKeyLengths?: readonly number[]
|
|
16
|
-
readonly wrapPrivateKey?: boolean
|
|
15
|
+
readonly allowedPrivateKeyLengths?: readonly number[];
|
|
16
|
+
readonly wrapPrivateKey?: boolean;
|
|
17
17
|
readonly endo?: {
|
|
18
18
|
beta: bigint;
|
|
19
19
|
splitScalar: (k: bigint) => {
|
|
@@ -22,49 +22,49 @@ export declare const p384: Readonly<{
|
|
|
22
22
|
k2neg: boolean;
|
|
23
23
|
k2: bigint;
|
|
24
24
|
};
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
|
|
27
27
|
readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>) | undefined;
|
|
28
28
|
readonly hash: import("./abstract/utils.js").CHash;
|
|
29
29
|
readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
|
|
30
|
-
readonly randomBytes: (bytesLength?: number
|
|
30
|
+
readonly randomBytes: (bytesLength?: number) => Uint8Array;
|
|
31
31
|
lowS: boolean;
|
|
32
|
-
readonly bits2int?: (
|
|
33
|
-
readonly bits2int_modN?: (
|
|
32
|
+
readonly bits2int?: (bytes: Uint8Array) => bigint;
|
|
33
|
+
readonly bits2int_modN?: (bytes: Uint8Array) => bigint;
|
|
34
34
|
readonly p: bigint;
|
|
35
|
-
}
|
|
36
|
-
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean
|
|
37
|
-
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean
|
|
38
|
-
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts
|
|
35
|
+
}>>;
|
|
36
|
+
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean) => Uint8Array;
|
|
37
|
+
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean) => Uint8Array;
|
|
38
|
+
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts) => import("./abstract/weierstrass.js").RecoveredSignatureType;
|
|
39
39
|
verify: (signature: import("./abstract/utils.js").Hex | {
|
|
40
40
|
r: bigint;
|
|
41
41
|
s: bigint;
|
|
42
|
-
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts
|
|
42
|
+
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts) => boolean;
|
|
43
43
|
ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
|
|
44
44
|
Signature: import("./abstract/weierstrass.js").SignatureConstructor;
|
|
45
45
|
utils: {
|
|
46
46
|
normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
|
|
47
47
|
isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
|
|
48
48
|
randomPrivateKey: () => Uint8Array;
|
|
49
|
-
precompute: (windowSize?: number
|
|
49
|
+
precompute: (windowSize?: number, point?: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
|
|
50
50
|
};
|
|
51
51
|
}>;
|
|
52
52
|
export declare const secp384r1: Readonly<{
|
|
53
53
|
create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
|
|
54
|
-
CURVE: Readonly<{
|
|
54
|
+
CURVE: ReturnType<(curve: import("./abstract/weierstrass.js").CurveType) => Readonly<{
|
|
55
55
|
readonly nBitLength: number;
|
|
56
56
|
readonly nByteLength: number;
|
|
57
57
|
readonly Fp: import("./abstract/modular.js").IField<bigint>;
|
|
58
58
|
readonly n: bigint;
|
|
59
59
|
readonly h: bigint;
|
|
60
|
-
readonly hEff?: bigint
|
|
60
|
+
readonly hEff?: bigint;
|
|
61
61
|
readonly Gx: bigint;
|
|
62
62
|
readonly Gy: bigint;
|
|
63
|
-
readonly allowInfinityPoint?: boolean
|
|
63
|
+
readonly allowInfinityPoint?: boolean;
|
|
64
64
|
readonly a: bigint;
|
|
65
65
|
readonly b: bigint;
|
|
66
|
-
readonly allowedPrivateKeyLengths?: readonly number[]
|
|
67
|
-
readonly wrapPrivateKey?: boolean
|
|
66
|
+
readonly allowedPrivateKeyLengths?: readonly number[];
|
|
67
|
+
readonly wrapPrivateKey?: boolean;
|
|
68
68
|
readonly endo?: {
|
|
69
69
|
beta: bigint;
|
|
70
70
|
splitScalar: (k: bigint) => {
|
|
@@ -73,33 +73,33 @@ export declare const secp384r1: Readonly<{
|
|
|
73
73
|
k2neg: boolean;
|
|
74
74
|
k2: bigint;
|
|
75
75
|
};
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
|
|
78
78
|
readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>) | undefined;
|
|
79
79
|
readonly hash: import("./abstract/utils.js").CHash;
|
|
80
80
|
readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
|
|
81
|
-
readonly randomBytes: (bytesLength?: number
|
|
81
|
+
readonly randomBytes: (bytesLength?: number) => Uint8Array;
|
|
82
82
|
lowS: boolean;
|
|
83
|
-
readonly bits2int?: (
|
|
84
|
-
readonly bits2int_modN?: (
|
|
83
|
+
readonly bits2int?: (bytes: Uint8Array) => bigint;
|
|
84
|
+
readonly bits2int_modN?: (bytes: Uint8Array) => bigint;
|
|
85
85
|
readonly p: bigint;
|
|
86
|
-
}
|
|
87
|
-
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean
|
|
88
|
-
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean
|
|
89
|
-
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts
|
|
86
|
+
}>>;
|
|
87
|
+
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean) => Uint8Array;
|
|
88
|
+
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean) => Uint8Array;
|
|
89
|
+
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts) => import("./abstract/weierstrass.js").RecoveredSignatureType;
|
|
90
90
|
verify: (signature: import("./abstract/utils.js").Hex | {
|
|
91
91
|
r: bigint;
|
|
92
92
|
s: bigint;
|
|
93
|
-
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts
|
|
93
|
+
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts) => boolean;
|
|
94
94
|
ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
|
|
95
95
|
Signature: import("./abstract/weierstrass.js").SignatureConstructor;
|
|
96
96
|
utils: {
|
|
97
97
|
normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
|
|
98
98
|
isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
|
|
99
99
|
randomPrivateKey: () => Uint8Array;
|
|
100
|
-
precompute: (windowSize?: number
|
|
100
|
+
precompute: (windowSize?: number, point?: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
|
|
101
101
|
};
|
|
102
102
|
}>;
|
|
103
|
-
export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts
|
|
104
|
-
export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts
|
|
103
|
+
export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts) => import("./abstract/hash-to-curve.js").H2CPoint<bigint>;
|
|
104
|
+
export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts) => import("./abstract/hash-to-curve.js").H2CPoint<bigint>;
|
|
105
105
|
//# sourceMappingURL=p384.d.ts.map
|
package/p384.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p384.d.ts","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"p384.d.ts","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAiC07rB,CAAC;;;;;;kFAAwmB,CAAC;+HAA2F,CAAC;2GAAuE,CAAC;;;;qGAAoH,CAAC;;;;;;;+BAA+R,CAAC,eAAe,CAAC;;EAtB3muB,CAAC;AACpB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAqBq7rB,CAAC;;;;;;kFAAwmB,CAAC;+HAA2F,CAAC;2GAAuE,CAAC;;;;qGAAoH,CAAC;;;;;;;+BAA+R,CAAC,eAAe,CAAC;;EArBjmuB,CAAC;AAmB9B,eAAO,MAAM,WAAW,2IAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,2IAA8C,CAAC"}
|
package/p384.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.encodeToCurve = exports.hashToCurve = exports.secp384r1 = exports.p384 = void 0;
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
|
-
const _shortw_utils_js_1 = require("./_shortw_utils.js");
|
|
6
5
|
const sha512_1 = require("@noble/hashes/sha512");
|
|
6
|
+
const _shortw_utils_js_1 = require("./_shortw_utils.js");
|
|
7
|
+
const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js");
|
|
7
8
|
const modular_js_1 = require("./abstract/modular.js");
|
|
8
9
|
const weierstrass_js_1 = require("./abstract/weierstrass.js");
|
|
9
|
-
const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js");
|
|
10
10
|
// NIST secp384r1 aka p384
|
|
11
11
|
// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-384
|
|
12
12
|
// Field over which we'll do calculations.
|
package/p384.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p384.js","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"p384.js","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,yDAAiD;AACjD,kEAA2D;AAC3D,sDAA8C;AAC9C,8DAAgE;AAEhE,0BAA0B;AAC1B,0EAA0E;AAE1E,0CAA0C;AAC1C,kBAAkB;AAClB,MAAM,CAAC,GAAG,MAAM,CAAC,oGAAoG,CAAC,CAAC;AACvH,MAAM,EAAE,GAAG,IAAA,kBAAK,EAAC,CAAC,CAAC,CAAC;AACpB,MAAM,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,kBAAkB;AAClB,MAAM,OAAO,GAAG,MAAM,CAAC,oGAAoG,CAAC,CAAC;AAE7H,kBAAkB;AACL,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC9B,CAAC,EAAE,OAAO,EAAE,wBAAwB;IACpC,CAAC,EAAE,OAAO;IACV,EAAE,EAAE,sDAAsD;IAC1D,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAC/G,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAChH,EAAE,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAChH,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,KAAK;CACH,EAAE,eAAM,CAAC,CAAC;AACP,QAAA,SAAS,GAAG,YAAI,CAAC;AAE9B,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CACnC,IAAA,oCAAmB,EAAC,EAAE,EAAE;IACtB,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;CAC5B,CAAC,CAAC,EAAE,CAAC;AAER,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAChC,IAAA,+BAAY,EAAC,iBAAS,CAAC,eAAe,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACjF,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,2BAA2B;IACtC,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,eAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACK,QAAA,WAAW,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACxD,QAAA,aAAa,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"}
|
package/p521.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const p521: Readonly<{
|
|
2
2
|
create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
|
|
3
|
-
CURVE: Readonly<{
|
|
3
|
+
CURVE: ReturnType<(curve: import("./abstract/weierstrass.js").CurveType) => Readonly<{
|
|
4
4
|
readonly nBitLength: number;
|
|
5
5
|
readonly nByteLength: number;
|
|
6
6
|
readonly Fp: import("./abstract/modular.js").IField<bigint>;
|
|
7
7
|
readonly n: bigint;
|
|
8
8
|
readonly h: bigint;
|
|
9
|
-
readonly hEff?: bigint
|
|
9
|
+
readonly hEff?: bigint;
|
|
10
10
|
readonly Gx: bigint;
|
|
11
11
|
readonly Gy: bigint;
|
|
12
|
-
readonly allowInfinityPoint?: boolean
|
|
12
|
+
readonly allowInfinityPoint?: boolean;
|
|
13
13
|
readonly a: bigint;
|
|
14
14
|
readonly b: bigint;
|
|
15
|
-
readonly allowedPrivateKeyLengths?: readonly number[]
|
|
16
|
-
readonly wrapPrivateKey?: boolean
|
|
15
|
+
readonly allowedPrivateKeyLengths?: readonly number[];
|
|
16
|
+
readonly wrapPrivateKey?: boolean;
|
|
17
17
|
readonly endo?: {
|
|
18
18
|
beta: bigint;
|
|
19
19
|
splitScalar: (k: bigint) => {
|
|
@@ -22,49 +22,49 @@ export declare const p521: Readonly<{
|
|
|
22
22
|
k2neg: boolean;
|
|
23
23
|
k2: bigint;
|
|
24
24
|
};
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
|
|
27
27
|
readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>) | undefined;
|
|
28
28
|
readonly hash: import("./abstract/utils.js").CHash;
|
|
29
29
|
readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
|
|
30
|
-
readonly randomBytes: (bytesLength?: number
|
|
30
|
+
readonly randomBytes: (bytesLength?: number) => Uint8Array;
|
|
31
31
|
lowS: boolean;
|
|
32
|
-
readonly bits2int?: (
|
|
33
|
-
readonly bits2int_modN?: (
|
|
32
|
+
readonly bits2int?: (bytes: Uint8Array) => bigint;
|
|
33
|
+
readonly bits2int_modN?: (bytes: Uint8Array) => bigint;
|
|
34
34
|
readonly p: bigint;
|
|
35
|
-
}
|
|
36
|
-
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean
|
|
37
|
-
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean
|
|
38
|
-
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts
|
|
35
|
+
}>>;
|
|
36
|
+
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean) => Uint8Array;
|
|
37
|
+
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean) => Uint8Array;
|
|
38
|
+
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts) => import("./abstract/weierstrass.js").RecoveredSignatureType;
|
|
39
39
|
verify: (signature: import("./abstract/utils.js").Hex | {
|
|
40
40
|
r: bigint;
|
|
41
41
|
s: bigint;
|
|
42
|
-
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts
|
|
42
|
+
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts) => boolean;
|
|
43
43
|
ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
|
|
44
44
|
Signature: import("./abstract/weierstrass.js").SignatureConstructor;
|
|
45
45
|
utils: {
|
|
46
46
|
normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
|
|
47
47
|
isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
|
|
48
48
|
randomPrivateKey: () => Uint8Array;
|
|
49
|
-
precompute: (windowSize?: number
|
|
49
|
+
precompute: (windowSize?: number, point?: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
|
|
50
50
|
};
|
|
51
51
|
}>;
|
|
52
52
|
export declare const secp521r1: Readonly<{
|
|
53
53
|
create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
|
|
54
|
-
CURVE: Readonly<{
|
|
54
|
+
CURVE: ReturnType<(curve: import("./abstract/weierstrass.js").CurveType) => Readonly<{
|
|
55
55
|
readonly nBitLength: number;
|
|
56
56
|
readonly nByteLength: number;
|
|
57
57
|
readonly Fp: import("./abstract/modular.js").IField<bigint>;
|
|
58
58
|
readonly n: bigint;
|
|
59
59
|
readonly h: bigint;
|
|
60
|
-
readonly hEff?: bigint
|
|
60
|
+
readonly hEff?: bigint;
|
|
61
61
|
readonly Gx: bigint;
|
|
62
62
|
readonly Gy: bigint;
|
|
63
|
-
readonly allowInfinityPoint?: boolean
|
|
63
|
+
readonly allowInfinityPoint?: boolean;
|
|
64
64
|
readonly a: bigint;
|
|
65
65
|
readonly b: bigint;
|
|
66
|
-
readonly allowedPrivateKeyLengths?: readonly number[]
|
|
67
|
-
readonly wrapPrivateKey?: boolean
|
|
66
|
+
readonly allowedPrivateKeyLengths?: readonly number[];
|
|
67
|
+
readonly wrapPrivateKey?: boolean;
|
|
68
68
|
readonly endo?: {
|
|
69
69
|
beta: bigint;
|
|
70
70
|
splitScalar: (k: bigint) => {
|
|
@@ -73,33 +73,33 @@ export declare const secp521r1: Readonly<{
|
|
|
73
73
|
k2neg: boolean;
|
|
74
74
|
k2: bigint;
|
|
75
75
|
};
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
|
|
78
78
|
readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>) | undefined;
|
|
79
79
|
readonly hash: import("./abstract/utils.js").CHash;
|
|
80
80
|
readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
|
|
81
|
-
readonly randomBytes: (bytesLength?: number
|
|
81
|
+
readonly randomBytes: (bytesLength?: number) => Uint8Array;
|
|
82
82
|
lowS: boolean;
|
|
83
|
-
readonly bits2int?: (
|
|
84
|
-
readonly bits2int_modN?: (
|
|
83
|
+
readonly bits2int?: (bytes: Uint8Array) => bigint;
|
|
84
|
+
readonly bits2int_modN?: (bytes: Uint8Array) => bigint;
|
|
85
85
|
readonly p: bigint;
|
|
86
|
-
}
|
|
87
|
-
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean
|
|
88
|
-
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean
|
|
89
|
-
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts
|
|
86
|
+
}>>;
|
|
87
|
+
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean) => Uint8Array;
|
|
88
|
+
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean) => Uint8Array;
|
|
89
|
+
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts) => import("./abstract/weierstrass.js").RecoveredSignatureType;
|
|
90
90
|
verify: (signature: import("./abstract/utils.js").Hex | {
|
|
91
91
|
r: bigint;
|
|
92
92
|
s: bigint;
|
|
93
|
-
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts
|
|
93
|
+
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts) => boolean;
|
|
94
94
|
ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
|
|
95
95
|
Signature: import("./abstract/weierstrass.js").SignatureConstructor;
|
|
96
96
|
utils: {
|
|
97
97
|
normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
|
|
98
98
|
isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
|
|
99
99
|
randomPrivateKey: () => Uint8Array;
|
|
100
|
-
precompute: (windowSize?: number
|
|
100
|
+
precompute: (windowSize?: number, point?: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
|
|
101
101
|
};
|
|
102
102
|
}>;
|
|
103
|
-
export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts
|
|
104
|
-
export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts
|
|
103
|
+
export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts) => import("./abstract/hash-to-curve.js").H2CPoint<bigint>;
|
|
104
|
+
export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts) => import("./abstract/hash-to-curve.js").H2CPoint<bigint>;
|
|
105
105
|
//# sourceMappingURL=p521.d.ts.map
|
package/p521.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p521.d.ts","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"p521.d.ts","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAiCijrB,CAAC;;;;;;kFAAwmB,CAAC;+HAA2F,CAAC;2GAAuE,CAAC;;;;qGAAoH,CAAC;;;;;;;+BAA+R,CAAC,eAAe,CAAC;;EAtBlutB,CAAC;AACpB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAqB4irB,CAAC;;;;;;kFAAwmB,CAAC;+HAA2F,CAAC;2GAAuE,CAAC;;;;qGAAoH,CAAC;;;;;;;+BAA+R,CAAC,eAAe,CAAC;;EArBxttB,CAAC;AAmB9B,eAAO,MAAM,WAAW,2IAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,2IAA8C,CAAC"}
|
package/p521.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.encodeToCurve = exports.hashToCurve = exports.secp521r1 = exports.p521 = void 0;
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
|
-
const _shortw_utils_js_1 = require("./_shortw_utils.js");
|
|
6
5
|
const sha512_1 = require("@noble/hashes/sha512");
|
|
6
|
+
const _shortw_utils_js_1 = require("./_shortw_utils.js");
|
|
7
|
+
const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js");
|
|
7
8
|
const modular_js_1 = require("./abstract/modular.js");
|
|
8
9
|
const weierstrass_js_1 = require("./abstract/weierstrass.js");
|
|
9
|
-
const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js");
|
|
10
10
|
// NIST secp521r1 aka p521
|
|
11
11
|
// Note that it's 521, which differs from 512 of its hash function.
|
|
12
12
|
// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-521
|
package/p521.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p521.js","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"p521.js","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,yDAAiD;AACjD,kEAA2D;AAC3D,sDAA8C;AAC9C,8DAAgE;AAEhE,0BAA0B;AAC1B,mEAAmE;AACnE,0EAA0E;AAE1E,0CAA0C;AAC1C,kBAAkB;AAClB,MAAM,CAAC,GAAG,MAAM,CAAC,uIAAuI,CAAC,CAAC;AAC1J,MAAM,EAAE,GAAG,IAAA,kBAAK,EAAC,CAAC,CAAC,CAAC;AAEpB,MAAM,KAAK,GAAG;IACZ,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,EAAE,MAAM,CACP,wIAAwI,CACzI;IACD,EAAE;IACF,CAAC,EAAE,MAAM,CACP,wIAAwI,CACzI;IACD,EAAE,EAAE,MAAM,CACR,wIAAwI,CACzI;IACD,EAAE,EAAE,MAAM,CACR,wIAAwI,CACzI;IACD,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACb,CAAC;AAEF,kBAAkB;AACL,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC9B,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,wBAAwB;IACpC,CAAC,EAAE,KAAK,CAAC,CAAC;IACV,EAAE,EAAE,uBAAuB;IAC3B,wDAAwD;IACxD,CAAC,EAAE,KAAK,CAAC,CAAC;IACV,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,wCAAwC;IACtD,EAAE,EAAE,KAAK,CAAC,EAAE;IACZ,CAAC,EAAE,KAAK,CAAC,CAAC;IACV,IAAI,EAAE,KAAK;IACX,wBAAwB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,mDAAmD;CACrF,EAAE,eAAM,CAAC,CAAC;AACP,QAAA,SAAS,GAAG,YAAI,CAAC;AAE9B,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CACnC,IAAA,oCAAmB,EAAC,EAAE,EAAE;IACtB,CAAC,EAAE,KAAK,CAAC,CAAC;IACV,CAAC,EAAE,KAAK,CAAC,CAAC;IACV,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC,CAAC,EAAE,CAAC;AAER,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAChC,IAAA,+BAAY,EAAC,iBAAS,CAAC,eAAe,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACjF,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,2BAA2B;IACtC,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,eAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACK,QAAA,WAAW,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACxD,QAAA,aAAa,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noble/curves",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Audited & minimal JS implementation of elliptic curve cryptography",
|
|
5
5
|
"files": [
|
|
6
6
|
"abstract",
|
|
@@ -31,124 +31,103 @@
|
|
|
31
31
|
"@noble/hashes": "1.4.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
+
"@paulmillr/jsbt": "0.2.0",
|
|
34
35
|
"fast-check": "3.0.0",
|
|
35
36
|
"micro-bmark": "0.3.1",
|
|
36
37
|
"micro-should": "0.4.0",
|
|
37
|
-
"prettier": "3.
|
|
38
|
-
"typescript": "5.
|
|
38
|
+
"prettier": "3.3.2",
|
|
39
|
+
"typescript": "5.5.2"
|
|
39
40
|
},
|
|
40
41
|
"sideEffects": false,
|
|
41
42
|
"main": "index.js",
|
|
42
43
|
"exports": {
|
|
43
44
|
".": {
|
|
44
|
-
"types": "./index.d.ts",
|
|
45
45
|
"import": "./esm/index.js",
|
|
46
|
-
"
|
|
46
|
+
"require": "./index.js"
|
|
47
47
|
},
|
|
48
48
|
"./abstract/edwards": {
|
|
49
|
-
"types": "./abstract/edwards.d.ts",
|
|
50
49
|
"import": "./esm/abstract/edwards.js",
|
|
51
|
-
"
|
|
50
|
+
"require": "./abstract/edwards.js"
|
|
52
51
|
},
|
|
53
52
|
"./abstract/modular": {
|
|
54
|
-
"types": "./abstract/modular.d.ts",
|
|
55
53
|
"import": "./esm/abstract/modular.js",
|
|
56
|
-
"
|
|
54
|
+
"require": "./abstract/modular.js"
|
|
57
55
|
},
|
|
58
56
|
"./abstract/montgomery": {
|
|
59
|
-
"types": "./abstract/montgomery.d.ts",
|
|
60
57
|
"import": "./esm/abstract/montgomery.js",
|
|
61
|
-
"
|
|
58
|
+
"require": "./abstract/montgomery.js"
|
|
62
59
|
},
|
|
63
60
|
"./abstract/weierstrass": {
|
|
64
|
-
"types": "./abstract/weierstrass.d.ts",
|
|
65
61
|
"import": "./esm/abstract/weierstrass.js",
|
|
66
|
-
"
|
|
62
|
+
"require": "./abstract/weierstrass.js"
|
|
67
63
|
},
|
|
68
64
|
"./abstract/bls": {
|
|
69
|
-
"types": "./abstract/bls.d.ts",
|
|
70
65
|
"import": "./esm/abstract/bls.js",
|
|
71
|
-
"
|
|
66
|
+
"require": "./abstract/bls.js"
|
|
72
67
|
},
|
|
73
68
|
"./abstract/hash-to-curve": {
|
|
74
|
-
"types": "./abstract/hash-to-curve.d.ts",
|
|
75
69
|
"import": "./esm/abstract/hash-to-curve.js",
|
|
76
|
-
"
|
|
70
|
+
"require": "./abstract/hash-to-curve.js"
|
|
77
71
|
},
|
|
78
72
|
"./abstract/curve": {
|
|
79
|
-
"types": "./abstract/curve.d.ts",
|
|
80
73
|
"import": "./esm/abstract/curve.js",
|
|
81
|
-
"
|
|
74
|
+
"require": "./abstract/curve.js"
|
|
82
75
|
},
|
|
83
76
|
"./abstract/utils": {
|
|
84
|
-
"types": "./abstract/utils.d.ts",
|
|
85
77
|
"import": "./esm/abstract/utils.js",
|
|
86
|
-
"
|
|
78
|
+
"require": "./abstract/utils.js"
|
|
87
79
|
},
|
|
88
80
|
"./abstract/poseidon": {
|
|
89
|
-
"types": "./abstract/poseidon.d.ts",
|
|
90
81
|
"import": "./esm/abstract/poseidon.js",
|
|
91
|
-
"
|
|
82
|
+
"require": "./abstract/poseidon.js"
|
|
92
83
|
},
|
|
93
84
|
"./_shortw_utils": {
|
|
94
|
-
"types": "./_shortw_utils.d.ts",
|
|
95
85
|
"import": "./esm/_shortw_utils.js",
|
|
96
|
-
"
|
|
86
|
+
"require": "./_shortw_utils.js"
|
|
97
87
|
},
|
|
98
88
|
"./bls12-381": {
|
|
99
|
-
"types": "./bls12-381.d.ts",
|
|
100
89
|
"import": "./esm/bls12-381.js",
|
|
101
|
-
"
|
|
90
|
+
"require": "./bls12-381.js"
|
|
102
91
|
},
|
|
103
92
|
"./bn254": {
|
|
104
|
-
"types": "./bn254.d.ts",
|
|
105
93
|
"import": "./esm/bn254.js",
|
|
106
|
-
"
|
|
94
|
+
"require": "./bn254.js"
|
|
107
95
|
},
|
|
108
96
|
"./ed25519": {
|
|
109
|
-
"types": "./ed25519.d.ts",
|
|
110
97
|
"import": "./esm/ed25519.js",
|
|
111
|
-
"
|
|
98
|
+
"require": "./ed25519.js"
|
|
112
99
|
},
|
|
113
100
|
"./ed448": {
|
|
114
|
-
"types": "./ed448.d.ts",
|
|
115
101
|
"import": "./esm/ed448.js",
|
|
116
|
-
"
|
|
102
|
+
"require": "./ed448.js"
|
|
117
103
|
},
|
|
118
104
|
"./index": {
|
|
119
|
-
"types": "./index.d.ts",
|
|
120
105
|
"import": "./esm/index.js",
|
|
121
|
-
"
|
|
106
|
+
"require": "./index.js"
|
|
122
107
|
},
|
|
123
108
|
"./jubjub": {
|
|
124
|
-
"types": "./jubjub.d.ts",
|
|
125
109
|
"import": "./esm/jubjub.js",
|
|
126
|
-
"
|
|
110
|
+
"require": "./jubjub.js"
|
|
127
111
|
},
|
|
128
112
|
"./p256": {
|
|
129
|
-
"types": "./p256.d.ts",
|
|
130
113
|
"import": "./esm/p256.js",
|
|
131
|
-
"
|
|
114
|
+
"require": "./p256.js"
|
|
132
115
|
},
|
|
133
116
|
"./p384": {
|
|
134
|
-
"types": "./p384.d.ts",
|
|
135
117
|
"import": "./esm/p384.js",
|
|
136
|
-
"
|
|
118
|
+
"require": "./p384.js"
|
|
137
119
|
},
|
|
138
120
|
"./p521": {
|
|
139
|
-
"types": "./p521.d.ts",
|
|
140
121
|
"import": "./esm/p521.js",
|
|
141
|
-
"
|
|
122
|
+
"require": "./p521.js"
|
|
142
123
|
},
|
|
143
124
|
"./pasta": {
|
|
144
|
-
"types": "./pasta.d.ts",
|
|
145
125
|
"import": "./esm/pasta.js",
|
|
146
|
-
"
|
|
126
|
+
"require": "./pasta.js"
|
|
147
127
|
},
|
|
148
128
|
"./secp256k1": {
|
|
149
|
-
"types": "./secp256k1.d.ts",
|
|
150
129
|
"import": "./esm/secp256k1.js",
|
|
151
|
-
"
|
|
130
|
+
"require": "./secp256k1.js"
|
|
152
131
|
}
|
|
153
132
|
},
|
|
154
133
|
"keywords": [
|
package/pasta.js
CHANGED
|
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.vesta = exports.pallas = exports.q = exports.p = void 0;
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
5
|
const sha256_1 = require("@noble/hashes/sha256");
|
|
6
|
-
const weierstrass_js_1 = require("./abstract/weierstrass.js");
|
|
7
6
|
const _shortw_utils_js_1 = require("./_shortw_utils.js");
|
|
8
|
-
const
|
|
7
|
+
const modular_js_1 = require("./abstract/modular.js");
|
|
8
|
+
const weierstrass_js_1 = require("./abstract/weierstrass.js");
|
|
9
9
|
exports.p = BigInt('0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001');
|
|
10
10
|
exports.q = BigInt('0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001');
|
|
11
11
|
// https://neuromancer.sk/std/other/Pallas
|
|
12
12
|
exports.pallas = (0, weierstrass_js_1.weierstrass)({
|
|
13
13
|
a: BigInt(0),
|
|
14
14
|
b: BigInt(5),
|
|
15
|
-
Fp:
|
|
15
|
+
Fp: (0, modular_js_1.Field)(exports.p),
|
|
16
16
|
n: exports.q,
|
|
17
|
-
Gx:
|
|
17
|
+
Gx: (0, modular_js_1.mod)(BigInt(-1), exports.p),
|
|
18
18
|
Gy: BigInt(2),
|
|
19
19
|
h: BigInt(1),
|
|
20
20
|
...(0, _shortw_utils_js_1.getHash)(sha256_1.sha256),
|
|
@@ -23,9 +23,9 @@ exports.pallas = (0, weierstrass_js_1.weierstrass)({
|
|
|
23
23
|
exports.vesta = (0, weierstrass_js_1.weierstrass)({
|
|
24
24
|
a: BigInt(0),
|
|
25
25
|
b: BigInt(5),
|
|
26
|
-
Fp:
|
|
26
|
+
Fp: (0, modular_js_1.Field)(exports.q),
|
|
27
27
|
n: exports.p,
|
|
28
|
-
Gx:
|
|
28
|
+
Gx: (0, modular_js_1.mod)(BigInt(-1), exports.q),
|
|
29
29
|
Gy: BigInt(2),
|
|
30
30
|
h: BigInt(1),
|
|
31
31
|
...(0, _shortw_utils_js_1.getHash)(sha256_1.sha256),
|
package/pasta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pasta.js","sourceRoot":"","sources":["src/pasta.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"pasta.js","sourceRoot":"","sources":["src/pasta.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,yDAA6C;AAC7C,sDAAmD;AACnD,8DAAwD;AAE3C,QAAA,CAAC,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AACjF,QAAA,CAAC,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE9F,0CAA0C;AAC7B,QAAA,MAAM,GAAG,IAAA,4BAAW,EAAC;IAChC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,IAAA,kBAAK,EAAC,SAAC,CAAC;IACZ,CAAC,EAAE,SAAC;IACJ,EAAE,EAAE,IAAA,gBAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,SAAC,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,IAAA,0BAAO,EAAC,eAAM,CAAC;CACnB,CAAC,CAAC;AACH,yCAAyC;AAC5B,QAAA,KAAK,GAAG,IAAA,4BAAW,EAAC;IAC/B,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,IAAA,kBAAK,EAAC,SAAC,CAAC;IACZ,CAAC,EAAE,SAAC;IACJ,EAAE,EAAE,IAAA,gBAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,SAAC,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,IAAA,0BAAO,EAAC,eAAM,CAAC;CACnB,CAAC,CAAC"}
|