Paul Miller
537db4a968
hash-to-curve: adjust dst logic a bit
2024-02-27 23:34:30 +01:00
Paul Miller
e93caf9567
weierstrass: improve Entropy type. Use new utility.
2024-02-27 23:25:10 +01:00
Paul Miller
0ce103bd6b
utils, hash-to-curve: reduce code duplication
2024-02-27 23:25:10 +01:00
dhrubabasu
a8503d6819
bls: Add htfOpts
parameter to sign
functions
2024-02-16 18:03:27 -05:00
Paul Miller
8c39a6ac5a
tsconfig: change module to Node16, copy noble-ciphers change
2024-02-14 02:10:32 +01:00
Paul Miller
7be1dfc55d
utils: copy concatBytes from hashes
2024-01-02 08:49:40 +01:00
Paul Miller
b39b0d1daf
weierstrass: improve error wording for sqrt case
2023-12-13 15:58:51 +03:00
Paul Miller
30f68c9e54
utils: improve isBytes
2023-12-11 00:04:11 +01:00
Paul Miller
ada1ea5a19
bls: fix types. Closes gh-101
2023-12-10 23:42:42 +01:00
Paul Miller
26a4fd4293
weierstrass, hash-to-curve: ensure to use utils.isBytes everywhere
2023-12-10 23:27:15 +01:00
Paul Miller
9db14fc6d0
utils: fix-up isBytes
2023-12-10 23:26:57 +01:00
Paul Miller
8e6c19de2b
utils: make equalBytes constant-time
2023-12-10 23:04:01 +01:00
Paul Miller
4ffb68853d
utils: make isBytes more resilient in weird envs, improve concatBytes type error resilience.
2023-12-10 23:00:49 +01:00
Paul Miller
008958364e
weierstrass: reformat after new prettier
2023-12-10 22:58:13 +01:00
Paul Miller
2f1460a4d7
BLS: Refactor mask-bit settings, improve encoding resiliency
2023-11-10 02:55:16 +01:00
Eric Ho
02099b9b4c
Add weierstrassPoints return type
2023-10-11 19:16:56 +01:00
Eric Ho
3b14683806
Update weierstrass.ts
2023-10-11 18:41:11 +01:00
Paul Miller
2da6abb336
Fix x448 private keys: must be 56 bytes, not 57. Reported by @larabr
2023-10-03 01:15:43 +02:00
Paul Miller
4752ab1f1e
utils: optimize hexToBytes by 4%
2023-09-25 20:22:57 +02:00
Paul Miller
f58002e6d4
utils: refactor hexToBytes a bit
2023-09-25 19:21:18 +02:00
Nicholas Dudfield
08850c2d6a
feat: impl Group<X> for X in DecafPoint/RistrettoPoint
2023-09-20 16:23:41 +07:00
Paul Miller
ce7a8fda55
bls, bn: clarify their security level in comments
2023-09-14 03:02:10 +02:00
Paul Miller
c935b398fe
abstract/utils: reformat hexToBytes.
2023-09-13 23:57:34 +02:00
arobsn
1d83bab27d
add char code based hexToBytes function
2023-09-13 18:14:13 -03:00
Paul Miller
77bee0d54e
ed448: clarify why there are 56 or 57 byte keys
2023-09-10 03:00:51 +02:00
Jack Lloyd
156a1e909a
Fix ShortSignature.fromHex to check the G1 point is valid
2023-08-31 13:28:53 -04:00
Paul Miller
cf5f2268fb
ed448: add todo comment
2023-08-27 18:49:55 +02:00
Paul Miller
e31efd91d8
Merge pull request #74 from randombit/jack/add-short-signatures
...
Add verification of BLS short signatures
2023-08-26 00:50:42 +02:00
Jack Lloyd
c5e0e070d1
Complete BLS short signature support
2023-08-24 16:38:12 -04:00
Paul Miller
925fc3f810
modular: adjust getFieldsBytseLength
2023-08-23 19:43:55 +02:00
Paul Miller
eb8e7ec964
hash-to-curve, weierstrass, bls, ed: upgrade h2c comments to rfc 9380
2023-08-23 19:43:14 +02:00
Paul Miller
e7ac5e85d3
poseidon: refactor params
2023-08-21 18:16:40 +02:00
Paul Miller
d285fcce06
modular: Document FpPow
2023-08-21 17:52:21 +02:00
Paul Miller
ef667bb404
poseidon: refactor validateOpts, fix tests
2023-08-21 17:48:34 +02:00
Paul Miller
62749382e7
poseidon: remove default sboxPower: 5
2023-08-21 17:04:58 +02:00
Paul Miller
f90e871725
weierstrass: prohibit (0, 0, 0) in assertValidity
2023-08-21 16:05:53 +02:00
Paul Miller
f049398718
modular: bring back 1.1.0 hashToPrivateScalar for clean diff
2023-08-18 23:14:08 +02:00
Paul Miller
ca99179bd8
bls, modular: lint
2023-08-18 23:09:53 +02:00
Paul Miller
1545230ee5
modular, weierstrass, bls: use new mapHashToField
2023-08-18 23:08:46 +02:00
Jack Lloyd
b082d41c29
Add verification of BLS short signatures
2023-08-18 15:36:17 -04:00
Paul Miller
e8b9509c16
abstract/modular: add more comments everywhere
2023-08-11 12:23:52 +02:00
Paul Miller
05794c0283
weierstrass, bls: improve randomPrivateKey security and decrease bias
2023-08-11 12:22:37 +02:00
Paul Miller
ca5583f713
ed25519, ed448: rename hash_to_ristretto to hashToRistretto. And decaf
2023-08-10 20:01:13 +02:00
Paul Miller
8c48abe16a
Lint
2023-08-08 15:43:31 +02:00
Paul Miller
08bb00cc8f
poseidon: prohibit sBoxPower other than 3, 5, 7
2023-08-08 15:43:14 +02:00
Paul Miller
dba2f0e732
lint
2023-07-12 23:58:30 +02:00
Paul Miller
52c5df0264
utils: add PURE flag
2023-07-12 20:28:45 +02:00
Paul Miller
ebea4a4bcd
weierstrass, bls12-381: adjust var names for typescript flag
2023-07-12 20:28:38 +02:00
steveluscher
413725cfb3
Add pure annotation to all calls to twistedEdwards
...
This PR makes it so that if you only use _one_ export:
```ts
import { ed25519 } from '@noble/curves`;
```
…then only the `twistedEdwards` call that constructs that export will remain after bundling and tree-shaking.
Before this change, the compiled bundle contains all the code that constructs `ed25519ph` and `ed25519ctx` remains.
```js
var ed25519 = twistedEdwards(ed25519Defaults);
function ed25519_domain(data, ctx, phflag) {
if (ctx.length > 255)
throw new Error("Context is too big");
return concatBytes(utf8ToBytes("SigEd25519 no Ed25519 collisions"), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data);
}
twistedEdwards({ ...ed25519Defaults, domain: ed25519_domain });
twistedEdwards({
...ed25519Defaults,
domain: ed25519_domain,
prehash: sha512
});
```
```js
var ed25519 = twistedEdwards(ed25519Defaults);
```
2023-06-30 17:36:16 +00:00
Paul Miller
309d29a084
Merge pull request #56 from CoinSpace/extraentropy
...
fix: check extraEntropy according to the spec
2023-06-28 14:44:56 +02:00