@noble/curves 1.9.0 → 1.9.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 +78 -34
- package/_shortw_utils.d.ts +7 -5
- package/_shortw_utils.d.ts.map +1 -1
- package/_shortw_utils.js +2 -8
- package/_shortw_utils.js.map +1 -1
- package/abstract/bls.d.ts +60 -24
- package/abstract/bls.d.ts.map +1 -1
- package/abstract/bls.js +158 -109
- package/abstract/bls.js.map +1 -1
- package/abstract/curve.d.ts +44 -9
- package/abstract/curve.d.ts.map +1 -1
- package/abstract/curve.js +99 -11
- package/abstract/curve.js.map +1 -1
- package/abstract/edwards.d.ts +112 -25
- package/abstract/edwards.d.ts.map +1 -1
- package/abstract/edwards.js +141 -92
- package/abstract/edwards.js.map +1 -1
- package/abstract/fft.d.ts +122 -0
- package/abstract/fft.d.ts.map +1 -0
- package/abstract/fft.js +438 -0
- package/abstract/fft.js.map +1 -0
- package/abstract/hash-to-curve.d.ts +25 -11
- package/abstract/hash-to-curve.d.ts.map +1 -1
- package/abstract/hash-to-curve.js +17 -14
- package/abstract/hash-to-curve.js.map +1 -1
- package/abstract/modular.d.ts +28 -17
- package/abstract/modular.d.ts.map +1 -1
- package/abstract/modular.js +156 -139
- package/abstract/modular.js.map +1 -1
- package/abstract/montgomery.d.ts +3 -8
- package/abstract/montgomery.d.ts.map +1 -1
- package/abstract/montgomery.js +73 -93
- package/abstract/montgomery.js.map +1 -1
- package/abstract/poseidon.d.ts +5 -13
- package/abstract/poseidon.d.ts.map +1 -1
- package/abstract/poseidon.js +12 -7
- package/abstract/poseidon.js.map +1 -1
- package/abstract/tower.d.ts +20 -46
- package/abstract/tower.d.ts.map +1 -1
- package/abstract/tower.js +10 -4
- package/abstract/tower.js.map +1 -1
- package/abstract/utils.d.ts +1 -115
- package/abstract/utils.d.ts.map +1 -1
- package/abstract/utils.js +17 -371
- package/abstract/utils.js.map +1 -1
- package/abstract/weierstrass.d.ts +152 -73
- package/abstract/weierstrass.d.ts.map +1 -1
- package/abstract/weierstrass.js +487 -404
- package/abstract/weierstrass.js.map +1 -1
- package/bls12-381.d.ts +2 -0
- package/bls12-381.d.ts.map +1 -1
- package/bls12-381.js +504 -480
- package/bls12-381.js.map +1 -1
- package/bn254.d.ts +2 -0
- package/bn254.d.ts.map +1 -1
- package/bn254.js +44 -32
- package/bn254.js.map +1 -1
- package/ed25519.d.ts +25 -9
- package/ed25519.d.ts.map +1 -1
- package/ed25519.js +89 -65
- package/ed25519.js.map +1 -1
- package/ed448.d.ts +29 -10
- package/ed448.d.ts.map +1 -1
- package/ed448.js +116 -81
- package/ed448.js.map +1 -1
- package/esm/_shortw_utils.d.ts +7 -5
- package/esm/_shortw_utils.d.ts.map +1 -1
- package/esm/_shortw_utils.js +2 -8
- package/esm/_shortw_utils.js.map +1 -1
- package/esm/abstract/bls.d.ts +60 -24
- package/esm/abstract/bls.d.ts.map +1 -1
- package/esm/abstract/bls.js +158 -109
- package/esm/abstract/bls.js.map +1 -1
- package/esm/abstract/curve.d.ts +44 -9
- package/esm/abstract/curve.d.ts.map +1 -1
- package/esm/abstract/curve.js +96 -12
- package/esm/abstract/curve.js.map +1 -1
- package/esm/abstract/edwards.d.ts +112 -25
- package/esm/abstract/edwards.d.ts.map +1 -1
- package/esm/abstract/edwards.js +141 -94
- package/esm/abstract/edwards.js.map +1 -1
- package/esm/abstract/fft.d.ts +122 -0
- package/esm/abstract/fft.d.ts.map +1 -0
- package/esm/abstract/fft.js +425 -0
- package/esm/abstract/fft.js.map +1 -0
- package/esm/abstract/hash-to-curve.d.ts +25 -11
- package/esm/abstract/hash-to-curve.d.ts.map +1 -1
- package/esm/abstract/hash-to-curve.js +17 -14
- package/esm/abstract/hash-to-curve.js.map +1 -1
- package/esm/abstract/modular.d.ts +28 -17
- package/esm/abstract/modular.d.ts.map +1 -1
- package/esm/abstract/modular.js +155 -138
- package/esm/abstract/modular.js.map +1 -1
- package/esm/abstract/montgomery.d.ts +3 -8
- package/esm/abstract/montgomery.d.ts.map +1 -1
- package/esm/abstract/montgomery.js +74 -94
- package/esm/abstract/montgomery.js.map +1 -1
- package/esm/abstract/poseidon.d.ts +5 -13
- package/esm/abstract/poseidon.d.ts.map +1 -1
- package/esm/abstract/poseidon.js +12 -7
- package/esm/abstract/poseidon.js.map +1 -1
- package/esm/abstract/tower.d.ts +20 -46
- package/esm/abstract/tower.d.ts.map +1 -1
- package/esm/abstract/tower.js +10 -4
- package/esm/abstract/tower.js.map +1 -1
- package/esm/abstract/utils.d.ts +1 -115
- package/esm/abstract/utils.d.ts.map +1 -1
- package/esm/abstract/utils.js +3 -344
- package/esm/abstract/utils.js.map +1 -1
- package/esm/abstract/weierstrass.d.ts +152 -73
- package/esm/abstract/weierstrass.d.ts.map +1 -1
- package/esm/abstract/weierstrass.js +485 -406
- package/esm/abstract/weierstrass.js.map +1 -1
- package/esm/bls12-381.d.ts +2 -0
- package/esm/bls12-381.d.ts.map +1 -1
- package/esm/bls12-381.js +503 -479
- package/esm/bls12-381.js.map +1 -1
- package/esm/bn254.d.ts +2 -0
- package/esm/bn254.d.ts.map +1 -1
- package/esm/bn254.js +41 -29
- package/esm/bn254.js.map +1 -1
- package/esm/ed25519.d.ts +25 -9
- package/esm/ed25519.d.ts.map +1 -1
- package/esm/ed25519.js +84 -60
- package/esm/ed25519.js.map +1 -1
- package/esm/ed448.d.ts +29 -10
- package/esm/ed448.d.ts.map +1 -1
- package/esm/ed448.js +113 -78
- package/esm/ed448.js.map +1 -1
- package/esm/jubjub.d.ts +4 -0
- package/esm/jubjub.d.ts.map +1 -1
- package/esm/jubjub.js +4 -0
- package/esm/jubjub.js.map +1 -1
- package/esm/misc.d.ts.map +1 -1
- package/esm/misc.js +31 -26
- package/esm/misc.js.map +1 -1
- package/esm/nist.d.ts +8 -16
- package/esm/nist.d.ts.map +1 -1
- package/esm/nist.js +87 -97
- package/esm/nist.js.map +1 -1
- package/esm/p256.d.ts +3 -3
- package/esm/p384.d.ts +3 -3
- package/esm/p521.d.ts +3 -3
- package/esm/pasta.d.ts +4 -0
- package/esm/pasta.d.ts.map +1 -1
- package/esm/pasta.js +4 -0
- package/esm/pasta.js.map +1 -1
- package/esm/secp256k1.d.ts +6 -6
- package/esm/secp256k1.d.ts.map +1 -1
- package/esm/secp256k1.js +44 -41
- package/esm/secp256k1.js.map +1 -1
- package/esm/utils.d.ts +96 -0
- package/esm/utils.d.ts.map +1 -0
- package/esm/utils.js +279 -0
- package/esm/utils.js.map +1 -0
- package/jubjub.d.ts +4 -0
- package/jubjub.d.ts.map +1 -1
- package/jubjub.js +4 -0
- package/jubjub.js.map +1 -1
- package/misc.d.ts.map +1 -1
- package/misc.js +35 -30
- package/misc.js.map +1 -1
- package/nist.d.ts +8 -16
- package/nist.d.ts.map +1 -1
- package/nist.js +87 -97
- package/nist.js.map +1 -1
- package/p256.d.ts +3 -3
- package/p384.d.ts +3 -3
- package/p521.d.ts +3 -3
- package/package.json +26 -8
- package/pasta.d.ts +4 -0
- package/pasta.d.ts.map +1 -1
- package/pasta.js +4 -0
- package/pasta.js.map +1 -1
- package/secp256k1.d.ts +6 -6
- package/secp256k1.d.ts.map +1 -1
- package/secp256k1.js +47 -44
- package/secp256k1.js.map +1 -1
- package/src/_shortw_utils.ts +5 -15
- package/src/abstract/bls.ts +260 -145
- package/src/abstract/curve.ts +125 -18
- package/src/abstract/edwards.ts +282 -127
- package/src/abstract/fft.ts +519 -0
- package/src/abstract/hash-to-curve.ts +51 -27
- package/src/abstract/modular.ts +156 -143
- package/src/abstract/montgomery.ts +81 -111
- package/src/abstract/poseidon.ts +22 -18
- package/src/abstract/tower.ts +37 -68
- package/src/abstract/utils.ts +3 -378
- package/src/abstract/weierstrass.ts +752 -461
- package/src/bls12-381.ts +542 -507
- package/src/bn254.ts +47 -35
- package/src/ed25519.ts +104 -76
- package/src/ed448.ts +156 -105
- package/src/jubjub.ts +4 -0
- package/src/misc.ts +39 -34
- package/src/nist.ts +138 -126
- package/src/p256.ts +3 -3
- package/src/p384.ts +3 -3
- package/src/p521.ts +3 -3
- package/src/pasta.ts +5 -1
- package/src/secp256k1.ts +59 -47
- package/src/utils.ts +328 -0
- package/utils.d.ts +96 -0
- package/utils.d.ts.map +1 -0
- package/utils.js +313 -0
- package/utils.js.map +1 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Audited & minimal JS implementation of elliptic curve cryptography.
|
|
|
9
9
|
- ➰ Short Weierstrass, Edwards, Montgomery curves
|
|
10
10
|
- ✍️ ECDSA, EdDSA, Schnorr, BLS, ECDH, hashing to curves, Poseidon ZK-friendly hash
|
|
11
11
|
- 🔖 SUF-CMA, SBS (non-repudiation), ZIP215 (consensus friendliness) features for ed25519 & ed448
|
|
12
|
-
- 🪶 93KB for everything with hashes, 26KB (11KB gzipped) for single-curve build
|
|
12
|
+
- 🪶 93KB (36KB gzipped) for everything with hashes, 26KB (11KB gzipped) for single-curve build
|
|
13
13
|
|
|
14
14
|
Curves have 4KB sister projects
|
|
15
15
|
[secp256k1](https://github.com/paulmillr/noble-secp256k1) & [ed25519](https://github.com/paulmillr/noble-ed25519).
|
|
@@ -51,11 +51,9 @@ A standalone file [noble-curves.js](https://github.com/paulmillr/noble-curves/re
|
|
|
51
51
|
import { secp256k1, schnorr } from '@noble/curves/secp256k1';
|
|
52
52
|
import { ed25519, ed25519ph, ed25519ctx, x25519 } from '@noble/curves/ed25519';
|
|
53
53
|
import { ed448, ed448ph, ed448ctx, x448 } from '@noble/curves/ed448';
|
|
54
|
-
import { p256 } from '@noble/curves/
|
|
55
|
-
import { p384 } from '@noble/curves/p384';
|
|
56
|
-
import { p521 } from '@noble/curves/p521';
|
|
54
|
+
import { p256, p384, p521 } from '@noble/curves/nist';
|
|
57
55
|
import { bls12_381 } from '@noble/curves/bls12-381';
|
|
58
|
-
import { bn254 } from '@noble/curves/bn254';
|
|
56
|
+
import { bn254 } from '@noble/curves/bn254';
|
|
59
57
|
import { jubjub, babyjubjub } from '@noble/curves/misc';
|
|
60
58
|
import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/abstract/utils';
|
|
61
59
|
```
|
|
@@ -73,7 +71,10 @@ import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/
|
|
|
73
71
|
- [Abstract API](#abstract-api)
|
|
74
72
|
- [weierstrass](#weierstrass-short-weierstrass-curve), [edwards](#edwards-twisted-edwards-curve), [montgomery](#montgomery-montgomery-curve), [bls](#bls-barreto-lynn-scott-curves)
|
|
75
73
|
- [hash-to-curve](#hash-to-curve-hashing-strings-to-curve-points), [poseidon](#poseidon-poseidon-hash)
|
|
76
|
-
- [modular](#modular-modular-arithmetics-utilities)
|
|
74
|
+
- [modular](#modular-modular-arithmetics-utilities)
|
|
75
|
+
- [fft](#fft-fast-fourier-transform)
|
|
76
|
+
- [Creating private keys from hashes](#creating-private-keys-from-hashes)
|
|
77
|
+
- [utils](#utils-useful-utilities)
|
|
77
78
|
- [Security](#security)
|
|
78
79
|
- [Speed](#speed)
|
|
79
80
|
- [Upgrading](#upgrading)
|
|
@@ -86,7 +87,7 @@ import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/
|
|
|
86
87
|
|
|
87
88
|
```ts
|
|
88
89
|
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
89
|
-
// import { p256 } from '@noble/curves/
|
|
90
|
+
// import { p256 } from '@noble/curves/nist'; // or p384 / p521
|
|
90
91
|
|
|
91
92
|
const priv = secp256k1.utils.randomPrivateKey();
|
|
92
93
|
const pub = secp256k1.getPublicKey(priv);
|
|
@@ -258,31 +259,36 @@ hashToDecaf448(msg, { DST: 'decaf448_XOF:SHAKE256_D448MAP_RO_' });
|
|
|
258
259
|
#### bls12-381
|
|
259
260
|
|
|
260
261
|
```ts
|
|
261
|
-
import { bls12_381
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
262
|
+
import { bls12_381 } from '@noble/curves/bls12-381';
|
|
263
|
+
import { hexToBytes, utf8ToBytes } from '@noble/curves/abstract/utils';
|
|
264
|
+
|
|
265
|
+
// private keys are 32 bytes
|
|
266
|
+
const privKey = hexToBytes('67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c');
|
|
267
|
+
// const privKey = bls12_381.utils.randomPrivateKey();
|
|
268
|
+
|
|
269
|
+
// Long signatures (G2), short public keys (G1)
|
|
270
|
+
const blsl = bls12_381.longSignatures;
|
|
271
|
+
const publicKey = blsl.getPublicKey(privateKey);
|
|
272
|
+
// Sign msg with custom (Ethereum) DST
|
|
273
|
+
const msg = utf8ToBytes('hello');
|
|
274
|
+
const DST = 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_';
|
|
275
|
+
const msgp = blsl.hash(msg, DST);
|
|
276
|
+
const signature = blsl.sign(msgp, privateKey);
|
|
277
|
+
const isValid = blsl.verify(signature, msgp, publicKey);
|
|
269
278
|
console.log({ publicKey, signature, isValid });
|
|
270
279
|
|
|
271
|
-
//
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
const htfEthereum = { DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_' };
|
|
279
|
-
const signatureEth = bls.sign(message, privateKey, htfEthereum);
|
|
280
|
-
const isValidEth = bls.verify(signature, message, publicKey, htfEthereum);
|
|
280
|
+
// Short signatures (G1), long public keys (G2)
|
|
281
|
+
const blss = bls12_381.shortSignatures;
|
|
282
|
+
const publicKey2 = blss.getPublicKey(privateKey);
|
|
283
|
+
const msgp2 = blss.hash(utf8ToBytes('hello'), 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_')
|
|
284
|
+
const signature2 = blss.sign(msgp2, privateKey);
|
|
285
|
+
const isValid2 = blss.verify(signature2, msgp2, publicKey);
|
|
286
|
+
console.log({ publicKey2, signature2, isValid2 });
|
|
281
287
|
|
|
282
288
|
// Aggregation
|
|
283
|
-
const aggregatedKey =
|
|
284
|
-
|
|
285
|
-
|
|
289
|
+
const aggregatedKey = bls12_381.longSignatures.aggregatePublicKeys([
|
|
290
|
+
bls12_381.utils.randomPrivateKey(),
|
|
291
|
+
bls12_381.utils.randomPrivateKey(),
|
|
286
292
|
]);
|
|
287
293
|
// const aggregatedSig = bls.aggregateSignatures(sigs)
|
|
288
294
|
|
|
@@ -526,7 +532,7 @@ For EdDSA signatures, `hash` param required.
|
|
|
526
532
|
- Blockchains: transaction of amount X might also be valid for a different amount Y
|
|
527
533
|
- Both modes have SUF-CMA (strong unforgeability under chosen message attacks).
|
|
528
534
|
|
|
529
|
-
Check out [RFC9496](https://
|
|
535
|
+
Check out [RFC9496](https://www.rfc-editor.org/rfc/rfc9496) for description of
|
|
530
536
|
ristretto and decaf groups which we implement.
|
|
531
537
|
|
|
532
538
|
### montgomery: Montgomery curve
|
|
@@ -671,6 +677,15 @@ DoS (infilite loop) on Tonelli-Shanks square root calculation.
|
|
|
671
677
|
|
|
672
678
|
Unlike `mod.inv`, `mod.invertBatch` won't throw on `0`: make sure to throw an error yourself.
|
|
673
679
|
|
|
680
|
+
### fft: Fast Fourier Transform
|
|
681
|
+
|
|
682
|
+
Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields.
|
|
683
|
+
API may change at any time. The code has not been audited. Feature requests are welcome.
|
|
684
|
+
|
|
685
|
+
```ts
|
|
686
|
+
import * as fft from '@noble/curves/abstract/fft.js';
|
|
687
|
+
```
|
|
688
|
+
|
|
674
689
|
#### Creating private keys from hashes
|
|
675
690
|
|
|
676
691
|
You can't simply make a 32-byte private key from a 32-byte hash.
|
|
@@ -685,7 +700,7 @@ Use [abstract/hash-to-curve](#hash-to-curve-hashing-strings-to-curve-points)
|
|
|
685
700
|
if you need to hash to **public key**.
|
|
686
701
|
|
|
687
702
|
```ts
|
|
688
|
-
import { p256 } from '@noble/curves/
|
|
703
|
+
import { p256 } from '@noble/curves/nist';
|
|
689
704
|
import { sha256 } from '@noble/hashes/sha256';
|
|
690
705
|
import { hkdf } from '@noble/hashes/hkdf';
|
|
691
706
|
import * as mod from '@noble/curves/abstract/modular';
|
|
@@ -753,6 +768,30 @@ constant-timeness_. Even statically typed Rust, a language without GC,
|
|
|
753
768
|
for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones.
|
|
754
769
|
Use low-level libraries & languages.
|
|
755
770
|
|
|
771
|
+
### Memory dumping
|
|
772
|
+
|
|
773
|
+
Use low-level languages instead of JS / WASM if your goal is absolute security.
|
|
774
|
+
|
|
775
|
+
The library mostly uses Uint8Arrays and bigints.
|
|
776
|
+
|
|
777
|
+
- Uint8Arrays have `.fill(0)` which instructs to fill content with zeroes
|
|
778
|
+
but there are no guarantees in JS
|
|
779
|
+
- bigints are immutable and don't have a method to zeroize their content:
|
|
780
|
+
a user needs to wait until the next garbage collection cycle
|
|
781
|
+
- hex strings are also immutable: there is no way to zeroize them
|
|
782
|
+
- `await fn()` will write all internal variables to memory. With
|
|
783
|
+
async functions there are no guarantees when the code
|
|
784
|
+
chunk would be executed. Which means attacker can have
|
|
785
|
+
plenty of time to read data from memory.
|
|
786
|
+
|
|
787
|
+
This means some secrets could stay in memory longer than anticipated.
|
|
788
|
+
However, if an attacker can read application memory, it's doomed anyway:
|
|
789
|
+
there is no way to guarantee anything about zeroizing sensitive data without
|
|
790
|
+
complex tests-suite which will dump process memory and verify that there is
|
|
791
|
+
no sensitive data left. For JS it means testing all browsers (including mobile).
|
|
792
|
+
And, of course, it will be useless without using the same
|
|
793
|
+
test-suite in the actual application that consumes the library.
|
|
794
|
+
|
|
756
795
|
### Supply chain security
|
|
757
796
|
|
|
758
797
|
- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures
|
|
@@ -797,10 +836,12 @@ NIST prohibits classical cryptography (RSA, DSA, ECDSA, ECDH) [after 2035](https
|
|
|
797
836
|
npm run bench:install && npm run bench
|
|
798
837
|
```
|
|
799
838
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
839
|
+
noble-curves spends 10+ ms to generate 20MB+ of base point precomputes.
|
|
840
|
+
This is done **one-time** per curve.
|
|
841
|
+
|
|
842
|
+
The generation is deferred until any method (pubkey, sign, verify) is called.
|
|
843
|
+
User can force precompute generation by manually calling `Point.BASE.precompute(windowSize, false)`.
|
|
844
|
+
Check out the source code.
|
|
804
845
|
|
|
805
846
|
Benchmark results on Apple M4:
|
|
806
847
|
|
|
@@ -976,6 +1017,9 @@ See [paulmillr.com/noble](https://paulmillr.com/noble/)
|
|
|
976
1017
|
for useful resources, articles, documentation and demos
|
|
977
1018
|
related to the library.
|
|
978
1019
|
|
|
1020
|
+
MuSig2 signature scheme and BIP324 ElligatorSwift mapping for secp256k1
|
|
1021
|
+
are available [in a separate package](https://github.com/paulmillr/scure-btc-signer).
|
|
1022
|
+
|
|
979
1023
|
## License
|
|
980
1024
|
|
|
981
1025
|
The MIT License (MIT)
|
package/_shortw_utils.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for short weierstrass curves, combined with noble-hashes.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
6
|
import { type CurveFn, type CurveType } from './abstract/weierstrass.ts';
|
|
7
|
+
import type { CHash } from './utils.ts';
|
|
4
8
|
/** connects noble-curves to noble-hashes */
|
|
5
9
|
export declare function getHash(hash: CHash): {
|
|
6
10
|
hash: CHash;
|
|
7
|
-
hmac: (key: Uint8Array, ...msgs: Uint8Array[]) => Uint8Array;
|
|
8
|
-
randomBytes: typeof randomBytes;
|
|
9
11
|
};
|
|
10
12
|
/** Same API as @noble/hashes, with ability to create curve with custom hash */
|
|
11
|
-
export type CurveDef = Readonly<Omit<CurveType, 'hash'
|
|
13
|
+
export type CurveDef = Readonly<Omit<CurveType, 'hash'>>;
|
|
12
14
|
export type CurveFnWithCreate = CurveFn & {
|
|
13
15
|
create: (hash: CHash) => CurveFn;
|
|
14
16
|
};
|
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":"
|
|
1
|
+
{"version":3,"file":"_shortw_utils.d.ts","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAEpD;AACD,+EAA+E;AAC/E,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,CAAC;AAE/E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,iBAAiB,CAGjF"}
|
package/_shortw_utils.js
CHANGED
|
@@ -7,19 +7,13 @@ exports.createCurve = createCurve;
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
10
|
-
const hmac_1 = require("@noble/hashes/hmac");
|
|
11
|
-
const utils_1 = require("@noble/hashes/utils");
|
|
12
10
|
const weierstrass_ts_1 = require("./abstract/weierstrass.js");
|
|
13
11
|
/** connects noble-curves to noble-hashes */
|
|
14
12
|
function getHash(hash) {
|
|
15
|
-
return {
|
|
16
|
-
hash,
|
|
17
|
-
hmac: (key, ...msgs) => (0, hmac_1.hmac)(hash, key, (0, utils_1.concatBytes)(...msgs)),
|
|
18
|
-
randomBytes: utils_1.randomBytes,
|
|
19
|
-
};
|
|
13
|
+
return { hash };
|
|
20
14
|
}
|
|
21
15
|
function createCurve(curveDef, defHash) {
|
|
22
|
-
const create = (hash) => (0, weierstrass_ts_1.weierstrass)({ ...curveDef,
|
|
16
|
+
const create = (hash) => (0, weierstrass_ts_1.weierstrass)({ ...curveDef, hash: hash });
|
|
23
17
|
return { ...create(defHash), create };
|
|
24
18
|
}
|
|
25
19
|
//# sourceMappingURL=_shortw_utils.js.map
|
package/_shortw_utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shortw_utils.js","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"_shortw_utils.js","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":";;AASA,0BAEC;AAKD,kCAGC;AAnBD;;;GAGG;AACH,sEAAsE;AACtE,8DAAsF;AAGtF,4CAA4C;AAC5C,SAAgB,OAAO,CAAC,IAAW;IACjC,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAKD,SAAgB,WAAW,CAAC,QAAkB,EAAE,OAAc;IAC5D,MAAM,MAAM,GAAG,CAAC,IAAW,EAAW,EAAE,CAAC,IAAA,4BAAW,EAAC,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClF,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC"}
|
package/abstract/bls.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* BLS (Barreto-Lynn-Scott) family of pairing-friendly curves.
|
|
3
2
|
* BLS != BLS.
|
|
4
3
|
* The file implements BLS (Boneh-Lynn-Shacham) signatures.
|
|
5
4
|
* Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig)
|
|
@@ -10,26 +9,32 @@
|
|
|
10
9
|
* - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in
|
|
11
10
|
* Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not.
|
|
12
11
|
* Pairing is used to aggregate and verify signatures.
|
|
13
|
-
* There are two
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* There are two modes of operation:
|
|
13
|
+
* - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs).
|
|
14
|
+
* - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs).
|
|
16
15
|
* @module
|
|
17
16
|
**/
|
|
18
17
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
19
|
-
import { type
|
|
18
|
+
import { type CHash, type Hex, type PrivKey } from '../utils.ts';
|
|
19
|
+
import { type H2CHasher, type H2CHashOpts, type H2COpts, type htfBasicOpts, type MapToCurve } from './hash-to-curve.ts';
|
|
20
20
|
import { type IField } from './modular.ts';
|
|
21
|
-
import type { Fp12, Fp12Bls, Fp2, Fp2Bls,
|
|
22
|
-
import { type
|
|
23
|
-
import { type CurvePointsRes, type CurvePointsType, type ProjPointType } from './weierstrass.ts';
|
|
21
|
+
import type { Fp12, Fp12Bls, Fp2, Fp2Bls, Fp6Bls } from './tower.ts';
|
|
22
|
+
import { type CurvePointsRes, type CurvePointsType, type ProjConstructor, type ProjPointType } from './weierstrass.ts';
|
|
24
23
|
type Fp = bigint;
|
|
25
24
|
export type TwistType = 'multiplicative' | 'divisive';
|
|
26
25
|
export type ShortSignatureCoder<Fp> = {
|
|
26
|
+
fromBytes(bytes: Uint8Array): ProjPointType<Fp>;
|
|
27
27
|
fromHex(hex: Hex): ProjPointType<Fp>;
|
|
28
|
+
toBytes(point: ProjPointType<Fp>): Uint8Array;
|
|
29
|
+
/** @deprecated use `toBytes` */
|
|
28
30
|
toRawBytes(point: ProjPointType<Fp>): Uint8Array;
|
|
29
31
|
toHex(point: ProjPointType<Fp>): string;
|
|
30
32
|
};
|
|
31
33
|
export type SignatureCoder<Fp> = {
|
|
34
|
+
fromBytes(bytes: Uint8Array): ProjPointType<Fp>;
|
|
32
35
|
fromHex(hex: Hex): ProjPointType<Fp>;
|
|
36
|
+
toBytes(point: ProjPointType<Fp>): Uint8Array;
|
|
37
|
+
/** @deprecated use `toBytes` */
|
|
33
38
|
toRawBytes(point: ProjPointType<Fp>): Uint8Array;
|
|
34
39
|
toHex(point: ProjPointType<Fp>): string;
|
|
35
40
|
};
|
|
@@ -40,21 +45,21 @@ export type PostPrecomputePointAddFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy:
|
|
|
40
45
|
};
|
|
41
46
|
export type PostPrecomputeFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2, pointAdd: PostPrecomputePointAddFn) => void;
|
|
42
47
|
export type CurveType = {
|
|
43
|
-
G1:
|
|
48
|
+
G1: CurvePointsType<Fp> & {
|
|
44
49
|
ShortSignature: SignatureCoder<Fp>;
|
|
45
50
|
mapToCurve: MapToCurve<Fp>;
|
|
46
|
-
htfDefaults:
|
|
51
|
+
htfDefaults: H2COpts;
|
|
47
52
|
};
|
|
48
|
-
G2:
|
|
53
|
+
G2: CurvePointsType<Fp2> & {
|
|
49
54
|
Signature: SignatureCoder<Fp2>;
|
|
50
55
|
mapToCurve: MapToCurve<Fp2>;
|
|
51
|
-
htfDefaults:
|
|
56
|
+
htfDefaults: H2COpts;
|
|
52
57
|
};
|
|
53
58
|
fields: {
|
|
54
59
|
Fp: IField<Fp>;
|
|
55
60
|
Fr: IField<bigint>;
|
|
56
61
|
Fp2: Fp2Bls;
|
|
57
|
-
Fp6:
|
|
62
|
+
Fp6: Fp6Bls;
|
|
58
63
|
Fp12: Fp12Bls;
|
|
59
64
|
};
|
|
60
65
|
params: {
|
|
@@ -63,59 +68,80 @@ export type CurveType = {
|
|
|
63
68
|
r: bigint;
|
|
64
69
|
twistType: TwistType;
|
|
65
70
|
};
|
|
66
|
-
htfDefaults:
|
|
71
|
+
htfDefaults: H2COpts;
|
|
67
72
|
hash: CHash;
|
|
68
|
-
randomBytes
|
|
73
|
+
randomBytes?: (bytesLength?: number) => Uint8Array;
|
|
69
74
|
postPrecompute?: PostPrecomputeFn;
|
|
70
75
|
};
|
|
71
76
|
type PrecomputeSingle = [Fp2, Fp2, Fp2][];
|
|
72
77
|
type Precompute = PrecomputeSingle[];
|
|
73
78
|
export type CurveFn = {
|
|
79
|
+
longSignatures: BLSSigs<bigint, Fp2>;
|
|
80
|
+
shortSignatures: BLSSigs<Fp2, bigint>;
|
|
81
|
+
millerLoopBatch: (pairs: [Precompute, Fp, Fp][]) => Fp12;
|
|
82
|
+
pairing: (P: ProjPointType<Fp>, Q: ProjPointType<Fp2>, withFinalExponent?: boolean) => Fp12;
|
|
83
|
+
pairingBatch: (pairs: {
|
|
84
|
+
g1: ProjPointType<Fp>;
|
|
85
|
+
g2: ProjPointType<Fp2>;
|
|
86
|
+
}[], withFinalExponent?: boolean) => Fp12;
|
|
87
|
+
/** @deprecated use `longSignatures.getPublicKey` */
|
|
74
88
|
getPublicKey: (privateKey: PrivKey) => Uint8Array;
|
|
89
|
+
/** @deprecated use `shortSignatures.getPublicKey` */
|
|
75
90
|
getPublicKeyForShortSignatures: (privateKey: PrivKey) => Uint8Array;
|
|
91
|
+
/** @deprecated use `longSignatures.sign` */
|
|
76
92
|
sign: {
|
|
77
93
|
(message: Hex, privateKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array;
|
|
78
94
|
(message: ProjPointType<Fp2>, privateKey: PrivKey, htfOpts?: htfBasicOpts): ProjPointType<Fp2>;
|
|
79
95
|
};
|
|
96
|
+
/** @deprecated use `shortSignatures.sign` */
|
|
80
97
|
signShortSignature: {
|
|
81
98
|
(message: Hex, privateKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array;
|
|
82
99
|
(message: ProjPointType<Fp>, privateKey: PrivKey, htfOpts?: htfBasicOpts): ProjPointType<Fp>;
|
|
83
100
|
};
|
|
101
|
+
/** @deprecated use `longSignatures.verify` */
|
|
84
102
|
verify: (signature: Hex | ProjPointType<Fp2>, message: Hex | ProjPointType<Fp2>, publicKey: Hex | ProjPointType<Fp>, htfOpts?: htfBasicOpts) => boolean;
|
|
103
|
+
/** @deprecated use `shortSignatures.verify` */
|
|
85
104
|
verifyShortSignature: (signature: Hex | ProjPointType<Fp>, message: Hex | ProjPointType<Fp>, publicKey: Hex | ProjPointType<Fp2>, htfOpts?: htfBasicOpts) => boolean;
|
|
86
105
|
verifyBatch: (signature: Hex | ProjPointType<Fp2>, messages: (Hex | ProjPointType<Fp2>)[], publicKeys: (Hex | ProjPointType<Fp>)[], htfOpts?: htfBasicOpts) => boolean;
|
|
106
|
+
/** @deprecated use `longSignatures.aggregatePublicKeys` */
|
|
87
107
|
aggregatePublicKeys: {
|
|
88
108
|
(publicKeys: Hex[]): Uint8Array;
|
|
89
109
|
(publicKeys: ProjPointType<Fp>[]): ProjPointType<Fp>;
|
|
90
110
|
};
|
|
111
|
+
/** @deprecated use `longSignatures.aggregateSignatures` */
|
|
91
112
|
aggregateSignatures: {
|
|
92
113
|
(signatures: Hex[]): Uint8Array;
|
|
93
114
|
(signatures: ProjPointType<Fp2>[]): ProjPointType<Fp2>;
|
|
94
115
|
};
|
|
116
|
+
/** @deprecated use `shortSignatures.aggregateSignatures` */
|
|
95
117
|
aggregateShortSignatures: {
|
|
96
118
|
(signatures: Hex[]): Uint8Array;
|
|
97
119
|
(signatures: ProjPointType<Fp>[]): ProjPointType<Fp>;
|
|
98
120
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
g2: ProjPointType<Fp2>;
|
|
104
|
-
}[], withFinalExponent?: boolean) => Fp12;
|
|
105
|
-
G1: CurvePointsRes<Fp> & ReturnType<typeof createHasher<Fp>>;
|
|
106
|
-
G2: CurvePointsRes<Fp2> & ReturnType<typeof createHasher<Fp2>>;
|
|
121
|
+
/** @deprecated use `curves.G1` and `curves.G2` */
|
|
122
|
+
G1: CurvePointsRes<Fp> & H2CHasher<Fp>;
|
|
123
|
+
G2: CurvePointsRes<Fp2> & H2CHasher<Fp2>;
|
|
124
|
+
/** @deprecated use `longSignatures.Signature` */
|
|
107
125
|
Signature: SignatureCoder<Fp2>;
|
|
126
|
+
/** @deprecated use `shortSignatures.Signature` */
|
|
108
127
|
ShortSignature: ShortSignatureCoder<Fp>;
|
|
109
128
|
params: {
|
|
110
129
|
ateLoopSize: bigint;
|
|
111
130
|
r: bigint;
|
|
131
|
+
twistType: TwistType;
|
|
132
|
+
/** @deprecated */
|
|
112
133
|
G1b: bigint;
|
|
134
|
+
/** @deprecated */
|
|
113
135
|
G2b: Fp2;
|
|
114
136
|
};
|
|
137
|
+
curves: {
|
|
138
|
+
G1: ProjConstructor<bigint>;
|
|
139
|
+
G2: ProjConstructor<Fp2>;
|
|
140
|
+
};
|
|
115
141
|
fields: {
|
|
116
142
|
Fp: IField<Fp>;
|
|
117
143
|
Fp2: Fp2Bls;
|
|
118
|
-
Fp6:
|
|
144
|
+
Fp6: Fp6Bls;
|
|
119
145
|
Fp12: Fp12Bls;
|
|
120
146
|
Fr: IField<bigint>;
|
|
121
147
|
};
|
|
@@ -124,6 +150,16 @@ export type CurveFn = {
|
|
|
124
150
|
calcPairingPrecomputes: (p: ProjPointType<Fp2>) => Precompute;
|
|
125
151
|
};
|
|
126
152
|
};
|
|
153
|
+
type BLSInput = Hex | Uint8Array;
|
|
154
|
+
export interface BLSSigs<P, S> {
|
|
155
|
+
getPublicKey(privateKey: PrivKey): ProjPointType<P>;
|
|
156
|
+
sign(hashedMessage: ProjPointType<S>, privateKey: PrivKey): ProjPointType<S>;
|
|
157
|
+
verify(signature: ProjPointType<S> | BLSInput, message: ProjPointType<S>, publicKey: ProjPointType<P> | BLSInput): boolean;
|
|
158
|
+
aggregatePublicKeys(publicKeys: (ProjPointType<P> | BLSInput)[]): ProjPointType<P>;
|
|
159
|
+
aggregateSignatures(signatures: (ProjPointType<S> | BLSInput)[]): ProjPointType<S>;
|
|
160
|
+
hash(message: Uint8Array, DST?: string | Uint8Array, hashOpts?: H2CHashOpts): ProjPointType<S>;
|
|
161
|
+
Signature: SignatureCoder<S>;
|
|
162
|
+
}
|
|
127
163
|
export declare function bls(CURVE: CurveType): CurveFn;
|
|
128
164
|
export {};
|
|
129
165
|
//# 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
|
|
1
|
+
{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,OAAO,EAKL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,OAAO,EAEZ,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoC,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,KAAK,EAAE,GAAG,MAAM,CAAC;AAKjB,MAAM,MAAM,SAAS,GAAG,gBA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