Skip to content

Commit 19c6c79

Browse files
committed
Merge devdeps: should, bmark into jsbt
1 parent d962e17 commit 19c6c79

30 files changed

+38
-38
lines changed

test/acvp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { sha1 } from '@noble/hashes/legacy.js';
22
import { sha224, sha256, sha384, sha512, sha512_224, sha512_256 } from '@noble/hashes/sha2.js';
33
import { sha3_224, sha3_256, sha3_384, sha3_512 } from '@noble/hashes/sha3.js';
4-
import { describe, should } from 'micro-should';
4+
import { describe, should } from '@paulmillr/jsbt/test.js';
55
import { deepStrictEqual as eql } from 'node:assert';
66
import { ecdsa } from '../src/abstract/weierstrass.ts';
77
import { ed25519, ed25519ctx, ed25519ph } from '../src/ed25519.ts';

test/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { sha256 } from '@noble/hashes/sha2.js';
2-
import { describe, should } from 'micro-should';
2+
import { describe, should } from '@paulmillr/jsbt/test.js';
33
import { deepStrictEqual as eql, notDeepStrictEqual, throws } from 'node:assert';
44
import { Field } from '../src/abstract/modular.ts';
55
import { ecdsa, weierstrass } from '../src/abstract/weierstrass.ts';

