README updates

This commit is contained in:
Paul Miller 2023-01-27 02:48:53 +00:00
parent ed9bf89038
commit fcd422d246
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B
2 changed files with 55 additions and 36 deletions

@ -445,43 +445,62 @@ We consider infrastructure attacks like rogue NPM modules very important; that's
Benchmark results on Apple M2 with node v18.10: Benchmark results on Apple M2 with node v18.10:
``` ```
getPublicKey secp256k1
secp256k1 x 5,241 ops/sec @ 190μs/op init x 57 ops/sec @ 17ms/op
P256 x 7,993 ops/sec @ 125μs/op getPublicKey x 4,946 ops/sec @ 202μs/op
P384 x 3,819 ops/sec @ 261μs/op sign x 3,914 ops/sec @ 255μs/op
P521 x 2,074 ops/sec @ 481μs/op verify x 682 ops/sec @ 1ms/op
ed25519 x 8,390 ops/sec @ 119μs/op getSharedSecret x 427 ops/sec @ 2ms/op
ed448 x 3,224 ops/sec @ 310μs/op recoverPublicKey x 683 ops/sec @ 1ms/op
sign schnorr.sign x 539 ops/sec @ 1ms/op
secp256k1 x 3,934 ops/sec @ 254μs/op schnorr.verify x 716 ops/sec @ 1ms/op
P256 x 5,327 ops/sec @ 187μs/op
P384 x 2,728 ops/sec @ 366μs/op P256
P521 x 1,594 ops/sec @ 626μs/op init x 30 ops/sec @ 32ms/op
ed25519 x 4,233 ops/sec @ 236μs/op getPublicKey x 5,008 ops/sec @ 199μs/op
ed448 x 1,561 ops/sec @ 640μs/op sign x 3,970 ops/sec @ 251μs/op
verify verify x 515 ops/sec @ 1ms/op
secp256k1 x 731 ops/sec @ 1ms/op
P256 x 806 ops/sec @ 1ms/op P384
P384 x 353 ops/sec @ 2ms/op init x 14 ops/sec @ 66ms/op
P521 x 171 ops/sec @ 5ms/op getPublicKey x 2,434 ops/sec @ 410μs/op
ed25519 x 860 ops/sec @ 1ms/op sign x 1,942 ops/sec @ 514μs/op
ed448 x 313 ops/sec @ 3ms/op verify x 206 ops/sec @ 4ms/op
getSharedSecret
secp256k1 x 445 ops/sec @ 2ms/op P521
recoverPublicKey init x 7 ops/sec @ 126ms/op
secp256k1 x 732 ops/sec @ 1ms/op getPublicKey x 1,282 ops/sec @ 779μs/op
==== bls12-381 ==== sign x 1,077 ops/sec @ 928μs/op
getPublicKey x 817 ops/sec @ 1ms/op verify x 110 ops/sec @ 9ms/op
sign x 50 ops/sec @ 19ms/op
verify x 34 ops/sec @ 28ms/op ed25519
pairing x 89 ops/sec @ 11ms/op init x 37 ops/sec @ 26ms/op
==== stark ==== getPublicKey x 8,147 ops/sec @ 122μs/op
sign x 3,979 ops/sec @ 251μs/op
verify x 848 ops/sec @ 1ms/op
ed448
init x 17 ops/sec @ 58ms/op
getPublicKey x 3,083 ops/sec @ 324μs/op
sign x 1,473 ops/sec @ 678μs/op
verify x 323 ops/sec @ 3ms/op
bls12-381
init x 30 ops/sec @ 33ms/op
getPublicKey x 788 ops/sec @ 1ms/op
sign x 45 ops/sec @ 21ms/op
verify x 32 ops/sec @ 30ms/op
pairing x 88 ops/sec @ 11ms/op
stark
init x 31 ops/sec @ 31ms/op
pedersen pedersen
old x 85 ops/sec @ 11ms/op ├─old x 84 ops/sec @ 11ms/op
noble x 1,216 ops/sec @ 822μs/op └─noble x 802 ops/sec @ 1ms/op
poseidon x 7,466 ops/sec @ 133μs/op
verify verify
old x 302 ops/sec @ 3ms/op ├─old x 300 ops/sec @ 3ms/op
noble x 698 ops/sec @ 1ms/op └─noble x 474 ops/sec @ 2ms/op
``` ```
## Upgrading ## Upgrading

@ -5,7 +5,7 @@ import * as stark from '../lib/stark.js';
run(async () => { run(async () => {
const RAM = false; const RAM = false;
if (RAM) utils.logMem(); if (RAM) utils.logMem();
console.log(`\x1b[36msecp256k1\x1b[0m`); console.log(`\x1b[36mstark\x1b[0m`);
await mark('init', 1, () => stark.utils.precompute(8)); await mark('init', 1, () => stark.utils.precompute(8));
const d = (() => { const d = (() => {
const priv = '2dccce1da22003777062ee0870e9881b460a8b7eca276870f57c601f182136c'; const priv = '2dccce1da22003777062ee0870e9881b460a8b7eca276870f57c601f182136c';