@noble/curves 1.3.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 +52 -29
- 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 +28 -26
- 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 +26 -27
- 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 +7 -6
- package/abstract/utils.d.ts.map +1 -1
- package/abstract/utils.js +35 -34
- package/abstract/utils.js.map +1 -1
- package/abstract/weierstrass.d.ts +18 -18
- package/abstract/weierstrass.d.ts.map +1 -1
- package/abstract/weierstrass.js +28 -12
- 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 +42 -40
- 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 +17 -17
- 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 +14 -14
- 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 +23 -7
- 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 +42 -40
- 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 +2 -2
- 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 +30 -51
- 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 +35 -29
- package/src/abstract/edwards.ts +3 -2
- package/src/abstract/hash-to-curve.ts +18 -17
- package/src/abstract/modular.ts +2 -2
- package/src/abstract/poseidon.ts +1 -1
- package/src/abstract/utils.ts +14 -11
- package/src/abstract/weierstrass.ts +11 -5
- package/src/bls12-381.ts +47 -45
- 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/package.json +3 -0
- package/src/pasta.ts +6 -6
- package/src/secp256k1.ts +3 -3
package/p256.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const p256: 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 p256: 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 secp256r1: 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 secp256r1: 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=p256.d.ts.map
|
package/p256.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p256.d.ts","sourceRoot":"","sources":["src/p256.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"p256.d.ts","sourceRoot":"","sources":["src/p256.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAiCsrsB,CAAC;;;;;;kFAAwmB,CAAC;+HAA2F,CAAC;2GAAuE,CAAC;;;;qGAAoH,CAAC;;;;;;;+BAA+R,CAAC,eAAe,CAAC;;EAtBv2uB,CAAC;AACpB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAqBirsB,CAAC;;;;;;kFAAwmB,CAAC;+HAA2F,CAAC;2GAAuE,CAAC;;;;qGAAoH,CAAC;;;;;;;+BAA+R,CAAC,eAAe,CAAC;;EArB71uB,CAAC;AAmB9B,eAAO,MAAM,WAAW,2IAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,2IAA8C,CAAC"}
|
package/p256.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.encodeToCurve = exports.hashToCurve = exports.secp256r1 = exports.p256 = 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 sha256_1 = require("@noble/hashes/sha256");
|
|
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 secp256r1 aka p256
|
|
11
11
|
// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-256
|
|
12
12
|
const Fp = (0, modular_js_1.Field)(BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'));
|
package/p256.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p256.js","sourceRoot":"","sources":["src/p256.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"p256.js","sourceRoot":"","sources":["src/p256.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,yDAAiD;AACjD,kEAA2D;AAC3D,sDAA8C;AAC9C,8DAAgE;AAEhE,0BAA0B;AAC1B,0EAA0E;AAE1E,MAAM,EAAE,GAAG,IAAA,kBAAK,EAAC,MAAM,CAAC,oEAAoE,CAAC,CAAC,CAAC;AAC/F,MAAM,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,MAAM,OAAO,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE7F,kBAAkB;AACL,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC9B,CAAC,EAAE,OAAO,EAAE,wBAAwB;IACpC,CAAC,EAAE,OAAO;IACV,EAAE,EAAE,yDAAyD;IAC7D,wDAAwD;IACxD,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,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/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"}
|