Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with upstream #1

Open
wants to merge 151 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
2cba19b
Shuffle things around, new variables, comments
paulmillr Dec 9, 2022
73cf04e
Bench: compressed keys
paulmillr Jan 6, 2023
3b72151
Improve math
paulmillr Jan 6, 2023
bcfb393
Remove isCompressed der sigs, unused
paulmillr Jan 8, 2023
b161b1c
Backport curves changes: drbg, truncateHash, etc
paulmillr Jan 8, 2023
9f3b1e5
Add support for recovery_bit=2,3. Closes gh-72
paulmillr Jan 8, 2023
a276a1c
Lint
paulmillr Jan 8, 2023
fd51da0
Release 1.7.1.
paulmillr Jan 8, 2023
e125abd
Add tests for (p-p)==0. gh-91.
paulmillr Jan 9, 2023
a1a990d
Prepare tests for micro
paulmillr Jan 13, 2023
875d38c
micro-noble-secp. Iteration 1: 8115
paulmillr Jan 13, 2023
6d752c6
micro-noble-secp. Iteration 2: 8681
paulmillr Jan 13, 2023
bc87ff5
micro-noble-secp. Iteration 3: 7418
paulmillr Jan 13, 2023
01d014d
Add some comments. Iteration 4: 7071, 368LOC
paulmillr Jan 14, 2023
db19abb
Benchmark. Iteration 5: 6953, 350LOC
paulmillr Jan 14, 2023
ddcc56d
Speed-up verification. Iteration 6: 6967, 345LOC
paulmillr Jan 14, 2023
56332e6
wNAF precomputes, 10x faster sign. Iteration 7: 7458, 387LOC
paulmillr Jan 14, 2023
15d5482
Bring back wychenproof vectors and pubkey recovery tests
paulmillr Jan 14, 2023
96b70b0
Sync methods, extraEntropy, Point->JPoint, error map. Iteration 8: 80…
paulmillr Jan 17, 2023
5f9abe6
Make default points compressed. Ban DER. Iteration 9: 8111, 424LOC
paulmillr Jan 18, 2023
bf159a9
Update README
paulmillr Jan 18, 2023
a5f8d3a
README
paulmillr Jan 18, 2023
4e5facf
README
paulmillr Jan 18, 2023
0045f1d
Docs
paulmillr Jan 18, 2023
fc66eb3
README
paulmillr Jan 18, 2023
c540054
Docs
paulmillr Jan 18, 2023
b33c164
Docs
paulmillr Jan 18, 2023
f9a140d
Add error messages. bits2int, truncateHash match curves. 8454, 419LOC.
paulmillr Jan 23, 2023
ff5f081
Improve hmac-drbg logic and k generation
paulmillr Jan 24, 2023
99b5732
Rename sign => signAsync, signSync => sign for compat with curves. 85…
paulmillr Jan 24, 2023
d1283ab
Compat with curves. 8768, 439LOC
paulmillr Jan 31, 2023
d0ed59f
Fix hexToNum bug
paulmillr Jan 31, 2023
6c0d92e
Fix deno
paulmillr Jan 31, 2023
1a13705
Link to noble-curves
paulmillr Feb 4, 2023
dddf55b
README
paulmillr Feb 4, 2023
d9cfbb7
Merge branch 'main' into micro
paulmillr Feb 4, 2023
0dee9b0
Updates
paulmillr Feb 4, 2023
021893a
Adjustments
paulmillr Feb 7, 2023
91192ad
Remove rollup, terser
paulmillr Feb 9, 2023
d480436
Improve exports
paulmillr Feb 9, 2023
9011dba
README updates
paulmillr Feb 9, 2023
e68ba4b
Comments
paulmillr Feb 9, 2023
86e4d02
Drop jest. Reuse tests from curves
paulmillr Feb 9, 2023
12039c1
pkg.json
paulmillr Feb 9, 2023
7db987c
ci: use node 19
paulmillr Feb 9, 2023
61276e4
use node:crypto
paulmillr Feb 11, 2023
9247e05
Fix import
paulmillr Mar 15, 2023
49fa33d
Fix deno
paulmillr Mar 15, 2023
9c7d552
Line-up
paulmillr Mar 15, 2023
375b026
Pure-ESM package
paulmillr Mar 15, 2023
2d4cddb
README: 80-char limit
paulmillr Mar 16, 2023
0d7d540
Commit build output and lockfile to repo
paulmillr Mar 16, 2023
7a2bfec
Separate build directory for terser
paulmillr Mar 16, 2023
9aebbc9
Produce index.js with comments
paulmillr Mar 16, 2023
ea8ddce
Merge pull request #92 from paulmillr/micro
paulmillr Mar 16, 2023
9e0336f
readme 80-char limit
paulmillr Mar 16, 2023
13a2a7a
Update benchmark
paulmillr Mar 16, 2023
3b431d1
Fix package.json
paulmillr Mar 16, 2023
3b8a25f
Move min build dir
paulmillr Mar 16, 2023
31313b5
Add min lockfile
paulmillr Mar 16, 2023
7dc7278
It's 4KB!
paulmillr Mar 16, 2023
5a44c98
readme
paulmillr Mar 16, 2023
884f801
Upgrade to Typescript 5
paulmillr Mar 16, 2023
d28d8ee
Refactor more. 8936, 432 loc, 3978b gzipped
paulmillr Mar 18, 2023
ec7b573
Refactor more. 8900, 431 loc, 3968b gzipped
paulmillr Mar 19, 2023
a9ecf72
docs
paulmillr Mar 20, 2023
79ffcef
docs
paulmillr Mar 20, 2023
a8aa7d2
8952, 430 loc, 3988b
paulmillr Mar 21, 2023
90dfc0a
readme
paulmillr Mar 21, 2023
cef4e07
Docs
paulmillr Mar 21, 2023
82e5d6d
docs
paulmillr Mar 21, 2023
883a394
readme
paulmillr Mar 21, 2023
e5abbd5
remove backticks
paulmillr Mar 22, 2023
e566be8
8918, 431loc, 3984b. Move exports below
paulmillr Mar 24, 2023
b1995eb
README
paulmillr Mar 24, 2023
745cb34
Wording
paulmillr Mar 24, 2023
6deef87
wording
paulmillr Mar 24, 2023
c54803c
tags
paulmillr Mar 24, 2023
fe33a30
tags
paulmillr Mar 24, 2023
d38ed22
Release 2.0.0.
paulmillr Mar 24, 2023
6b5e888
Export etc for deno
thejoelw Apr 8, 2023
ac52ba0
Merge pull request #100 from JWalker1995/patch-1
paulmillr Apr 8, 2023
4c47774
Update test vectors and wycheproof
paulmillr Apr 10, 2023
e34780a
README
paulmillr Apr 11, 2023
fc8cfe0
readme
paulmillr Apr 12, 2023
bf2a255
pkg.json
paulmillr Apr 12, 2023
eddf002
test: remove mjs extension from files
paulmillr Apr 22, 2023
1b6dd71
benchmarks
paulmillr Apr 22, 2023
3bab8c1
readme
paulmillr Apr 23, 2023
52e1f99
ci: upgrade nodejs to v20
paulmillr Apr 23, 2023
3e2a7e0
Add secp256k1 compatibility layer URL to readme
paulmillr Apr 26, 2023
474c7c9
Corrects type of `sign` and `signAsync`
MicahZoltu Apr 28, 2023
0fb0d8e
Merge pull request #102 from MicahZoltu/patch-2
paulmillr Apr 29, 2023
7f46213
Narrows return type for sign and signAsync. (#101)
MicahZoltu May 2, 2023
63066e8
test: fix filename in test/tsconfig.json
legobeat May 3, 2023
4080d01
Merge pull request #108 from legobeat/chore-fix-test-tsconfig
paulmillr May 3, 2023
6113de1
ci: test nodejs v16/v18/v20 (#105) and polyfill
legobeat May 3, 2023
6901705
Adjust return type of addRecoveryBit
paulmillr May 3, 2023
f3e7df4
line-up
paulmillr May 5, 2023
cfcb1fa
readme
paulmillr May 7, 2023
3347ae4
readme
paulmillr May 12, 2023
ed5621d
CI: auto-publish to NPM on GH release
paulmillr May 12, 2023
7512bf4
readme
paulmillr May 20, 2023
cfa347b
readme
paulmillr May 20, 2023
3062474
readme
paulmillr May 20, 2023
458128c
readme
paulmillr May 26, 2023
21270b7
readme
paulmillr May 26, 2023
73a0696
readme
paulmillr May 26, 2023
18b09ca
pkg.json: Adjust funding field
paulmillr May 27, 2023
3493958
readme
paulmillr Jun 14, 2023
9ff94ca
Crypto updates
paulmillr Jun 14, 2023
f795a8d
readme rework
paulmillr Jun 14, 2023
eeb3b06
readme
paulmillr Jun 14, 2023
317457d
randomBytes default 32
paulmillr Jun 14, 2023
fda9aed
Add README link to new library noble-ciphers
paulmillr Jun 28, 2023
493e28c
package.json: declare side-effects free
paulmillr Jul 12, 2023
86bd7a3
readme
paulmillr Jul 16, 2023
3cff88f
Improve tsconfig strictness
paulmillr Jul 26, 2023
257ba6a
Adjust some comments
paulmillr Jul 26, 2023
5a6c97e
readme
paulmillr Jul 26, 2023
d45df86
Update security file, bump devdep
paulmillr Sep 4, 2023
a5fa6ee
readme
paulmillr Sep 6, 2023
097b60b
readme
paulmillr Sep 7, 2023
b032053
readme
paulmillr Sep 20, 2023
a87a536
readme
paulmillr Dec 25, 2023
95febd9
readme
paulmillr Jan 25, 2024
24f89fd
readme
paulmillr Feb 8, 2024
d9aabe9
noble-secp256k1 is not handling properly the point at infinity (#121)
Elli610 Feb 19, 2024
a4e165a
readme
paulmillr Mar 5, 2024
48b27e5
Improve u8a check. Add Sig#normalizeS
paulmillr Mar 23, 2024
bc91347
verify: remove length check in msg u8a to match noble-curves
paulmillr Mar 23, 2024
ebec017
test: add basic.test.js from noble-curves that tests types
paulmillr Mar 23, 2024
85f220b
Update build steps to use jsbt
paulmillr Mar 23, 2024
ee3e743
build min: update terser
paulmillr Mar 23, 2024
3f9209d
Remove node 18 from non-polyfilled test
paulmillr Mar 23, 2024
7f49554
Comment clarifying fromAffine
paulmillr Mar 23, 2024
de93875
Fix ci
paulmillr Mar 23, 2024
c473fee
move err slightly
paulmillr Mar 23, 2024
a88605e
Change function to const for better compression
paulmillr Mar 24, 2024
e355b85
Update pkg.json scripts
paulmillr Mar 24, 2024
bd1a2c7
Add upload-release ci workflow
paulmillr Mar 24, 2024
29e0cf1
Release 2.1.0.
paulmillr Mar 24, 2024
06e9a2a
Publish 2.1.0 on jsr
paulmillr Apr 24, 2024
0c8366d
CI: publish jsr only on release
paulmillr Apr 24, 2024
d0aa27d
README
paulmillr May 11, 2024
1177f21
readme
paulmillr May 11, 2024
08030e6
readme
paulmillr May 11, 2024
0f0d9b5
test: Change import assert to import with
paulmillr May 18, 2024
6db9d7c
ci: add node v22
paulmillr May 18, 2024
5249db1
test: prefix imports of built-in modules
paulmillr May 18, 2024
6301cc6
Merge branch 'main' of https://github.com/paulmillr/noble-secp256k1 i…
jojobyte Jul 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/funding.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/nodejs-polyfill.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Run node.js tests with polyfill
on:
- push
- pull_request
jobs:
test:
name: v${{ matrix.node }} @ ubuntu-latest with polyfill
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 18
- 20
- 22
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run build --if-present
- run: npm run test:webcrypto
- run: npm run lint --if-present
32 changes: 19 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: Node CI

on: [push, pull_request]
name: Run node.js tests
on:
- push
- pull_request
jobs:
test:
name: v18 @ ubuntu-latest
name: v${{ matrix.node }} @ ubuntu-latest
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 20
- 22
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm run build --if-present
- run: npm test
- run: npm run lint --if-present
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run build --if-present
- run: npm test
- run: npm run lint --if-present
14 changes: 14 additions & 0 deletions .github/workflows/publish-jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish packge to jsr
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- run: npm install -g jsr
- run: jsr publish --allow-slow-types
23 changes: 23 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish package to npm
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm install -g npm
- run: npm ci
- run: npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/upload-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Upload standalone file to GitHub Releases
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm install -g npm
- run: npm ci
- run: npm run build
- run: npm run build:release
- run: gh release upload ${{ github.event.release.tag_name }} test/build/dashincubator-secp256k1.min.js test/build/dashincubator-secp256k1.min.js.gz
env:
GH_TOKEN: ${{ github.token }}
159 changes: 63 additions & 96 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,26 @@ To use the module with [Deno](https://deno.land), you will need

## API

- [`getPublicKey(privateKey)`](#getpublickeyprivatekey)
- [`sign(msgHash, privateKey)`](#signmsghash-privatekey)
- [`verify(signature, msgHash, publicKey)`](#verifysignature-msghash-publickey)
- [`getSharedSecret(privateKeyA, publicKeyB)`](#getsharedsecretprivatekeya-publickeyb)
- [`recoverPublicKey(hash, signature, recovery)`](#recoverpublickeyhash-signature-recovery)
- [`schnorr.getPublicKey(privateKey)`](#schnorrgetpublickeyprivatekey)
- [`schnorr.sign(message, privateKey)`](#schnorrsignmessage-privatekey)
- [`schnorr.verify(signature, message, publicKey)`](#schnorrverifysignature-message-publickey)
- [Utilities](#utilities)
- [@dashincubator/secp256k1](#dashincubatorsecp256k1)
- [This fork is a standalone browser-compatible release of _noble_ crypto](#this-fork-is-a-standalone-browser-compatible-release-of-noble-crypto)
- [Install](#install)
- [Node, Bun, \& Bundlers](#node-bun--bundlers)
- [Browsers](#browsers)
- [Usage](#usage)
- [API](#api)
- [`getPublicKey(privateKey)`](#getpublickeyprivatekey)
- [`sign(msgHash, privateKey)`](#signmsghash-privatekey)
- [`verify(signature, msgHash, publicKey)`](#verifysignature-msghash-publickey)
- [`getSharedSecret(privateKeyA, publicKeyB)`](#getsharedsecretprivatekeya-publickeyb)
- [`recoverPublicKey(hash, signature, recovery)`](#recoverpublickeyhash-signature-recovery)
- [`schnorr.getPublicKey(privateKey)`](#schnorrgetpublickeyprivatekey)
- [`schnorr.sign(message, privateKey)`](#schnorrsignmessage-privatekey)
- [`schnorr.verify(signature, message, publicKey)`](#schnorrverifysignature-message-publickey)
- [Utilities](#utilities)
- [Security](#security)
- [Speed](#speed)
- [Contributing](#contributing)
- [License](#license)

##### `getPublicKey(privateKey)`

Expand Down Expand Up @@ -340,84 +351,44 @@ console.log(hex);

```typescript
const utils: {
// Can take 40 or more bytes of uniform input e.g. from CSPRNG or KDF
// and convert them into private key, with the modulo bias being neglible.
// As per FIPS 186 B.1.1.
hashToPrivateKey: (hash: Hex) => Uint8Array;
// Returns `Uint8Array` of 32 cryptographically secure random bytes that can be used as private key
randomPrivateKey: () => Uint8Array;
// Checks private key for validity
isValidPrivateKey(privateKey: PrivKey): boolean;

// Returns `Uint8Array` of x cryptographically secure random bytes.
randomBytes: (bytesLength?: number) => Uint8Array;
// Converts Uint8Array to hex string
bytesToHex(uint8a: Uint8Array): string;
hexToBytes(hex: string): Uint8Array;
concatBytes(...arrays: Uint8Array[]): Uint8Array;
// Modular division over curve prime
mod: (number: number | bigint, modulo = CURVE.P): bigint;
// Modular inversion
invert(number: bigint, modulo?: bigint): bigint;

sha256: (message: Uint8Array) => Promise<Uint8Array>;
hmacSha256: (key: Uint8Array, ...messages: Uint8Array[]) => Promise<Uint8Array>;

// You can set up your synchronous methods for `signSync`/`signSchnorrSync` to work.
// The argument order is identical to async methods from above
sha256Sync: undefined;
hmacSha256Sync: undefined;

// BIP0340-style tagged hashes
taggedHash: (tag: string, ...messages: Uint8Array[]) => Promise<Uint8Array>;
taggedHashSync: (tag: string, ...messages: Uint8Array[]) => Uint8Array;

// 1. Returns cached point which you can use to pass to `getSharedSecret` or to `#multiply` by it.
// 2. Precomputes point multiplication table. Is done by default on first `getPublicKey()` call.
// If you want your first getPublicKey to take 0.16ms instead of 20ms, make sure to call
// utils.precompute() somewhere without arguments first.
precompute(windowSize?: number, point?: Point): Point;
normPrivateKeyToScalar: (p: PrivKey) => bigint;
randomPrivateKey: () => Bytes; // Uses CSPRNG https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
isValidPrivateKey: (key: Hex) => boolean;
precompute(p: ProjectivePoint, windowSize?: number): ProjectivePoint;
};

secp256k1.CURVE.P // Field, 2 ** 256 - 2 ** 32 - 977
secp256k1.CURVE.n // Order, 2 ** 256 - 432420386565659656852420866394968145599
secp256k1.Point.BASE // new secp256k1.Point(Gx, Gy) where
// Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240n
// Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424n;

// Elliptic curve point in Affine (x, y) coordinates.
secp256k1.Point {
constructor(x: bigint, y: bigint);
// Supports compressed and non-compressed hex
static fromHex(hex: Uint8Array | string);
static fromPrivateKey(privateKey: Uint8Array | string | number | bigint);
static fromSignature(
msgHash: Hex,
signature: Signature,
recovery: number | bigint
): Point | undefined {
toRawBytes(isCompressed = false): Uint8Array;
toHex(isCompressed = false): string;
equals(other: Point): boolean;
negate(): Point;
add(other: Point): Point;
subtract(other: Point): Point;
// Constant-time scalar multiplication.
multiply(scalar: bigint | Uint8Array): Point;
}
secp256k1.Signature {
constructor(r: bigint, s: bigint);
// DER encoded ECDSA signature
static fromDER(hex: Uint8Array | string);
// R, S 32-byte each
static fromCompact(hex: Uint8Array | string);
class ProjectivePoint {
constructor(px: bigint, py: bigint, pz: bigint);
static readonly BASE: ProjectivePoint;
static readonly ZERO: ProjectivePoint;
static fromAffine(point: AffinePoint): ProjectivePoint;
static fromHex(hex: Hex): ProjectivePoint;
static fromPrivateKey(n: PrivKey): ProjectivePoint;
get x(): bigint;
get y(): bigint;
add(other: ProjectivePoint): ProjectivePoint;
assertValidity(): void;
hasHighS(): boolean; // high-S sigs cannot be produced using { canonical: true }
toDERRawBytes(): Uint8Array;
toDERHex(): string;
toCompactRawBytes(): Uint8Array;
equals(other: ProjectivePoint): boolean;
multiply(n: bigint): ProjectivePoint;
negate(): ProjectivePoint;
subtract(other: ProjectivePoint): ProjectivePoint;
toAffine(): AffinePoint;
toHex(isCompressed?: boolean): string;
toRawBytes(isCompressed?: boolean): Bytes;
}
class Signature {
constructor(r: bigint, s: bigint, recovery?: number | undefined);
static fromCompact(hex: Hex): Signature;
readonly r: bigint;
readonly s: bigint;
readonly recovery?: number | undefined;
ok(): Signature;
hasHighS(): boolean;
normalizeS(): Signature;
recoverPublicKey(msgh: Hex): Point;
toCompactRawBytes(): Bytes;
toCompactHex(): string;
}
CURVE; // curve prime; order; equation params, generator coordinates
```

## Security
Expand Down Expand Up @@ -455,18 +426,16 @@ is to minimize this attack vector.

## Speed

Benchmarks measured with Apple M2 on MacOS 12 with node.js 18.8.
Use [noble-curves](https://github.com/paulmillr/noble-curves) if you need even higher performance.

Benchmarks measured with Apple M2 on MacOS 13 with node.js 20.

getPublicKey(utils.randomPrivateKey()) x 7,093 ops/sec @ 140μs/op
sign x 5,615 ops/sec @ 178μs/op
signSync (@noble/hashes) x 5,209 ops/sec @ 191μs/op
verify x 1,114 ops/sec @ 896μs/op
recoverPublicKey x 1,018 ops/sec @ 982μs/op
getSharedSecret aka ecdh x 665 ops/sec @ 1ms/op
getSharedSecret (precomputed) x 7,426 ops/sec @ 134μs/op
Point.fromHex (decompression) x 14,582 ops/sec @ 68μs/op
schnorr.sign x 805 ops/sec @ 1ms/op
schnorr.verify x 1,129 ops/sec @ 885μs/op
getPublicKey(utils.randomPrivateKey()) x 6,430 ops/sec @ 155μs/op
sign x 3,367 ops/sec @ 296μs/op
verify x 600 ops/sec @ 1ms/op
getSharedSecret x 505 ops/sec @ 1ms/op
recoverPublicKey x 612 ops/sec @ 1ms/op
Point.fromHex (decompression) x 9,185 ops/sec @ 108μs/op

Compare to other libraries on M1 (`openssl` uses native bindings, not JS):

Expand All @@ -477,13 +446,11 @@ Compare to other libraries on M1 (`openssl` uses native bindings, not JS):
sjcl#sign x 199 ops/sec
openssl#sign x 4,243 ops/sec
ecdsa#sign x 116 ops/sec
bip-schnorr#sign x 60 ops/sec

elliptic#verify x 812 ops/sec
sjcl#verify x 166 ops/sec
openssl#verify x 4,452 ops/sec
ecdsa#verify x 80 ops/sec
bip-schnorr#verify x 56 ops/sec

elliptic#ecdh x 971 ops/sec

Expand Down
2 changes: 2 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Security Policy

See [README's Security section](./README.md#security) for detailed description of internal security practices.

## Supported Versions

| Version | Supported |
Expand Down
Loading