@noble/curves 1.4.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -128
- package/_shortw_utils.d.ts.map +1 -1
- package/abstract/bls.d.ts +37 -34
- package/abstract/bls.d.ts.map +1 -1
- package/abstract/bls.js +167 -115
- package/abstract/bls.js.map +1 -1
- package/abstract/curve.d.ts +14 -1
- package/abstract/curve.d.ts.map +1 -1
- package/abstract/curve.js +77 -7
- package/abstract/curve.js.map +1 -1
- package/abstract/edwards.d.ts +12 -0
- package/abstract/edwards.d.ts.map +1 -1
- package/abstract/edwards.js +84 -75
- package/abstract/edwards.js.map +1 -1
- package/abstract/hash-to-curve.d.ts.map +1 -1
- package/abstract/hash-to-curve.js +4 -2
- package/abstract/hash-to-curve.js.map +1 -1
- package/abstract/modular.d.ts +4 -0
- package/abstract/modular.d.ts.map +1 -1
- package/abstract/modular.js +13 -2
- package/abstract/modular.js.map +1 -1
- package/abstract/montgomery.d.ts.map +1 -1
- package/abstract/montgomery.js +4 -9
- package/abstract/montgomery.js.map +1 -1
- package/abstract/tower.d.ts +107 -0
- package/abstract/tower.d.ts.map +1 -0
- package/abstract/tower.js +498 -0
- package/abstract/tower.js.map +1 -0
- package/abstract/utils.d.ts +17 -0
- package/abstract/utils.d.ts.map +1 -1
- package/abstract/utils.js +50 -1
- package/abstract/utils.js.map +1 -1
- package/abstract/weierstrass.d.ts +25 -3
- package/abstract/weierstrass.d.ts.map +1 -1
- package/abstract/weierstrass.js +189 -113
- package/abstract/weierstrass.js.map +1 -1
- package/bls12-381.d.ts +1 -65
- package/bls12-381.d.ts.map +1 -1
- package/bls12-381.js +48 -575
- package/bls12-381.js.map +1 -1
- package/bn254.d.ts +10 -6
- package/bn254.d.ts.map +1 -1
- package/bn254.js +207 -10
- package/bn254.js.map +1 -1
- package/ed25519.d.ts +7 -4
- package/ed25519.d.ts.map +1 -1
- package/ed25519.js +3 -0
- package/ed25519.js.map +1 -1
- package/esm/_shortw_utils.d.ts.map +1 -1
- package/esm/abstract/bls.d.ts +37 -34
- package/esm/abstract/bls.d.ts.map +1 -1
- package/esm/abstract/bls.js +168 -116
- package/esm/abstract/bls.js.map +1 -1
- package/esm/abstract/curve.d.ts +14 -1
- package/esm/abstract/curve.d.ts.map +1 -1
- package/esm/abstract/curve.js +77 -8
- package/esm/abstract/curve.js.map +1 -1
- package/esm/abstract/edwards.d.ts +12 -0
- package/esm/abstract/edwards.d.ts.map +1 -1
- package/esm/abstract/edwards.js +87 -78
- package/esm/abstract/edwards.js.map +1 -1
- package/esm/abstract/hash-to-curve.d.ts.map +1 -1
- package/esm/abstract/hash-to-curve.js +4 -2
- package/esm/abstract/hash-to-curve.js.map +1 -1
- package/esm/abstract/modular.d.ts +4 -0
- package/esm/abstract/modular.d.ts.map +1 -1
- package/esm/abstract/modular.js +12 -2
- package/esm/abstract/modular.js.map +1 -1
- package/esm/abstract/montgomery.d.ts.map +1 -1
- package/esm/abstract/montgomery.js +5 -10
- package/esm/abstract/montgomery.js.map +1 -1
- package/esm/abstract/tower.d.ts +107 -0
- package/esm/abstract/tower.d.ts.map +1 -0
- package/esm/abstract/tower.js +494 -0
- package/esm/abstract/tower.js.map +1 -0
- package/esm/abstract/utils.d.ts +17 -0
- package/esm/abstract/utils.d.ts.map +1 -1
- package/esm/abstract/utils.js +44 -0
- package/esm/abstract/utils.js.map +1 -1
- package/esm/abstract/weierstrass.d.ts +25 -3
- package/esm/abstract/weierstrass.d.ts.map +1 -1
- package/esm/abstract/weierstrass.js +191 -115
- package/esm/abstract/weierstrass.js.map +1 -1
- package/esm/bls12-381.d.ts +1 -65
- package/esm/bls12-381.d.ts.map +1 -1
- package/esm/bls12-381.js +50 -577
- package/esm/bls12-381.js.map +1 -1
- package/esm/bn254.d.ts +10 -6
- package/esm/bn254.d.ts.map +1 -1
- package/esm/bn254.js +206 -9
- package/esm/bn254.js.map +1 -1
- package/esm/ed25519.d.ts +7 -4
- package/esm/ed25519.d.ts.map +1 -1
- package/esm/ed25519.js +3 -0
- package/esm/ed25519.js.map +1 -1
- package/esm/jubjub.d.ts.map +1 -1
- package/esm/jubjub.js +8 -2
- package/esm/jubjub.js.map +1 -1
- package/esm/p256.d.ts.map +1 -1
- package/esm/p384.d.ts.map +1 -1
- package/esm/p521.d.ts.map +1 -1
- package/esm/secp256k1.d.ts +6 -0
- package/esm/secp256k1.d.ts.map +1 -1
- package/esm/secp256k1.js +17 -13
- package/esm/secp256k1.js.map +1 -1
- package/jubjub.d.ts.map +1 -1
- package/jubjub.js +8 -2
- package/jubjub.js.map +1 -1
- package/p256.d.ts.map +1 -1
- package/p384.d.ts.map +1 -1
- package/p521.d.ts.map +1 -1
- package/package.json +27 -19
- package/secp256k1.d.ts +6 -0
- package/secp256k1.d.ts.map +1 -1
- package/secp256k1.js +16 -12
- package/secp256k1.js.map +1 -1
- package/src/abstract/bls.ts +222 -168
- package/src/abstract/curve.ts +80 -8
- package/src/abstract/edwards.ts +97 -70
- package/src/abstract/hash-to-curve.ts +3 -1
- package/src/abstract/modular.ts +13 -3
- package/src/abstract/montgomery.ts +11 -10
- package/src/abstract/tower.ts +605 -0
- package/src/abstract/utils.ts +49 -0
- package/src/abstract/weierstrass.ts +179 -104
- package/src/bls12-381.ts +53 -707
- package/src/bn254.ts +224 -9
- package/src/ed25519.ts +5 -2
- package/src/jubjub.ts +7 -2
- package/src/secp256k1.ts +24 -12
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Audited & minimal JS implementation of elliptic curve cryptography.
|
|
4
4
|
|
|
5
|
-
- 🔒 [**Audited**](#security) by
|
|
5
|
+
- 🔒 [**Audited**](#security) by independent security firms
|
|
6
6
|
- 🔻 Tree-shakeable: unused code is excluded from your builds
|
|
7
7
|
- 🏎 Fast: hand-optimized for caveats of JS engines
|
|
8
8
|
- 🔍 Reliable: property-based / cross-library / wycheproof tests and fuzzing ensure correctness
|
|
@@ -10,11 +10,9 @@ Audited & minimal JS implementation of elliptic curve cryptography.
|
|
|
10
10
|
- ✍️ ECDSA, EdDSA, Schnorr, BLS signature schemes, ECDH key agreement, hashing to curves
|
|
11
11
|
- 🔖 SUF-CMA, SBS (non-repudiation), ZIP215 (consensus friendliness) features for ed25519
|
|
12
12
|
- 🧜♂️ Poseidon ZK-friendly hash
|
|
13
|
-
- 🪶
|
|
13
|
+
- 🪶 190KB (92KB gzipped) for everything with hashes, 22KB (10KB gzipped) for single-curve build
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
[GitHub Discussions](https://github.com/paulmillr/noble-curves/discussions)
|
|
17
|
-
section of the repository.
|
|
15
|
+
Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-curves/discussions) for questions and support.
|
|
18
16
|
|
|
19
17
|
### This library belongs to _noble_ cryptography
|
|
20
18
|
|
|
@@ -45,17 +43,19 @@ A standalone file [noble-curves.js](https://github.com/paulmillr/noble-curves/re
|
|
|
45
43
|
```js
|
|
46
44
|
// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size
|
|
47
45
|
import { secp256k1 } from '@noble/curves/secp256k1'; // ESM and Common.js
|
|
48
|
-
// import { secp256k1 } from 'npm:@noble/curves@1.
|
|
46
|
+
// import { secp256k1 } from 'npm:@noble/curves@1.6.0/secp256k1'; // Deno
|
|
49
47
|
```
|
|
50
48
|
|
|
51
49
|
- [Implementations](#implementations)
|
|
52
|
-
- [ECDSA
|
|
50
|
+
- [ECDSA signatures over secp256k1 and others](#ecdsa-signatures-over-secp256k1-and-others)
|
|
53
51
|
- [ECDSA public key recovery & extra entropy](#ecdsa-public-key-recovery--extra-entropy)
|
|
54
52
|
- [ECDH: Elliptic Curve Diffie-Hellman](#ecdh-elliptic-curve-diffie-hellman)
|
|
55
53
|
- [Schnorr signatures over secp256k1, BIP340](#schnorr-signatures-over-secp256k1-bip340)
|
|
56
54
|
- [ed25519, X25519, ristretto255](#ed25519-x25519-ristretto255)
|
|
57
55
|
- [ed448, X448, decaf448](#ed448-x448-decaf448)
|
|
58
56
|
- [bls12-381](#bls12-381)
|
|
57
|
+
- [bn254 aka alt_bn128](#bn254-aka-alt_bn128)
|
|
58
|
+
- [Multi-scalar-multiplication](#multi-scalar-multiplication)
|
|
59
59
|
- [All available imports](#all-available-imports)
|
|
60
60
|
- [Accessing a curve's variables](#accessing-a-curves-variables)
|
|
61
61
|
- [Abstract API](#abstract-api)
|
|
@@ -79,24 +79,24 @@ import { secp256k1 } from '@noble/curves/secp256k1'; // ESM and Common.js
|
|
|
79
79
|
Implementations use [noble-hashes](https://github.com/paulmillr/noble-hashes).
|
|
80
80
|
If you want to use a different hashing library, [abstract API](#abstract-api) doesn't depend on them.
|
|
81
81
|
|
|
82
|
-
#### ECDSA
|
|
83
|
-
|
|
84
|
-
Generic example that works for all curves, shown for secp256k1:
|
|
82
|
+
#### ECDSA signatures over secp256k1 and others
|
|
85
83
|
|
|
86
84
|
```ts
|
|
87
85
|
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
86
|
+
// import { p256 } from '@noble/curves/p256'; // or p384 / p521
|
|
87
|
+
|
|
88
88
|
const priv = secp256k1.utils.randomPrivateKey();
|
|
89
89
|
const pub = secp256k1.getPublicKey(priv);
|
|
90
90
|
const msg = new Uint8Array(32).fill(1); // message hash (not message) in ecdsa
|
|
91
91
|
const sig = secp256k1.sign(msg, priv); // `{prehash: true}` option is available
|
|
92
92
|
const isValid = secp256k1.verify(sig, msg, pub) === true;
|
|
93
93
|
|
|
94
|
-
// hex strings are also supported besides
|
|
94
|
+
// hex strings are also supported besides Uint8Array-s:
|
|
95
95
|
const privHex = '46c930bc7bb4db7f55da20798697421b98c4175a52c630294d75a84b9c126236';
|
|
96
96
|
const pub2 = secp256k1.getPublicKey(privHex);
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
The same code would work for NIST P256 (secp256r1), P384 (secp384r1) & P521 (secp521r1).
|
|
100
100
|
|
|
101
101
|
#### ECDSA public key recovery & extra entropy
|
|
102
102
|
|
|
@@ -246,7 +246,82 @@ Same RFC7748 / RFC8032 / IRTF draft are followed.
|
|
|
246
246
|
|
|
247
247
|
#### bls12-381
|
|
248
248
|
|
|
249
|
+
```ts
|
|
250
|
+
import { bls12_381 as bls } from '@noble/curves/bls12-381';
|
|
251
|
+
|
|
252
|
+
// G1 keys, G2 signatures
|
|
253
|
+
const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c';
|
|
254
|
+
const message = '64726e3da8';
|
|
255
|
+
const publicKey = bls.getPublicKey(privateKey);
|
|
256
|
+
const signature = bls.sign(message, privateKey);
|
|
257
|
+
const isValid = bls.verify(signature, message, publicKey);
|
|
258
|
+
console.log({ publicKey, signature, isValid });
|
|
259
|
+
|
|
260
|
+
// G2 signatures, G1 keys
|
|
261
|
+
// getPublicKeyForShortSignatures(privateKey)
|
|
262
|
+
// signShortSignature(message, privateKey)
|
|
263
|
+
// verifyShortSignature(signature, message, publicKey)
|
|
264
|
+
// aggregateShortSignatures(signatures)
|
|
265
|
+
|
|
266
|
+
// Custom DST
|
|
267
|
+
const htfEthereum = { DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_' };
|
|
268
|
+
const signatureEth = bls.sign(message, privateKey, htfEthereum);
|
|
269
|
+
const isValidEth = bls.verify(signature, message, publicKey, htfEthereum);
|
|
270
|
+
|
|
271
|
+
// Aggregation
|
|
272
|
+
const aggregatedKey = bls.aggregatePublicKeys([bls.utils.randomPrivateKey(), bls.utils.randomPrivateKey()])
|
|
273
|
+
// const aggregatedSig = bls.aggregateSignatures(sigs)
|
|
274
|
+
|
|
275
|
+
// Pairings, with and without final exponentiation
|
|
276
|
+
// bls.pairing(PointG1, PointG2);
|
|
277
|
+
// bls.pairing(PointG1, PointG2, false);
|
|
278
|
+
// bls.fields.Fp12.finalExponentiate(bls.fields.Fp12.mul(PointG1, PointG2));
|
|
279
|
+
|
|
280
|
+
// Others
|
|
281
|
+
// bls.G1.ProjectivePoint.BASE, bls.G2.ProjectivePoint.BASE;
|
|
282
|
+
// bls.fields.Fp, bls.fields.Fp2, bls.fields.Fp12, bls.fields.Fr;
|
|
283
|
+
```
|
|
284
|
+
|
|
249
285
|
See [abstract/bls](#bls-barreto-lynn-scott-curves).
|
|
286
|
+
For example usage, check out [the implementation of BLS EVM precompiles](https://github.com/ethereumjs/ethereumjs-monorepo/blob/361f4edbc239e795a411ac2da7e5567298b9e7e5/packages/evm/src/precompiles/bls12_381/noble.ts).
|
|
287
|
+
|
|
288
|
+
#### bn254 aka alt_bn128
|
|
289
|
+
|
|
290
|
+
```ts
|
|
291
|
+
import { bn254 } from '@noble/curves/bn254';
|
|
292
|
+
|
|
293
|
+
console.log(
|
|
294
|
+
bn254.G1,
|
|
295
|
+
bn254.G2,
|
|
296
|
+
bn254.pairing
|
|
297
|
+
)
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
The API mirrors [BLS](#bls12-381). The curve was previously called alt_bn128.
|
|
301
|
+
The implementation is compatible with [EIP-196](https://eips.ethereum.org/EIPS/eip-196) and
|
|
302
|
+
[EIP-197](https://eips.ethereum.org/EIPS/eip-197).
|
|
303
|
+
|
|
304
|
+
Keep in mind that we don't implement Point methods toHex / toRawBytes. It's because
|
|
305
|
+
different implementations of bn254 do it differently - there is no standard. Points of divergence:
|
|
306
|
+
|
|
307
|
+
- Endianness: LE vs BE (byte-swapped)
|
|
308
|
+
- Flags as first hex bits (similar to BLS) vs no-flags
|
|
309
|
+
- Imaginary part last in G2 vs first (c0, c1 vs c1, c0)
|
|
310
|
+
|
|
311
|
+
For example usage, check out [the implementation of bn254 EVM precompiles](https://github.com/paulmillr/noble-curves/blob/3ed792f8ad9932765b84d1064afea8663a255457/test/bn254.test.js#L697).
|
|
312
|
+
|
|
313
|
+
#### Multi-scalar-multiplication
|
|
314
|
+
|
|
315
|
+
```ts
|
|
316
|
+
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
317
|
+
const p = secp256k1.ProjectivePoint;
|
|
318
|
+
const points = [p.BASE, p.BASE.multiply(2n), p.BASE.multiply(4n), p.BASE.multiply(8n)];
|
|
319
|
+
p.msm(points, [3n, 5n, 7n, 11n]).equals(p.BASE.multiply(129n)); // 129*G
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Pippenger algorithm is used underneath.
|
|
323
|
+
Multi-scalar-multiplication (MSM) is basically `(Pa + Qb + Rc + ...)`.
|
|
324
|
+
It's 10-30x faster vs naive addition for large amount of points.
|
|
250
325
|
|
|
251
326
|
#### All available imports
|
|
252
327
|
|
|
@@ -399,6 +474,7 @@ interface ProjConstructor<T> extends GroupConstructor<ProjPointType<T>> {
|
|
|
399
474
|
fromAffine(p: AffinePoint<T>): ProjPointType<T>;
|
|
400
475
|
fromHex(hex: Hex): ProjPointType<T>;
|
|
401
476
|
fromPrivateKey(privateKey: PrivKey): ProjPointType<T>;
|
|
477
|
+
msm(points: ProjPointType[], scalars: bigint[]): ProjPointType<T>;
|
|
402
478
|
}
|
|
403
479
|
```
|
|
404
480
|
|
|
@@ -551,6 +627,7 @@ interface ExtPointConstructor extends GroupConstructor<ExtPointType> {
|
|
|
551
627
|
fromAffine(p: AffinePoint<bigint>): ExtPointType;
|
|
552
628
|
fromHex(hex: Hex): ExtPointType;
|
|
553
629
|
fromPrivateKey(privateKey: Hex): ExtPointType;
|
|
630
|
+
msm(points: ExtPointType[], scalars: bigint[]): ExtPointType;
|
|
554
631
|
}
|
|
555
632
|
```
|
|
556
633
|
|
|
@@ -590,75 +667,11 @@ use aggregated, batch-verifiable
|
|
|
590
667
|
using Boneh-Lynn-Shacham signature scheme.
|
|
591
668
|
|
|
592
669
|
The module doesn't expose `CURVE` property: use `G1.CURVE`, `G2.CURVE` instead.
|
|
593
|
-
Only BLS12-381 is implemented
|
|
670
|
+
Only BLS12-381 is currently implemented.
|
|
594
671
|
Defining BLS12-377 and BLS24 should be straightforward.
|
|
595
672
|
|
|
596
|
-
Main methods and properties are:
|
|
597
|
-
|
|
598
|
-
- `getPublicKey(privateKey)`
|
|
599
|
-
- `sign(message, privateKey)`
|
|
600
|
-
- `verify(signature, message, publicKey)`
|
|
601
|
-
- `aggregatePublicKeys(publicKeys)`
|
|
602
|
-
- `aggregateSignatures(signatures)`
|
|
603
|
-
- `G1` and `G2` curves containing `CURVE` and `ProjectivePoint`
|
|
604
|
-
- `Signature` property with `fromHex`, `toHex` methods
|
|
605
|
-
- `fields` containing `Fp`, `Fp2`, `Fp6`, `Fp12`, `Fr`
|
|
606
|
-
|
|
607
673
|
The default BLS uses short public keys (with public keys in G1 and signatures in G2).
|
|
608
|
-
Short signatures (public keys in G2 and signatures in G1)
|
|
609
|
-
|
|
610
|
-
- `getPublicKeyForShortSignatures(privateKey)`
|
|
611
|
-
- `signShortSignature(message, privateKey)`
|
|
612
|
-
- `verifyShortSignature(signature, message, publicKey)`
|
|
613
|
-
- `aggregateShortSignatures(signatures)`
|
|
614
|
-
|
|
615
|
-
```ts
|
|
616
|
-
import { bls12_381 as bls } from '@noble/curves/bls12-381';
|
|
617
|
-
const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c';
|
|
618
|
-
const message = '64726e3da8';
|
|
619
|
-
const publicKey = bls.getPublicKey(privateKey);
|
|
620
|
-
const signature = bls.sign(message, privateKey);
|
|
621
|
-
const isValid = bls.verify(signature, message, publicKey);
|
|
622
|
-
console.log({ publicKey, signature, isValid });
|
|
623
|
-
|
|
624
|
-
// Use custom DST, e.g. for Ethereum consensus layer
|
|
625
|
-
const htfEthereum = { DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_' };
|
|
626
|
-
const signatureEth = bls.sign(message, privateKey, htfEthereum);
|
|
627
|
-
const isValidEth = bls.verify(signature, message, publicKey, htfEthereum);
|
|
628
|
-
console.log({ signatureEth, isValidEth });
|
|
629
|
-
|
|
630
|
-
// Sign 1 msg with 3 keys
|
|
631
|
-
const privateKeys = [
|
|
632
|
-
'18f020b98eb798752a50ed0563b079c125b0db5dd0b1060d1c1b47d4a193e1e4',
|
|
633
|
-
'ed69a8c50cf8c9836be3b67c7eeff416612d45ba39a5c099d48fa668bf558c9c',
|
|
634
|
-
'16ae669f3be7a2121e17d0c68c05a8f3d6bef21ec0f2315f1d7aec12484e4cf5',
|
|
635
|
-
];
|
|
636
|
-
const messages = ['d2', '0d98', '05caf3'];
|
|
637
|
-
const publicKeys = privateKeys.map(bls.getPublicKey);
|
|
638
|
-
const signatures2 = privateKeys.map((p) => bls.sign(message, p));
|
|
639
|
-
const aggPubKey2 = bls.aggregatePublicKeys(publicKeys);
|
|
640
|
-
const aggSignature2 = bls.aggregateSignatures(signatures2);
|
|
641
|
-
const isValid2 = bls.verify(aggSignature2, message, aggPubKey2);
|
|
642
|
-
console.log({ signatures2, aggSignature2, isValid2 });
|
|
643
|
-
|
|
644
|
-
// Sign 3 msgs with 3 keys
|
|
645
|
-
const signatures3 = privateKeys.map((p, i) => bls.sign(messages[i], p));
|
|
646
|
-
const aggSignature3 = bls.aggregateSignatures(signatures3);
|
|
647
|
-
const isValid3 = bls.verifyBatch(aggSignature3, messages, publicKeys);
|
|
648
|
-
console.log({ publicKeys, signatures3, aggSignature3, isValid3 });
|
|
649
|
-
|
|
650
|
-
// Pairings, with and without final exponentiation
|
|
651
|
-
bls.pairing(PointG1, PointG2);
|
|
652
|
-
bls.pairing(PointG1, PointG2, false);
|
|
653
|
-
bls.fields.Fp12.finalExponentiate(bls.fields.Fp12.mul(PointG1, PointG2));
|
|
654
|
-
|
|
655
|
-
// Others
|
|
656
|
-
bls.G1.ProjectivePoint.BASE, bls.G2.ProjectivePoint.BASE;
|
|
657
|
-
bls.fields.Fp, bls.fields.Fp2, bls.fields.Fp12, bls.fields.Fr;
|
|
658
|
-
bls.params.x, bls.params.r, bls.params.G1b, bls.params.G2b;
|
|
659
|
-
|
|
660
|
-
// hash-to-curve examples can be seen below
|
|
661
|
-
```
|
|
674
|
+
Short signatures (public keys in G2 and signatures in G1) are also supported.
|
|
662
675
|
|
|
663
676
|
### hash-to-curve: Hashing strings to curve points
|
|
664
677
|
|
|
@@ -816,6 +829,11 @@ utils.equalBytes(Uint8Array.from([0xde]), Uint8Array.from([0xde]));
|
|
|
816
829
|
|
|
817
830
|
The library has been independently audited:
|
|
818
831
|
|
|
832
|
+
- at version 1.6.0, in Sep 2024, by [cure53](https://cure53.de)
|
|
833
|
+
- PDFs: [in-repo](./audit/2024-09-cure53-audit-nbl4.pdf)
|
|
834
|
+
- [Changes since audit](https://github.com/paulmillr/noble-curves/compare/1.6.0..main)
|
|
835
|
+
- Scope: ed25519, ed448, their add-ons, bls12-381, bn254,
|
|
836
|
+
hash-to-curve, low-level primitives bls, tower, edwards, montgomery etc.
|
|
819
837
|
- at version 1.2.0, in Sep 2023, by [Kudelski Security](https://kudelskisecurity.com)
|
|
820
838
|
- PDFs: [offline](./audit/2023-09-kudelski-audit-starknet.pdf)
|
|
821
839
|
- [Changes since audit](https://github.com/paulmillr/noble-curves/compare/1.2.0..main)
|
|
@@ -871,74 +889,87 @@ is even worse: there is no reliable userspace source of quality entropy.
|
|
|
871
889
|
|
|
872
890
|
## Speed
|
|
873
891
|
|
|
874
|
-
Benchmark results on Apple M2 with node
|
|
892
|
+
Benchmark results on Apple M2 with node v22:
|
|
875
893
|
|
|
876
894
|
```
|
|
877
895
|
secp256k1
|
|
878
896
|
init x 68 ops/sec @ 14ms/op
|
|
879
|
-
getPublicKey x 6,
|
|
880
|
-
sign x 5,
|
|
881
|
-
verify x
|
|
882
|
-
getSharedSecret x
|
|
883
|
-
recoverPublicKey x
|
|
884
|
-
schnorr.sign x
|
|
885
|
-
schnorr.verify x
|
|
897
|
+
getPublicKey x 6,839 ops/sec @ 146μs/op
|
|
898
|
+
sign x 5,226 ops/sec @ 191μs/op
|
|
899
|
+
verify x 893 ops/sec @ 1ms/op
|
|
900
|
+
getSharedSecret x 538 ops/sec @ 1ms/op
|
|
901
|
+
recoverPublicKey x 923 ops/sec @ 1ms/op
|
|
902
|
+
schnorr.sign x 700 ops/sec @ 1ms/op
|
|
903
|
+
schnorr.verify x 919 ops/sec @ 1ms/op
|
|
904
|
+
|
|
905
|
+
ed25519
|
|
906
|
+
init x 51 ops/sec @ 19ms/op
|
|
907
|
+
getPublicKey x 9,809 ops/sec @ 101μs/op
|
|
908
|
+
sign x 4,976 ops/sec @ 200μs/op
|
|
909
|
+
verify x 1,018 ops/sec @ 981μs/op
|
|
910
|
+
|
|
911
|
+
ed448
|
|
912
|
+
init x 19 ops/sec @ 50ms/op
|
|
913
|
+
getPublicKey x 3,723 ops/sec @ 268μs/op
|
|
914
|
+
sign x 1,759 ops/sec @ 568μs/op
|
|
915
|
+
verify x 344 ops/sec @ 2ms/op
|
|
886
916
|
|
|
887
917
|
p256
|
|
888
|
-
init x
|
|
889
|
-
getPublicKey x 6,
|
|
890
|
-
sign x 5,
|
|
891
|
-
verify x
|
|
918
|
+
init x 39 ops/sec @ 25ms/op
|
|
919
|
+
getPublicKey x 6,518 ops/sec @ 153μs/op
|
|
920
|
+
sign x 5,148 ops/sec @ 194μs/op
|
|
921
|
+
verify x 609 ops/sec @ 1ms/op
|
|
892
922
|
|
|
893
923
|
p384
|
|
894
924
|
init x 17 ops/sec @ 57ms/op
|
|
895
|
-
getPublicKey x 2,
|
|
896
|
-
sign x 2,
|
|
897
|
-
verify x
|
|
925
|
+
getPublicKey x 2,933 ops/sec @ 340μs/op
|
|
926
|
+
sign x 2,327 ops/sec @ 429μs/op
|
|
927
|
+
verify x 244 ops/sec @ 4ms/op
|
|
898
928
|
|
|
899
929
|
p521
|
|
900
|
-
init x
|
|
901
|
-
getPublicKey x 1,
|
|
902
|
-
sign x 1,
|
|
903
|
-
verify x
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
930
|
+
init x 8 ops/sec @ 112ms/op
|
|
931
|
+
getPublicKey x 1,484 ops/sec @ 673μs/op
|
|
932
|
+
sign x 1,264 ops/sec @ 790μs/op
|
|
933
|
+
verify x 124 ops/sec @ 8ms/op
|
|
934
|
+
|
|
935
|
+
ristretto255
|
|
936
|
+
add x 680,735 ops/sec @ 1μs/op
|
|
937
|
+
multiply x 10,766 ops/sec @ 92μs/op
|
|
938
|
+
encode x 15,835 ops/sec @ 63μs/op
|
|
939
|
+
decode x 15,972 ops/sec @ 62μs/op
|
|
940
|
+
|
|
941
|
+
decaf448
|
|
942
|
+
add x 345,303 ops/sec @ 2μs/op
|
|
943
|
+
multiply x 300 ops/sec @ 3ms/op
|
|
944
|
+
encode x 5,987 ops/sec @ 167μs/op
|
|
945
|
+
decode x 5,892 ops/sec @ 169μs/op
|
|
916
946
|
|
|
917
947
|
ecdh
|
|
918
|
-
├─x25519 x 1,
|
|
919
|
-
├─secp256k1 x
|
|
920
|
-
├─p256 x
|
|
921
|
-
├─p384 x
|
|
922
|
-
├─p521 x
|
|
923
|
-
└─x448 x
|
|
948
|
+
├─x25519 x 1,477 ops/sec @ 676μs/op
|
|
949
|
+
├─secp256k1 x 537 ops/sec @ 1ms/op
|
|
950
|
+
├─p256 x 512 ops/sec @ 1ms/op
|
|
951
|
+
├─p384 x 198 ops/sec @ 5ms/op
|
|
952
|
+
├─p521 x 99 ops/sec @ 10ms/op
|
|
953
|
+
└─x448 x 504 ops/sec @ 1ms/op
|
|
924
954
|
|
|
925
955
|
bls12-381
|
|
926
956
|
init x 36 ops/sec @ 27ms/op
|
|
927
|
-
getPublicKey
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
957
|
+
getPublicKey x 960 ops/sec @ 1ms/op
|
|
958
|
+
sign x 60 ops/sec @ 16ms/op
|
|
959
|
+
verify x 47 ops/sec @ 21ms/op
|
|
960
|
+
pairing x 125 ops/sec @ 7ms/op
|
|
961
|
+
pairing10 x 40 ops/sec @ 24ms/op ± 23.27% (min: 21ms, max: 48ms)
|
|
962
|
+
MSM 4096 scalars x points x 0 ops/sec @ 4655ms/op
|
|
932
963
|
aggregatePublicKeys/8 x 129 ops/sec @ 7ms/op
|
|
933
964
|
aggregatePublicKeys/32 x 34 ops/sec @ 28ms/op
|
|
934
|
-
aggregatePublicKeys/128 x 8 ops/sec @
|
|
935
|
-
aggregatePublicKeys/512 x 2 ops/sec @
|
|
936
|
-
aggregatePublicKeys/2048 x 0 ops/sec @
|
|
937
|
-
aggregateSignatures/8 x
|
|
938
|
-
aggregateSignatures/32 x
|
|
939
|
-
aggregateSignatures/128 x
|
|
940
|
-
aggregateSignatures/512 x
|
|
941
|
-
aggregateSignatures/2048 x 0 ops/sec @
|
|
965
|
+
aggregatePublicKeys/128 x 8 ops/sec @ 113ms/op
|
|
966
|
+
aggregatePublicKeys/512 x 2 ops/sec @ 449ms/op
|
|
967
|
+
aggregatePublicKeys/2048 x 0 ops/sec @ 1792ms/op
|
|
968
|
+
aggregateSignatures/8 x 62 ops/sec @ 15ms/op
|
|
969
|
+
aggregateSignatures/32 x 16 ops/sec @ 60ms/op
|
|
970
|
+
aggregateSignatures/128 x 4 ops/sec @ 238ms/op
|
|
971
|
+
aggregateSignatures/512 x 1 ops/sec @ 946ms/op
|
|
972
|
+
aggregateSignatures/2048 x 0 ops/sec @ 3774ms/op
|
|
942
973
|
|
|
943
974
|
hash-to-curve
|
|
944
975
|
hash_to_field x 91,600 ops/sec @ 10μs/op
|
package/_shortw_utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shortw_utils.d.ts","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAe,MAAM,2BAA2B,CAAC;AAGnE,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK;;gBAGnB,UAAU,WAAW,UAAU,EAAE;;EAGhD;AAED,KAAK,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC;AAC3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK;mBACtC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"_shortw_utils.d.ts","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAe,MAAM,2BAA2B,CAAC;AAGnE,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK;;gBAGnB,UAAU,WAAW,UAAU,EAAE;;EAGhD;AAED,KAAK,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC;AAC3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK;mBACtC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAG01zB,CAAC;;;;;;kFAAwmB,CAAC;+HAA2F,CAAC;2GAAuE,CAAC;;;;qGAAoH,CAAC;;;;;;;+BAA+R,CAAC,eAAe,CAAC;;GADzi2B"}
|
package/abstract/bls.d.ts
CHANGED
|
@@ -1,47 +1,37 @@
|
|
|
1
1
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2
|
-
import { AffinePoint } from './curve.js';
|
|
3
2
|
import { IField } from './modular.js';
|
|
4
3
|
import { Hex, PrivKey, CHash } from './utils.js';
|
|
5
4
|
import { MapToCurve, Opts as HTFOpts, htfBasicOpts, createHasher } from './hash-to-curve.js';
|
|
6
5
|
import { CurvePointsType, ProjPointType as ProjPointType, CurvePointsRes } from './weierstrass.js';
|
|
6
|
+
import type { Fp2, Fp6, Fp12, Fp2Bls, Fp12Bls } from './tower.js';
|
|
7
7
|
/**
|
|
8
|
-
* BLS
|
|
9
|
-
*
|
|
8
|
+
* BLS != BLS.
|
|
9
|
+
* The file implements BLS (Boneh-Lynn-Shacham) signatures.
|
|
10
|
+
* Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig)
|
|
11
|
+
* families of pairing-friendly curves.
|
|
10
12
|
* Consists of two curves: G1 and G2:
|
|
11
13
|
* - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4.
|
|
12
14
|
* - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1
|
|
13
15
|
* - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in
|
|
14
16
|
* Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not.
|
|
15
17
|
* Pairing is used to aggregate and verify signatures.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
+
* There are two main ways to use it:
|
|
19
|
+
* 1. Fp for short private keys, Fp₂ for signatures
|
|
20
|
+
* 2. Fp for short signatures, Fp₂ for private keys
|
|
18
21
|
**/
|
|
19
22
|
type Fp = bigint;
|
|
23
|
+
export type TwistType = 'multiplicative' | 'divisive';
|
|
20
24
|
export type ShortSignatureCoder<Fp> = {
|
|
21
25
|
fromHex(hex: Hex): ProjPointType<Fp>;
|
|
22
26
|
toRawBytes(point: ProjPointType<Fp>): Uint8Array;
|
|
23
27
|
toHex(point: ProjPointType<Fp>): string;
|
|
24
28
|
};
|
|
25
|
-
export type SignatureCoder<
|
|
26
|
-
fromHex(hex: Hex): ProjPointType<
|
|
27
|
-
toRawBytes(point: ProjPointType<
|
|
28
|
-
toHex(point: ProjPointType<
|
|
29
|
-
};
|
|
30
|
-
type Fp2Bls<Fp, Fp2> = IField<Fp2> & {
|
|
31
|
-
reim: (num: Fp2) => {
|
|
32
|
-
re: Fp;
|
|
33
|
-
im: Fp;
|
|
34
|
-
};
|
|
35
|
-
multiplyByB: (num: Fp2) => Fp2;
|
|
36
|
-
frobeniusMap(num: Fp2, power: number): Fp2;
|
|
37
|
-
};
|
|
38
|
-
type Fp12Bls<Fp2, Fp12> = IField<Fp12> & {
|
|
39
|
-
frobeniusMap(num: Fp12, power: number): Fp12;
|
|
40
|
-
multiplyBy014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12;
|
|
41
|
-
conjugate(num: Fp12): Fp12;
|
|
42
|
-
finalExponentiate(num: Fp12): Fp12;
|
|
29
|
+
export type SignatureCoder<Fp> = {
|
|
30
|
+
fromHex(hex: Hex): ProjPointType<Fp>;
|
|
31
|
+
toRawBytes(point: ProjPointType<Fp>): Uint8Array;
|
|
32
|
+
toHex(point: ProjPointType<Fp>): string;
|
|
43
33
|
};
|
|
44
|
-
export type CurveType
|
|
34
|
+
export type CurveType = {
|
|
45
35
|
G1: Omit<CurvePointsType<Fp>, 'n'> & {
|
|
46
36
|
ShortSignature: SignatureCoder<Fp>;
|
|
47
37
|
mapToCurve: MapToCurve<Fp>;
|
|
@@ -55,19 +45,28 @@ export type CurveType<Fp, Fp2, Fp6, Fp12> = {
|
|
|
55
45
|
fields: {
|
|
56
46
|
Fp: IField<Fp>;
|
|
57
47
|
Fr: IField<bigint>;
|
|
58
|
-
Fp2: Fp2Bls
|
|
48
|
+
Fp2: Fp2Bls;
|
|
59
49
|
Fp6: IField<Fp6>;
|
|
60
|
-
Fp12: Fp12Bls
|
|
50
|
+
Fp12: Fp12Bls;
|
|
61
51
|
};
|
|
62
52
|
params: {
|
|
63
|
-
|
|
53
|
+
ateLoopSize: bigint;
|
|
54
|
+
xNegative: boolean;
|
|
64
55
|
r: bigint;
|
|
56
|
+
twistType: TwistType;
|
|
65
57
|
};
|
|
66
58
|
htfDefaults: HTFOpts;
|
|
67
59
|
hash: CHash;
|
|
68
60
|
randomBytes: (bytesLength?: number) => Uint8Array;
|
|
61
|
+
postPrecompute?: (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2, pointAdd: (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2) => {
|
|
62
|
+
Rx: Fp2;
|
|
63
|
+
Ry: Fp2;
|
|
64
|
+
Rz: Fp2;
|
|
65
|
+
}) => void;
|
|
69
66
|
};
|
|
70
|
-
|
|
67
|
+
type PrecomputeSingle = [Fp2, Fp2, Fp2][];
|
|
68
|
+
type Precompute = PrecomputeSingle[];
|
|
69
|
+
export type CurveFn = {
|
|
71
70
|
getPublicKey: (privateKey: PrivKey) => Uint8Array;
|
|
72
71
|
getPublicKeyForShortSignatures: (privateKey: PrivKey) => Uint8Array;
|
|
73
72
|
sign: {
|
|
@@ -93,30 +92,34 @@ export type CurveFn<Fp, Fp2, Fp6, Fp12> = {
|
|
|
93
92
|
(signatures: Hex[]): Uint8Array;
|
|
94
93
|
(signatures: ProjPointType<Fp>[]): ProjPointType<Fp>;
|
|
95
94
|
};
|
|
96
|
-
|
|
95
|
+
millerLoopBatch: (pairs: [Precompute, Fp, Fp][]) => Fp12;
|
|
97
96
|
pairing: (P: ProjPointType<Fp>, Q: ProjPointType<Fp2>, withFinalExponent?: boolean) => Fp12;
|
|
97
|
+
pairingBatch: (pairs: {
|
|
98
|
+
g1: ProjPointType<Fp>;
|
|
99
|
+
g2: ProjPointType<Fp2>;
|
|
100
|
+
}[], withFinalExponent?: boolean) => Fp12;
|
|
98
101
|
G1: CurvePointsRes<Fp> & ReturnType<typeof createHasher<Fp>>;
|
|
99
102
|
G2: CurvePointsRes<Fp2> & ReturnType<typeof createHasher<Fp2>>;
|
|
100
103
|
Signature: SignatureCoder<Fp2>;
|
|
101
104
|
ShortSignature: ShortSignatureCoder<Fp>;
|
|
102
105
|
params: {
|
|
103
|
-
|
|
106
|
+
ateLoopSize: bigint;
|
|
104
107
|
r: bigint;
|
|
105
108
|
G1b: bigint;
|
|
106
109
|
G2b: Fp2;
|
|
107
110
|
};
|
|
108
111
|
fields: {
|
|
109
112
|
Fp: IField<Fp>;
|
|
110
|
-
Fp2: Fp2Bls
|
|
113
|
+
Fp2: Fp2Bls;
|
|
111
114
|
Fp6: IField<Fp6>;
|
|
112
|
-
Fp12: Fp12Bls
|
|
115
|
+
Fp12: Fp12Bls;
|
|
113
116
|
Fr: IField<bigint>;
|
|
114
117
|
};
|
|
115
118
|
utils: {
|
|
116
119
|
randomPrivateKey: () => Uint8Array;
|
|
117
|
-
calcPairingPrecomputes: (p:
|
|
120
|
+
calcPairingPrecomputes: (p: ProjPointType<Fp2>) => Precompute;
|
|
118
121
|
};
|
|
119
122
|
};
|
|
120
|
-
export declare function bls
|
|
123
|
+
export declare function bls(CURVE: CurveType): CurveFn;
|
|
121
124
|
export {};
|
|
122
125
|
//# sourceMappingURL=bls.d.ts.map
|
package/abstract/bls.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA,sEAAsE;
|
|
1
|
+
{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAGtE,OAAO,EAAE,MAAM,EAAoC,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAyB,MAAM,YAAY,CAAC;AAExE,OAAO,EACL,UAAU,EAAE,IAAI,IAAI,OAAO,EAAuB,YAAY,EAC9D,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,aAAa,IAAI,aAAa,EAC9B,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OA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