@noble/curves 0.7.0 → 0.7.2
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 +118 -73
- package/_shortw_utils.d.ts +0 -1
- package/_shortw_utils.d.ts.map +1 -1
- package/abstract/bls.js +1 -1
- package/abstract/bls.js.map +1 -1
- package/abstract/montgomery.d.ts +7 -3
- package/abstract/montgomery.d.ts.map +1 -1
- package/abstract/montgomery.js +10 -7
- package/abstract/montgomery.js.map +1 -1
- package/abstract/weierstrass.d.ts +2 -3
- package/abstract/weierstrass.d.ts.map +1 -1
- package/abstract/weierstrass.js +29 -24
- package/abstract/weierstrass.js.map +1 -1
- package/ed25519.d.ts.map +1 -1
- package/ed25519.js +3 -2
- package/ed25519.js.map +1 -1
- package/ed448.d.ts.map +1 -1
- package/ed448.js +3 -2
- package/ed448.js.map +1 -1
- package/esm/abstract/bls.js +1 -1
- package/esm/abstract/bls.js.map +1 -1
- package/esm/abstract/montgomery.js +10 -7
- package/esm/abstract/montgomery.js.map +1 -1
- package/esm/abstract/weierstrass.js +29 -24
- package/esm/abstract/weierstrass.js.map +1 -1
- package/esm/ed25519.js +3 -2
- package/esm/ed25519.js.map +1 -1
- package/esm/ed448.js +3 -2
- package/esm/ed448.js.map +1 -1
- package/esm/secp256k1.js +11 -1
- package/esm/secp256k1.js.map +1 -1
- package/esm/stark.js +75 -114
- package/esm/stark.js.map +1 -1
- package/p256.d.ts +0 -2
- package/p256.d.ts.map +1 -1
- package/p384.d.ts +0 -2
- package/p384.d.ts.map +1 -1
- package/p521.d.ts +0 -2
- package/p521.d.ts.map +1 -1
- package/package.json +2 -12
- package/secp256k1.d.ts +5 -1
- package/secp256k1.d.ts.map +1 -1
- package/secp256k1.js +11 -1
- package/secp256k1.js.map +1 -1
- package/src/abstract/bls.ts +1 -1
- package/src/abstract/montgomery.ts +15 -10
- package/src/abstract/weierstrass.ts +30 -28
- package/src/ed25519.ts +3 -2
- package/src/ed448.ts +3 -2
- package/src/secp256k1.ts +11 -1
- package/src/stark.ts +92 -130
- package/stark.d.ts +12 -18
- package/stark.d.ts.map +1 -1
- package/stark.js +82 -123
- package/stark.js.map +1 -1
- package/esm/p192.js +0 -22
- package/esm/p192.js.map +0 -1
- package/esm/p224.js +0 -22
- package/esm/p224.js.map +0 -1
- package/p192.d.ts +0 -103
- package/p192.d.ts.map +0 -1
- package/p192.js +0 -25
- package/p192.js.map +0 -1
- package/p224.d.ts +0 -103
- package/p224.d.ts.map +0 -1
- package/p224.js +0 -25
- package/p224.js.map +0 -1
- package/src/p192.ts +0 -25
- package/src/p224.ts +0 -25
package/p224.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
export declare const P224: Readonly<{
|
|
2
|
-
create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
|
|
3
|
-
CURVE: Readonly<{
|
|
4
|
-
readonly nBitLength: number;
|
|
5
|
-
readonly nByteLength: number;
|
|
6
|
-
readonly Fp: import("./abstract/modular.js").Field<bigint>;
|
|
7
|
-
readonly n: bigint;
|
|
8
|
-
readonly h: bigint;
|
|
9
|
-
readonly hEff?: bigint | undefined;
|
|
10
|
-
readonly Gx: bigint;
|
|
11
|
-
readonly Gy: bigint;
|
|
12
|
-
readonly allowInfinityPoint?: boolean | undefined;
|
|
13
|
-
readonly a: bigint;
|
|
14
|
-
readonly b: bigint;
|
|
15
|
-
readonly allowedPrivateKeyLengths?: readonly number[] | undefined;
|
|
16
|
-
readonly wrapPrivateKey?: boolean | undefined;
|
|
17
|
-
readonly endo?: {
|
|
18
|
-
beta: bigint;
|
|
19
|
-
splitScalar: (k: bigint) => {
|
|
20
|
-
k1neg: boolean;
|
|
21
|
-
k1: bigint;
|
|
22
|
-
k2neg: boolean;
|
|
23
|
-
k2: bigint;
|
|
24
|
-
};
|
|
25
|
-
} | undefined;
|
|
26
|
-
readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
|
|
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
|
-
readonly hash: import("./abstract/utils.js").CHash;
|
|
29
|
-
readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
|
|
30
|
-
readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array;
|
|
31
|
-
lowS: boolean;
|
|
32
|
-
readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined;
|
|
33
|
-
readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined;
|
|
34
|
-
}>;
|
|
35
|
-
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array;
|
|
36
|
-
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array;
|
|
37
|
-
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").SignatureType;
|
|
38
|
-
verify: (signature: import("./abstract/utils.js").Hex | {
|
|
39
|
-
r: bigint;
|
|
40
|
-
s: bigint;
|
|
41
|
-
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean;
|
|
42
|
-
ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
|
|
43
|
-
Signature: import("./abstract/weierstrass.js").SignatureConstructor;
|
|
44
|
-
utils: {
|
|
45
|
-
normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
|
|
46
|
-
isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
|
|
47
|
-
hashToPrivateKey: (hash: import("./abstract/utils.js").Hex) => Uint8Array;
|
|
48
|
-
randomPrivateKey: () => Uint8Array;
|
|
49
|
-
precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType<bigint> | undefined) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
|
|
50
|
-
};
|
|
51
|
-
}>;
|
|
52
|
-
export declare const secp224r1: Readonly<{
|
|
53
|
-
create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
|
|
54
|
-
CURVE: Readonly<{
|
|
55
|
-
readonly nBitLength: number;
|
|
56
|
-
readonly nByteLength: number;
|
|
57
|
-
readonly Fp: import("./abstract/modular.js").Field<bigint>;
|
|
58
|
-
readonly n: bigint;
|
|
59
|
-
readonly h: bigint;
|
|
60
|
-
readonly hEff?: bigint | undefined;
|
|
61
|
-
readonly Gx: bigint;
|
|
62
|
-
readonly Gy: bigint;
|
|
63
|
-
readonly allowInfinityPoint?: boolean | undefined;
|
|
64
|
-
readonly a: bigint;
|
|
65
|
-
readonly b: bigint;
|
|
66
|
-
readonly allowedPrivateKeyLengths?: readonly number[] | undefined;
|
|
67
|
-
readonly wrapPrivateKey?: boolean | undefined;
|
|
68
|
-
readonly endo?: {
|
|
69
|
-
beta: bigint;
|
|
70
|
-
splitScalar: (k: bigint) => {
|
|
71
|
-
k1neg: boolean;
|
|
72
|
-
k1: bigint;
|
|
73
|
-
k2neg: boolean;
|
|
74
|
-
k2: bigint;
|
|
75
|
-
};
|
|
76
|
-
} | undefined;
|
|
77
|
-
readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
|
|
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
|
-
readonly hash: import("./abstract/utils.js").CHash;
|
|
80
|
-
readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
|
|
81
|
-
readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array;
|
|
82
|
-
lowS: boolean;
|
|
83
|
-
readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined;
|
|
84
|
-
readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined;
|
|
85
|
-
}>;
|
|
86
|
-
getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array;
|
|
87
|
-
getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array;
|
|
88
|
-
sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").SignatureType;
|
|
89
|
-
verify: (signature: import("./abstract/utils.js").Hex | {
|
|
90
|
-
r: bigint;
|
|
91
|
-
s: bigint;
|
|
92
|
-
}, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean;
|
|
93
|
-
ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
|
|
94
|
-
Signature: import("./abstract/weierstrass.js").SignatureConstructor;
|
|
95
|
-
utils: {
|
|
96
|
-
normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
|
|
97
|
-
isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
|
|
98
|
-
hashToPrivateKey: (hash: import("./abstract/utils.js").Hex) => Uint8Array;
|
|
99
|
-
randomPrivateKey: () => Uint8Array;
|
|
100
|
-
precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType<bigint> | undefined) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
|
|
101
|
-
};
|
|
102
|
-
}>;
|
|
103
|
-
//# sourceMappingURL=p224.d.ts.map
|
package/p224.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"p224.d.ts","sourceRoot":"","sources":["src/p224.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBhB,CAAC;AACF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,CAAC"}
|
package/p224.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.secp224r1 = exports.P224 = void 0;
|
|
4
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
|
-
const _shortw_utils_js_1 = require("./_shortw_utils.js");
|
|
6
|
-
const sha256_1 = require("@noble/hashes/sha256");
|
|
7
|
-
const modular_js_1 = require("./abstract/modular.js");
|
|
8
|
-
// NIST secp224r1 aka P224
|
|
9
|
-
// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-224
|
|
10
|
-
exports.P224 = (0, _shortw_utils_js_1.createCurve)({
|
|
11
|
-
// Params: a, b
|
|
12
|
-
a: BigInt('0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffe'),
|
|
13
|
-
b: BigInt('0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4'),
|
|
14
|
-
// Field over which we'll do calculations;
|
|
15
|
-
Fp: (0, modular_js_1.Fp)(BigInt('0xffffffffffffffffffffffffffffffff000000000000000000000001')),
|
|
16
|
-
// Curve order, total count of valid points in the field
|
|
17
|
-
n: BigInt('0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d'),
|
|
18
|
-
// Base point (x, y) aka generator point
|
|
19
|
-
Gx: BigInt('0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21'),
|
|
20
|
-
Gy: BigInt('0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34'),
|
|
21
|
-
h: BigInt(1),
|
|
22
|
-
lowS: false,
|
|
23
|
-
}, sha256_1.sha224);
|
|
24
|
-
exports.secp224r1 = exports.P224;
|
|
25
|
-
//# sourceMappingURL=p224.js.map
|
package/p224.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"p224.js","sourceRoot":"","sources":["src/p224.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yDAAiD;AACjD,iDAA8C;AAC9C,sDAA2C;AAE3C,0BAA0B;AAC1B,0EAA0E;AAC7D,QAAA,IAAI,GAAG,IAAA,8BAAW,EAC7B;IACE,eAAe;IACf,CAAC,EAAE,MAAM,CAAC,4DAA4D,CAAC;IACvE,CAAC,EAAE,MAAM,CAAC,4DAA4D,CAAC;IACvE,0CAA0C;IAC1C,EAAE,EAAE,IAAA,eAAE,EAAC,MAAM,CAAC,4DAA4D,CAAC,CAAC;IAC5E,wDAAwD;IACxD,CAAC,EAAE,MAAM,CAAC,4DAA4D,CAAC;IACvE,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC,4DAA4D,CAAC;IACxE,EAAE,EAAE,MAAM,CAAC,4DAA4D,CAAC;IACxE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,KAAK;CACH,EACV,eAAM,CACP,CAAC;AACW,QAAA,SAAS,GAAG,YAAI,CAAC"}
|
package/src/p192.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2
|
-
import { createCurve } from './_shortw_utils.js';
|
|
3
|
-
import { sha256 } from '@noble/hashes/sha256';
|
|
4
|
-
import { Fp } from './abstract/modular.js';
|
|
5
|
-
|
|
6
|
-
// NIST secp192r1 aka P192
|
|
7
|
-
// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/secg/secp192r1
|
|
8
|
-
export const P192 = createCurve(
|
|
9
|
-
{
|
|
10
|
-
// Params: a, b
|
|
11
|
-
a: BigInt('0xfffffffffffffffffffffffffffffffefffffffffffffffc'),
|
|
12
|
-
b: BigInt('0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1'),
|
|
13
|
-
// Field over which we'll do calculations; 2n ** 192n - 2n ** 64n - 1n
|
|
14
|
-
Fp: Fp(BigInt('0xfffffffffffffffffffffffffffffffeffffffffffffffff')),
|
|
15
|
-
// Curve order, total count of valid points in the field.
|
|
16
|
-
n: BigInt('0xffffffffffffffffffffffff99def836146bc9b1b4d22831'),
|
|
17
|
-
// Base point (x, y) aka generator point
|
|
18
|
-
Gx: BigInt('0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012'),
|
|
19
|
-
Gy: BigInt('0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811'),
|
|
20
|
-
h: BigInt(1),
|
|
21
|
-
lowS: false,
|
|
22
|
-
} as const,
|
|
23
|
-
sha256
|
|
24
|
-
);
|
|
25
|
-
export const secp192r1 = P192;
|
package/src/p224.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2
|
-
import { createCurve } from './_shortw_utils.js';
|
|
3
|
-
import { sha224 } from '@noble/hashes/sha256';
|
|
4
|
-
import { Fp } from './abstract/modular.js';
|
|
5
|
-
|
|
6
|
-
// NIST secp224r1 aka P224
|
|
7
|
-
// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-224
|
|
8
|
-
export const P224 = createCurve(
|
|
9
|
-
{
|
|
10
|
-
// Params: a, b
|
|
11
|
-
a: BigInt('0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffe'),
|
|
12
|
-
b: BigInt('0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4'),
|
|
13
|
-
// Field over which we'll do calculations;
|
|
14
|
-
Fp: Fp(BigInt('0xffffffffffffffffffffffffffffffff000000000000000000000001')),
|
|
15
|
-
// Curve order, total count of valid points in the field
|
|
16
|
-
n: BigInt('0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d'),
|
|
17
|
-
// Base point (x, y) aka generator point
|
|
18
|
-
Gx: BigInt('0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21'),
|
|
19
|
-
Gy: BigInt('0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34'),
|
|
20
|
-
h: BigInt(1),
|
|
21
|
-
lowS: false,
|
|
22
|
-
} as const,
|
|
23
|
-
sha224
|
|
24
|
-
);
|
|
25
|
-
export const secp224r1 = P224;
|