test/benchmark/bls.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { hexToBytes } from '@noble/hashes/utils.js';
2-
import bench from 'micro-bmark';
2+
import bench from '@paulmillr/jsbt/bench.js';
33
import { readFileSync } from 'node:fs';
44
import { dirname } from 'node:path';
55
import { fileURLToPath } from 'node:url';
@@ -21,7 +21,7 @@ const G2_VECTORS = readFileSync(
2121
let p1, p2, sig, sig_s;
2222
const blsl = bls.longSignatures;
2323
const blss = bls.shortSignatures;
24-
await bench('init', 1, () => {
24+
await bench('init', () => {
2525
p1 =
2626
bls.G1.Point.BASE.multiply(
2727
0x28b90deaf189015d3a325908c5e0e4bf00f84f7e639b056ff82d7e70b6eede4cn
@@ -31,7 +31,7 @@ const G2_VECTORS = readFileSync(
3131
0x28b90deaf189015d3a325908c5e0e4bf00f84f7e639b056ff82d7e70b6eede4dn
3232
);
3333
bls.pairing(p1, p2);
34-
});
34+
}, 1);
3535
const priv = hexToBytes('28b90deaf189015d3a325908c5e0e4bf00f84f7e639b056ff82d7e70b6eede4c');
3636
sig = blsl.sign(blsl.hash(Uint8Array.of(0x09)), priv);
3737
sig_s = blss.sign(blss.hash(Uint8Array.of(0x09)), priv);
@@ -74,9 +74,9 @@ const G2_VECTORS = readFileSync(
7474
let pointsG2;
7575

7676
console.log('# misc');
77-
await bench(`initializing ${amount} G1 points`, 1, () => {
77+
await bench(`initializing ${amount} G1 points`, () => {
7878
pointsG1 = scalars1.map((s) => bls.G1.Point.BASE.multiply(s));
79-
});
79+
}, 1);
8080
await bench(`MSM pippenger x${amount}`, () => {
8181
pippenger(bls.G1.Point, pointsG1, scalars2);
8282
});
@@ -97,9 +97,9 @@ const G2_VECTORS = readFileSync(
9797
await bench('agg G2 x512', () => blsl.aggregateSignatures(sig512));
9898
await bench('agg G2 x2048', () => blsl.aggregateSignatures(sig2048));
9999

100-
await bench('initializing 4096 G2 points', 1, () => {
100+
await bench('initializing 4096 G2 points', () => {
101101
pointsG2 = scalars1.slice(0, 4096).map((s) => bls.G2.Point.BASE.multiply(s));
102-
});
102+
}, 1);
103103
const pairingBatch = 10;
104104
await bench(`pairing${pairingBatch}`, () => {
105105
const res = [];

test/benchmark/curves.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { randomBytes } from '@noble/hashes/utils.js';
2-
import compare from 'micro-bmark/compare.js';
2+
import compare from '@paulmillr/jsbt/bench-compare.js';
33
import { ed25519, ed25519_hasher, x25519 } from '../../src/ed25519.ts';
44
import { ed448, ed448_hasher, x448 } from '../../src/ed448.ts';
55
import { p256, p256_hasher, p384, p384_hasher, p521, p521_hasher } from '../../src/nist.ts';

test/benchmark/fft.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import mark from 'micro-bmark';
1+
import mark from '@paulmillr/jsbt/bench.js';
22
import * as fft from '../../src/abstract/fft.ts';
33
import { bls12_381 } from '../../src/bls12-381.ts';
44
import { title } from './_shared.ts';

test/benchmark/secp256k1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import mark from 'micro-bmark';
1+
import mark from '@paulmillr/jsbt/bench.js';
22
import { schnorr, secp256k1 } from '../../src/secp256k1.ts';
33
import { generateData, title } from './_shared.ts';
44

55
(async () => {
66
title('secp256k1');
7-
await mark('init', 1, () => secp256k1.Point.BASE.precompute(8, false));
7+
await mark('init', () => secp256k1.Point.BASE.precompute(8, false), 1);
88
const d = generateData(secp256k1);
99
await mark('getPublicKey', () => secp256k1.getPublicKey(d.priv));
1010
await mark('sign', () => secp256k1.sign(d.msg, d.priv));

test/benchmark/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { sha256, sha512 } from '@noble/hashes/sha2.js';
22
import { shake256 } from '@noble/hashes/sha3.js';
33
import { randomBytes } from '@noble/hashes/utils.js';
4-
import mark from 'micro-bmark';
4+
import mark from '@paulmillr/jsbt/bench.js';
55
import { hash_to_field } from '../../src/abstract/hash-to-curve.ts';
66
import * as md from '../../src/abstract/modular.ts';
77
import { ed25519, ristretto255, ristretto255_hasher } from '../../src/ed25519.ts';
@@ -62,7 +62,7 @@ const DecafPoint = decaf448.Point;
6262
await mark('multiply', () => RistrettoPoint.BASE.multiply(priv));
6363
await mark('encode', () => RistrettoPoint.BASE.toBytes());
6464
await mark('decode', () => RistrettoPoint.fromBytes(encoded));
65-
await mark('ristretto255_hasher', 1000, () =>
65+
await mark('ristretto255_hasher', () =>
6666
ristretto255_hasher.hashToCurve(msg, { DST: 'ristretto255_XMD:SHA-512_R255MAP_RO_' })
6767
);
6868

test/bls12-381.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as fc from 'fast-check';
2-
import { describe, should } from 'micro-should';
2+
import { describe, should } from '@paulmillr/jsbt/test.js';
33
import { deepStrictEqual as eql, throws } from 'node:assert';
44
import { wNAF } from '../src/abstract/curve.ts';
55
import { hash_to_field } from '../src/abstract/hash-to-curve.ts';

test/bn254.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { hexToBytes } from '@noble/hashes/utils.js';
2-
import { describe, should } from 'micro-should';
2+
import { describe, should } from '@paulmillr/jsbt/test.js';
33
import { deepStrictEqual as eql, throws } from 'node:assert';
44
import { bn254 } from '../src/bn254.ts';
55
import { bytesToNumberBE } from '../src/utils.ts';

test/ecdsa.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
turboshake256,
1111
} from '@noble/hashes/sha3-addons.js';
1212
import { sha3_224, sha3_256, sha3_384, sha3_512, shake128, shake256 } from '@noble/hashes/sha3.js';
13-
import { describe, should } from 'micro-should';
13+
import { describe, should } from '@paulmillr/jsbt/test.js';
1414
import { deepStrictEqual as eql, throws } from 'node:assert';
1515
import { randomBytes } from 'node:crypto';
1616
import { ecdh, ecdsa } from '../src/abstract/weierstrass.ts';

0 commit comments

Comments
 (0)