forked from tornado-packages/noble-curves
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b8ddb603c1 | ||
|
943edbceba |
1
.github/funding.yml
vendored
1
.github/funding.yml
vendored
@ -1 +1,2 @@
|
|||||||
github: paulmillr
|
github: paulmillr
|
||||||
|
# custom: https://paulmillr.com/funding/
|
15
.github/workflows/nodejs.yml
vendored
15
.github/workflows/nodejs.yml
vendored
@ -1,20 +1,17 @@
|
|||||||
name: Run node.js tests
|
name: Node CI
|
||||||
on:
|
|
||||||
- push
|
on: [push, pull_request]
|
||||||
- pull_request
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: v${{ matrix.node }} @ ubuntu-latest
|
name: v${{ matrix.node }} @ ubuntu-latest
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node:
|
node: [18, 20]
|
||||||
- 18
|
|
||||||
- 20
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
|
- uses: actions/checkout@v3
|
||||||
- name: Use Node.js ${{ matrix.node }}
|
- name: Use Node.js ${{ matrix.node }}
|
||||||
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
6
.github/workflows/publish-npm.yml
vendored
6
.github/workflows/publish-npm.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Publish package to npm
|
name: Publish Package to npm
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
@ -9,8 +9,8 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
|
||||||
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
|
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
28
.github/workflows/upload-release.yml
vendored
28
.github/workflows/upload-release.yml
vendored
@ -1,28 +0,0 @@
|
|||||||
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: |
|
|
||||||
cd build
|
|
||||||
npm ci
|
|
||||||
npm run build:release
|
|
||||||
cd ..
|
|
||||||
- run: gh release upload ${{ github.event.release.tag_name }} build/`npx jsbt outfile`
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
31
README.md
31
README.md
@ -7,18 +7,14 @@ Audited & minimal JS implementation of elliptic curve cryptography.
|
|||||||
- 🏎 Ultra-fast, hand-optimized for caveats of JS engines
|
- 🏎 Ultra-fast, hand-optimized for caveats of JS engines
|
||||||
- 🔍 Unique tests ensure correctness: property-based, cross-library and Wycheproof vectors, fuzzing
|
- 🔍 Unique tests ensure correctness: property-based, cross-library and Wycheproof vectors, fuzzing
|
||||||
- ➰ Short Weierstrass, Edwards, Montgomery curves
|
- ➰ Short Weierstrass, Edwards, Montgomery curves
|
||||||
- ✍️ ECDSA, EdDSA, Schnorr, BLS signature schemes, ECDH key agreement, hashing to curves
|
- ✍️ ECDSA, EdDSA, Schnorr, BLS signature schemes, ECDH key agreement
|
||||||
- 🔖 SUF-CMA, SBS (non-repudiation), ZIP215 (consensus friendliness) features for ed25519
|
- 🔖 SUF-CMA, SBS (non-repudiation), ZIP215 (consensus friendliness) features for ed25519
|
||||||
|
- #️⃣ hash-to-curve for encoding or hashing an arbitrary string to an elliptic curve point
|
||||||
- 🧜♂️ Poseidon ZK-friendly hash
|
- 🧜♂️ Poseidon ZK-friendly hash
|
||||||
- 🪶 178KB for everything, 25KB for single-curve build
|
|
||||||
|
|
||||||
For discussions, questions and support, visit
|
### This library belongs to _noble_ crypto
|
||||||
[GitHub Discussions](https://github.com/paulmillr/noble-curves/discussions)
|
|
||||||
section of the repository.
|
|
||||||
|
|
||||||
### This library belongs to _noble_ cryptography
|
> **noble-crypto** — high-security, easily auditable set of contained cryptographic libraries and tools.
|
||||||
|
|
||||||
> **noble cryptography** — high-security, easily auditable set of contained cryptographic libraries and tools.
|
|
||||||
|
|
||||||
- Zero or minimal dependencies
|
- Zero or minimal dependencies
|
||||||
- Highly readable TypeScript / JS code
|
- Highly readable TypeScript / JS code
|
||||||
@ -26,10 +22,7 @@ section of the repository.
|
|||||||
- All libraries:
|
- All libraries:
|
||||||
[ciphers](https://github.com/paulmillr/noble-ciphers),
|
[ciphers](https://github.com/paulmillr/noble-ciphers),
|
||||||
[curves](https://github.com/paulmillr/noble-curves),
|
[curves](https://github.com/paulmillr/noble-curves),
|
||||||
[hashes](https://github.com/paulmillr/noble-hashes),
|
[hashes](https://github.com/paulmillr/noble-hashes)
|
||||||
[post-quantum](https://github.com/paulmillr/noble-post-quantum),
|
|
||||||
4kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) /
|
|
||||||
[ed25519](https://github.com/paulmillr/noble-ed25519)
|
|
||||||
- [Check out homepage](https://paulmillr.com/noble/)
|
- [Check out homepage](https://paulmillr.com/noble/)
|
||||||
for reading resources, documentation and apps built with noble
|
for reading resources, documentation and apps built with noble
|
||||||
|
|
||||||
@ -45,7 +38,7 @@ A standalone file [noble-curves.js](https://github.com/paulmillr/noble-curves/re
|
|||||||
```js
|
```js
|
||||||
// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size
|
// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size
|
||||||
import { secp256k1 } from '@noble/curves/secp256k1'; // ESM and Common.js
|
import { secp256k1 } from '@noble/curves/secp256k1'; // ESM and Common.js
|
||||||
// import { secp256k1 } from 'npm:@noble/curves@1.4.0/secp256k1'; // Deno
|
// import { secp256k1 } from 'npm:@noble/curves@1.2.0/secp256k1'; // Deno
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Implementations](#implementations)
|
- [Implementations](#implementations)
|
||||||
@ -246,7 +239,7 @@ Same RFC7748 / RFC8032 / IRTF draft are followed.
|
|||||||
|
|
||||||
#### bls12-381
|
#### bls12-381
|
||||||
|
|
||||||
See [abstract/bls](#bls-barreto-lynn-scott-curves).
|
See [abstract/bls](#abstractbls-barreto-lynn-scott-curves).
|
||||||
|
|
||||||
#### All available imports
|
#### All available imports
|
||||||
|
|
||||||
@ -555,7 +548,7 @@ import { Field } from '@noble/curves/abstract/modular';
|
|||||||
const x25519 = montgomery({
|
const x25519 = montgomery({
|
||||||
a: 486662n,
|
a: 486662n,
|
||||||
Gu: 9n,
|
Gu: 9n,
|
||||||
P: 2n ** 255n - 19n,
|
Fp: Field(2n ** 255n - 19n),
|
||||||
montgomeryBits: 255,
|
montgomeryBits: 255,
|
||||||
nByteLength: 32,
|
nByteLength: 32,
|
||||||
// Optional param
|
// Optional param
|
||||||
@ -613,12 +606,6 @@ const signature = bls.sign(message, privateKey);
|
|||||||
const isValid = bls.verify(signature, message, publicKey);
|
const isValid = bls.verify(signature, message, publicKey);
|
||||||
console.log({ publicKey, signature, isValid });
|
console.log({ publicKey, signature, isValid });
|
||||||
|
|
||||||
// Use custom DST, e.g. for Ethereum consensus layer
|
|
||||||
const htfEthereum = {DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_'};
|
|
||||||
const signatureEth = bls.sign(message, privateKey, htfEthereum);
|
|
||||||
const isValidEth = bls.verify(signature, message, publicKey, htfEthereum);
|
|
||||||
console.log({ signatureEth, isValidEth });
|
|
||||||
|
|
||||||
// Sign 1 msg with 3 keys
|
// Sign 1 msg with 3 keys
|
||||||
const privateKeys = [
|
const privateKeys = [
|
||||||
'18f020b98eb798752a50ed0563b079c125b0db5dd0b1060d1c1b47d4a193e1e4',
|
'18f020b98eb798752a50ed0563b079c125b0db5dd0b1060d1c1b47d4a193e1e4',
|
||||||
@ -771,7 +758,7 @@ and [RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-5.2).
|
|||||||
This means, for 32-byte key, we would need 48-byte hash to get 2^-128 bias, which matches curve security level.
|
This means, for 32-byte key, we would need 48-byte hash to get 2^-128 bias, which matches curve security level.
|
||||||
|
|
||||||
`hashToPrivateScalar()` that hashes to **private key** was created for this purpose.
|
`hashToPrivateScalar()` that hashes to **private key** was created for this purpose.
|
||||||
Use [abstract/hash-to-curve](#hash-to-curve-hashing-strings-to-curve-points)
|
Use [abstract/hash-to-curve](#abstracthash-to-curve-hashing-strings-to-curve-points)
|
||||||
if you need to hash to **public key**.
|
if you need to hash to **public key**.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# build
|
# build
|
||||||
|
|
||||||
The directory is used to build a single file which contains everything.
|
The directory is used to build a single file `noble-curves.js` which contains everything.
|
||||||
|
|
||||||
The single file uses iife wrapper and can be used in browsers as-is.
|
The output file uses iife wrapper and can be used in browsers as-is.
|
||||||
|
|
||||||
Don't use it unless you can't use NPM/ESM, which support tree shaking.
|
Don't use it unless you can't use NPM/ESM, which support tree shaking.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { bytesToHex, concatBytes, hexToBytes, utf8ToBytes } from '@noble/curves/abstract/utils';
|
import { bytesToHex, concatBytes, hexToBytes } from '@noble/curves/abstract/utils';
|
||||||
|
|
||||||
export { secp256k1, schnorr as secp256k1_schnorr } from '@noble/curves/secp256k1';
|
export { secp256k1, schnorr as secp256k1_schnorr } from '@noble/curves/secp256k1';
|
||||||
export {
|
export {
|
||||||
@ -17,4 +17,4 @@ export { p384 } from '@noble/curves/p384';
|
|||||||
export { p521 } from '@noble/curves/p521';
|
export { p521 } from '@noble/curves/p521';
|
||||||
export { bls12_381 } from '@noble/curves/bls12-381';
|
export { bls12_381 } from '@noble/curves/bls12-381';
|
||||||
|
|
||||||
export const utils = { bytesToHex, concatBytes, hexToBytes, utf8ToBytes };
|
export const utils = { bytesToHex, concatBytes, hexToBytes };
|
||||||
|
445
build/package-lock.json
generated
445
build/package-lock.json
generated
@ -1,445 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "build",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {
|
|
||||||
"": {
|
|
||||||
"name": "build",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"devDependencies": {
|
|
||||||
"@noble/curves": "file:..",
|
|
||||||
"esbuild": "0.20.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"..": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@noble/hashes": "1.4.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@paulmillr/jsbt": "0.1.0",
|
|
||||||
"fast-check": "3.0.0",
|
|
||||||
"micro-bmark": "0.3.1",
|
|
||||||
"micro-should": "0.4.0",
|
|
||||||
"prettier": "3.1.1",
|
|
||||||
"typescript": "5.3.2"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://paulmillr.com/funding/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/aix-ppc64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==",
|
|
||||||
"cpu": [
|
|
||||||
"ppc64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"aix"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/android-arm": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==",
|
|
||||||
"cpu": [
|
|
||||||
"arm"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"android"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/android-arm64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"android"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/android-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"android"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/darwin-arm64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"darwin"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/darwin-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"darwin"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/freebsd-arm64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"freebsd"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/freebsd-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"freebsd"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-arm": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==",
|
|
||||||
"cpu": [
|
|
||||||
"arm"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-arm64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-ia32": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==",
|
|
||||||
"cpu": [
|
|
||||||
"ia32"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-loong64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==",
|
|
||||||
"cpu": [
|
|
||||||
"loong64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-mips64el": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==",
|
|
||||||
"cpu": [
|
|
||||||
"mips64el"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-ppc64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==",
|
|
||||||
"cpu": [
|
|
||||||
"ppc64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-riscv64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==",
|
|
||||||
"cpu": [
|
|
||||||
"riscv64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-s390x": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==",
|
|
||||||
"cpu": [
|
|
||||||
"s390x"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/linux-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/netbsd-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"netbsd"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/openbsd-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"openbsd"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/sunos-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"sunos"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/win32-arm64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/win32-ia32": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==",
|
|
||||||
"cpu": [
|
|
||||||
"ia32"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@esbuild/win32-x64": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@noble/curves": {
|
|
||||||
"resolved": "..",
|
|
||||||
"link": true
|
|
||||||
},
|
|
||||||
"node_modules/esbuild": {
|
|
||||||
"version": "0.20.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.1.tgz",
|
|
||||||
"integrity": "sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==",
|
|
||||||
"dev": true,
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"bin": {
|
|
||||||
"esbuild": "bin/esbuild"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"@esbuild/aix-ppc64": "0.20.1",
|
|
||||||
"@esbuild/android-arm": "0.20.1",
|
|
||||||
"@esbuild/android-arm64": "0.20.1",
|
|
||||||
"@esbuild/android-x64": "0.20.1",
|
|
||||||
"@esbuild/darwin-arm64": "0.20.1",
|
|
||||||
"@esbuild/darwin-x64": "0.20.1",
|
|
||||||
"@esbuild/freebsd-arm64": "0.20.1",
|
|
||||||
"@esbuild/freebsd-x64": "0.20.1",
|
|
||||||
"@esbuild/linux-arm": "0.20.1",
|
|
||||||
"@esbuild/linux-arm64": "0.20.1",
|
|
||||||
"@esbuild/linux-ia32": "0.20.1",
|
|
||||||
"@esbuild/linux-loong64": "0.20.1",
|
|
||||||
"@esbuild/linux-mips64el": "0.20.1",
|
|
||||||
"@esbuild/linux-ppc64": "0.20.1",
|
|
||||||
"@esbuild/linux-riscv64": "0.20.1",
|
|
||||||
"@esbuild/linux-s390x": "0.20.1",
|
|
||||||
"@esbuild/linux-x64": "0.20.1",
|
|
||||||
"@esbuild/netbsd-x64": "0.20.1",
|
|
||||||
"@esbuild/openbsd-x64": "0.20.1",
|
|
||||||
"@esbuild/sunos-x64": "0.20.1",
|
|
||||||
"@esbuild/win32-arm64": "0.20.1",
|
|
||||||
"@esbuild/win32-ia32": "0.20.1",
|
|
||||||
"@esbuild/win32-x64": "0.20.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,13 +2,17 @@
|
|||||||
"name": "build",
|
"name": "build",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"description": "Used to build a single file",
|
||||||
"main": "input.js",
|
"main": "input.js",
|
||||||
|
"keywords": [],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"author": "",
|
||||||
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@noble/curves": "file:..",
|
"@noble/curves": "..",
|
||||||
"esbuild": "0.20.1"
|
"esbuild": "0.18.11"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:release": "npx esbuild --bundle input.js --outfile=`npx jsbt outfile` --global-name=`npx jsbt global`"
|
"build": "npx esbuild --bundle input.js --outfile=noble-curves.js --global-name=nobleCurves"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
package-lock.json
generated
26
package-lock.json
generated
@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "@tornado/noble-curves",
|
"name": "@noble/curves",
|
||||||
"version": "1.4.0",
|
"version": "1.3.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@tornado/noble-curves",
|
"name": "@noble/curves",
|
||||||
"version": "1.4.0",
|
"version": "1.3.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/hashes": "1.4.0"
|
"@noble/hashes": "1.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@paulmillr/jsbt": "0.1.0",
|
|
||||||
"fast-check": "3.0.0",
|
"fast-check": "3.0.0",
|
||||||
"micro-bmark": "0.3.1",
|
"micro-bmark": "0.3.1",
|
||||||
"micro-should": "0.4.0",
|
"micro-should": "0.4.0",
|
||||||
@ -24,9 +23,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@noble/hashes": {
|
"node_modules/@noble/hashes": {
|
||||||
"version": "1.4.0",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz",
|
||||||
"integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==",
|
"integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 16"
|
"node": ">= 16"
|
||||||
},
|
},
|
||||||
@ -34,15 +33,6 @@
|
|||||||
"url": "https://paulmillr.com/funding/"
|
"url": "https://paulmillr.com/funding/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@paulmillr/jsbt": {
|
|
||||||
"version": "0.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@paulmillr/jsbt/-/jsbt-0.1.0.tgz",
|
|
||||||
"integrity": "sha512-TdowoHD36hkZARv6LW4jenkVTdK2vP0sy4ZM8E9MxaqAAIRdwmn3RlB+zWkEHi4hKTgLqMGkURfNkFtt0STX2Q==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"jsbt": "jsbt.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fast-check": {
|
"node_modules/fast-check": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.0.0.tgz",
|
||||||
|
11
package.json
11
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tornado/noble-curves",
|
"name": "@noble/curves",
|
||||||
"version": "1.4.0",
|
"version": "1.3.0",
|
||||||
"description": "Audited & minimal JS implementation of elliptic curve cryptography",
|
"description": "Audited & minimal JS implementation of elliptic curve cryptography",
|
||||||
"files": [
|
"files": [
|
||||||
"abstract",
|
"abstract",
|
||||||
@ -14,7 +14,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"bench": "cd benchmark; node secp256k1.js; node curves.js; node ecdh.js; node hash-to-curve.js; node modular.js; node bls.js; node ristretto255.js; node decaf448.js",
|
"bench": "cd benchmark; node secp256k1.js; node curves.js; node ecdh.js; node hash-to-curve.js; node modular.js; node bls.js; node ristretto255.js; node decaf448.js",
|
||||||
"build": "tsc && tsc -p tsconfig.esm.json",
|
"build": "tsc && tsc -p tsconfig.esm.json",
|
||||||
"build:release": "cd build && npm i && npm run build",
|
"build:release": "cd build; npm install && npm run build",
|
||||||
"build:clean": "rm *.{js,d.ts,d.ts.map,js.map} esm/*.{js,d.ts,d.ts.map,js.map} 2> /dev/null",
|
"build:clean": "rm *.{js,d.ts,d.ts.map,js.map} esm/*.{js,d.ts,d.ts.map,js.map} 2> /dev/null",
|
||||||
"lint": "prettier --check 'src/**/*.{js,ts}' 'test/*.js'",
|
"lint": "prettier --check 'src/**/*.{js,ts}' 'test/*.js'",
|
||||||
"format": "prettier --write 'src/**/*.{js,ts}' 'test/*.js'",
|
"format": "prettier --write 'src/**/*.{js,ts}' 'test/*.js'",
|
||||||
@ -24,14 +24,13 @@
|
|||||||
"homepage": "https://paulmillr.com/noble/",
|
"homepage": "https://paulmillr.com/noble/",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.tornado.ws/tornado-packages/noble-curvest"
|
"url": "git+https://github.com/paulmillr/noble-curves.git"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/hashes": "1.4.0"
|
"@noble/hashes": "1.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@paulmillr/jsbt": "0.1.0",
|
|
||||||
"fast-check": "3.0.0",
|
"fast-check": "3.0.0",
|
||||||
"micro-bmark": "0.3.1",
|
"micro-bmark": "0.3.1",
|
||||||
"micro-should": "0.4.0",
|
"micro-should": "0.4.0",
|
||||||
|
@ -83,12 +83,12 @@ export type CurveFn<Fp, Fp2, Fp6, Fp12> = {
|
|||||||
getPublicKey: (privateKey: PrivKey) => Uint8Array;
|
getPublicKey: (privateKey: PrivKey) => Uint8Array;
|
||||||
getPublicKeyForShortSignatures: (privateKey: PrivKey) => Uint8Array;
|
getPublicKeyForShortSignatures: (privateKey: PrivKey) => Uint8Array;
|
||||||
sign: {
|
sign: {
|
||||||
(message: Hex, privateKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array;
|
(message: Hex, privateKey: PrivKey): Uint8Array;
|
||||||
(message: ProjPointType<Fp2>, privateKey: PrivKey, htfOpts?: htfBasicOpts): ProjPointType<Fp2>;
|
(message: ProjPointType<Fp2>, privateKey: PrivKey): ProjPointType<Fp2>;
|
||||||
};
|
};
|
||||||
signShortSignature: {
|
signShortSignature: {
|
||||||
(message: Hex, privateKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array;
|
(message: Hex, privateKey: PrivKey): Uint8Array;
|
||||||
(message: ProjPointType<Fp>, privateKey: PrivKey, htfOpts?: htfBasicOpts): ProjPointType<Fp>;
|
(message: ProjPointType<Fp>, privateKey: PrivKey): ProjPointType<Fp>;
|
||||||
};
|
};
|
||||||
verify: (
|
verify: (
|
||||||
signature: Hex | ProjPointType<Fp2>,
|
signature: Hex | ProjPointType<Fp2>,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import type { Group, GroupConstructor, AffinePoint } from './curve.js';
|
import type { Group, GroupConstructor, AffinePoint } from './curve.js';
|
||||||
import { mod, IField } from './modular.js';
|
import { mod, IField } from './modular.js';
|
||||||
import type { CHash } from './utils.js';
|
import type { CHash } from './utils.js';
|
||||||
import { bytesToNumberBE, abytes, concatBytes, utf8ToBytes, validateObject } from './utils.js';
|
import { bytesToNumberBE, isBytes, concatBytes, utf8ToBytes, validateObject } from './utils.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* * `DST` is a domain separation tag, defined in section 2.2.5
|
* * `DST` is a domain separation tag, defined in section 2.2.5
|
||||||
@ -22,6 +22,12 @@ export type Opts = {
|
|||||||
hash: CHash;
|
hash: CHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function validateDST(dst: UnicodeOrBytes): Uint8Array {
|
||||||
|
if (isBytes(dst)) return dst;
|
||||||
|
if (typeof dst === 'string') return utf8ToBytes(dst);
|
||||||
|
throw new Error('DST must be Uint8Array or string');
|
||||||
|
}
|
||||||
|
|
||||||
// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE.
|
// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE.
|
||||||
const os2ip = bytesToNumberBE;
|
const os2ip = bytesToNumberBE;
|
||||||
|
|
||||||
@ -46,7 +52,10 @@ function strxor(a: Uint8Array, b: Uint8Array): Uint8Array {
|
|||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function anum(item: unknown): void {
|
function abytes(item: unknown): void {
|
||||||
|
if (!isBytes(item)) throw new Error('Uint8Array expected');
|
||||||
|
}
|
||||||
|
function isNum(item: unknown): void {
|
||||||
if (!Number.isSafeInteger(item)) throw new Error('number expected');
|
if (!Number.isSafeInteger(item)) throw new Error('number expected');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +69,7 @@ export function expand_message_xmd(
|
|||||||
): Uint8Array {
|
): Uint8Array {
|
||||||
abytes(msg);
|
abytes(msg);
|
||||||
abytes(DST);
|
abytes(DST);
|
||||||
anum(lenInBytes);
|
isNum(lenInBytes);
|
||||||
// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3
|
// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3
|
||||||
if (DST.length > 255) DST = H(concatBytes(utf8ToBytes('H2C-OVERSIZE-DST-'), DST));
|
if (DST.length > 255) DST = H(concatBytes(utf8ToBytes('H2C-OVERSIZE-DST-'), DST));
|
||||||
const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H;
|
const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H;
|
||||||
@ -94,7 +103,7 @@ export function expand_message_xof(
|
|||||||
): Uint8Array {
|
): Uint8Array {
|
||||||
abytes(msg);
|
abytes(msg);
|
||||||
abytes(DST);
|
abytes(DST);
|
||||||
anum(lenInBytes);
|
isNum(lenInBytes);
|
||||||
// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3
|
// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3
|
||||||
// DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8));
|
// DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8));
|
||||||
if (DST.length > 255) {
|
if (DST.length > 255) {
|
||||||
@ -132,8 +141,8 @@ export function hash_to_field(msg: Uint8Array, count: number, options: Opts): bi
|
|||||||
});
|
});
|
||||||
const { p, k, m, hash, expand, DST: _DST } = options;
|
const { p, k, m, hash, expand, DST: _DST } = options;
|
||||||
abytes(msg);
|
abytes(msg);
|
||||||
anum(count);
|
isNum(count);
|
||||||
const DST = typeof _DST === 'string' ? utf8ToBytes(_DST) : _DST;
|
const DST = validateDST(_DST);
|
||||||
const log2p = p.toString(2).length;
|
const log2p = p.toString(2).length;
|
||||||
const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above
|
const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above
|
||||||
const len_in_bytes = count * m * L;
|
const len_in_bytes = count * m * L;
|
||||||
|
@ -23,10 +23,6 @@ export function isBytes(a: unknown): a is Uint8Array {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function abytes(item: unknown): void {
|
|
||||||
if (!isBytes(item)) throw new Error('Uint8Array expected');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Array where index 0xf0 (240) is mapped to string 'f0'
|
// Array where index 0xf0 (240) is mapped to string 'f0'
|
||||||
const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>
|
const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>
|
||||||
i.toString(16).padStart(2, '0')
|
i.toString(16).padStart(2, '0')
|
||||||
@ -35,7 +31,7 @@ const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>
|
|||||||
* @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
|
* @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
|
||||||
*/
|
*/
|
||||||
export function bytesToHex(bytes: Uint8Array): string {
|
export function bytesToHex(bytes: Uint8Array): string {
|
||||||
abytes(bytes);
|
if (!isBytes(bytes)) throw new Error('Uint8Array expected');
|
||||||
// pre-caching improves the speed 6x
|
// pre-caching improves the speed 6x
|
||||||
let hex = '';
|
let hex = '';
|
||||||
for (let i = 0; i < bytes.length; i++) {
|
for (let i = 0; i < bytes.length; i++) {
|
||||||
@ -90,7 +86,7 @@ export function bytesToNumberBE(bytes: Uint8Array): bigint {
|
|||||||
return hexToNumber(bytesToHex(bytes));
|
return hexToNumber(bytesToHex(bytes));
|
||||||
}
|
}
|
||||||
export function bytesToNumberLE(bytes: Uint8Array): bigint {
|
export function bytesToNumberLE(bytes: Uint8Array): bigint {
|
||||||
abytes(bytes);
|
if (!isBytes(bytes)) throw new Error('Uint8Array expected');
|
||||||
return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));
|
return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +138,7 @@ export function concatBytes(...arrays: Uint8Array[]): Uint8Array {
|
|||||||
let sum = 0;
|
let sum = 0;
|
||||||
for (let i = 0; i < arrays.length; i++) {
|
for (let i = 0; i < arrays.length; i++) {
|
||||||
const a = arrays[i];
|
const a = arrays[i];
|
||||||
abytes(a);
|
if (!isBytes(a)) throw new Error('Uint8Array expected');
|
||||||
sum += a.length;
|
sum += a.length;
|
||||||
}
|
}
|
||||||
const res = new Uint8Array(sum);
|
const res = new Uint8Array(sum);
|
||||||
@ -198,9 +194,9 @@ export function bitGet(n: bigint, pos: number) {
|
|||||||
/**
|
/**
|
||||||
* Sets single bit at position.
|
* Sets single bit at position.
|
||||||
*/
|
*/
|
||||||
export function bitSet(n: bigint, pos: number, value: boolean) {
|
export const bitSet = (n: bigint, pos: number, value: boolean) => {
|
||||||
return n | ((value ? _1n : _0n) << BigInt(pos));
|
return n | ((value ? _1n : _0n) << BigInt(pos));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate mask for N bits. Not using ** operator with bigints because of old engines.
|
* Calculate mask for N bits. Not using ** operator with bigints because of old engines.
|
||||||
|
@ -27,7 +27,7 @@ export type BasicWCurve<T> = BasicCurve<T> & {
|
|||||||
clearCofactor?: (c: ProjConstructor<T>, point: ProjPointType<T>) => ProjPointType<T>;
|
clearCofactor?: (c: ProjConstructor<T>, point: ProjPointType<T>) => ProjPointType<T>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Entropy = Hex | boolean;
|
type Entropy = Hex | true;
|
||||||
export type SignOpts = { lowS?: boolean; extraEntropy?: Entropy; prehash?: boolean };
|
export type SignOpts = { lowS?: boolean; extraEntropy?: Entropy; prehash?: boolean };
|
||||||
export type VerOpts = { lowS?: boolean; prehash?: boolean };
|
export type VerOpts = { lowS?: boolean; prehash?: boolean };
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ export const DER = {
|
|||||||
// parse DER signature
|
// parse DER signature
|
||||||
const { Err: E } = DER;
|
const { Err: E } = DER;
|
||||||
const data = typeof hex === 'string' ? h2b(hex) : hex;
|
const data = typeof hex === 'string' ? h2b(hex) : hex;
|
||||||
ut.abytes(data);
|
if (!ut.isBytes(data)) throw new Error('ui8a expected');
|
||||||
let l = data.length;
|
let l = data.length;
|
||||||
if (l < 2 || data[0] != 0x30) throw new E('Invalid signature tag');
|
if (l < 2 || data[0] != 0x30) throw new E('Invalid signature tag');
|
||||||
if (data[1] !== l - 2) throw new E('Invalid signature: incorrect length');
|
if (data[1] !== l - 2) throw new E('Invalid signature: incorrect length');
|
||||||
@ -977,7 +977,7 @@ export function weierstrass(curveDef: CurveType): CurveFn {
|
|||||||
const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint
|
const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint
|
||||||
const seedArgs = [int2octets(d), int2octets(h1int)];
|
const seedArgs = [int2octets(d), int2octets(h1int)];
|
||||||
// extraEntropy. RFC6979 3.6: additional k' (optional).
|
// extraEntropy. RFC6979 3.6: additional k' (optional).
|
||||||
if (ent != null && ent !== false) {
|
if (ent != null) {
|
||||||
// K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')
|
// K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')
|
||||||
const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is
|
const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is
|
||||||
seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes
|
seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes
|
||||||
|
@ -1364,7 +1364,7 @@ export const bls12_381: CurveFn<Fp, Fp2, Fp6, Fp12> = bls({
|
|||||||
fromHex(hex: Hex): ProjPointType<Fp2> {
|
fromHex(hex: Hex): ProjPointType<Fp2> {
|
||||||
const { infinity, sort, value } = parseMask(ensureBytes('signatureHex', hex));
|
const { infinity, sort, value } = parseMask(ensureBytes('signatureHex', hex));
|
||||||
const P = Fp.ORDER;
|
const P = Fp.ORDER;
|
||||||
const half = value.length / 2;
|
const half = hex.length / 2;
|
||||||
if (half !== 48 && half !== 96)
|
if (half !== 48 && half !== 96)
|
||||||
throw new Error('Invalid compressed signature length, must be 96 or 192');
|
throw new Error('Invalid compressed signature length, must be 96 or 192');
|
||||||
const z1 = bytesToNumberBE(value.slice(0, half));
|
const z1 = bytesToNumberBE(value.slice(0, half));
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "module"
|
|
||||||
}
|
|
128
src/secp256k1.ts
128
src/secp256k1.ts
@ -1,7 +1,7 @@
|
|||||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||||
import { sha256 } from '@noble/hashes/sha256';
|
import { sha256 } from '@noble/hashes/sha256';
|
||||||
import { randomBytes } from '@noble/hashes/utils';
|
import { randomBytes } from '@noble/hashes/utils';
|
||||||
import { Field, mod, pow2 } from './abstract/modular.js';
|
import { Field, mod, pow2, FpIsSquare } from './abstract/modular.js';
|
||||||
import { ProjPointType as PointType, mapToCurveSimpleSWU } from './abstract/weierstrass.js';
|
import { ProjPointType as PointType, mapToCurveSimpleSWU } from './abstract/weierstrass.js';
|
||||||
import type { Hex, PrivKey } from './abstract/utils.js';
|
import type { Hex, PrivKey } from './abstract/utils.js';
|
||||||
import { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';
|
import { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';
|
||||||
@ -272,3 +272,129 @@ const htf = /* @__PURE__ */ (() =>
|
|||||||
))();
|
))();
|
||||||
export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();
|
export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();
|
||||||
export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();
|
export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();
|
||||||
|
|
||||||
|
// ElligatorSwift: Schnorr-like x-only ECDH with public keys indistinguishable
|
||||||
|
// from uniformly random bytes.
|
||||||
|
// https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki,
|
||||||
|
// https://github.com/bitcoin/bitcoin/blob/master/src/secp256k1/doc/ellswift.md
|
||||||
|
// SwiftEC: Shallue-van de Woestijne Indifferentiable Function to Elliptic Curves.
|
||||||
|
// https://eprint.iacr.org/2022/759.pdf
|
||||||
|
//
|
||||||
|
// Curve25519 & P-521 are incompatible with SwiftEC. Differences from SwiftEC:
|
||||||
|
// - undefined inputs are remapped
|
||||||
|
// - y-parity is encoded in u/t values
|
||||||
|
const MINUS_3_SQRT = Fp.sqrt(Fp.create(BigInt(-3)));
|
||||||
|
const _3n = BigInt(3);
|
||||||
|
const _4n = BigInt(4);
|
||||||
|
const _7n = BigInt(7);
|
||||||
|
const isSquare = FpIsSquare(Fp);
|
||||||
|
const isValidX = (x: bigint) => isSquare(Fp.add(Fp.mul(Fp.mul(x, x), x), _7n));
|
||||||
|
const trySqrt = (x: bigint): bigint | void => {
|
||||||
|
try {
|
||||||
|
return Fp.sqrt(x);
|
||||||
|
} catch (_e) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const elligatorSwift = /* @__PURE__ */ {
|
||||||
|
// (internal stuff, exported for tests only): decode(u, _inv(x, u)) = x
|
||||||
|
_inv: (x: bigint, u: bigint, ellCase: number): bigint | void => {
|
||||||
|
if (!Number.isSafeInteger(ellCase) || ellCase < 0 || ellCase > 7)
|
||||||
|
throw new Error(`elligatorSwift._inv: wrong case=${ellCase}`);
|
||||||
|
let v: bigint, s: bigint;
|
||||||
|
// Most rejections happens in 3 condition (in comments, ~33% each)
|
||||||
|
const u2 = Fp.mul(u, u); // u**2
|
||||||
|
const u3 = Fp.mul(u2, u); // u**3
|
||||||
|
if ((ellCase & 2) === 0) {
|
||||||
|
if (isValidX(Fp.sub(Fp.neg(x), u))) return; // [1 condition]
|
||||||
|
v = x;
|
||||||
|
s = Fp.div(Fp.neg(Fp.add(u3, _7n)), Fp.add(Fp.add(u2, Fp.mul(u, v)), Fp.mul(v, v))); // = -(u**3 + 7) / (u**2 + u*v + v**2)
|
||||||
|
} else {
|
||||||
|
s = Fp.sub(x, u); // x - u
|
||||||
|
if (Fp.is0(s)) return;
|
||||||
|
const t0 = Fp.add(u3, _7n); // (u**3 + 7)
|
||||||
|
const t1 = Fp.mul(Fp.mul(_3n, s), u2); // 3 * s * u**2
|
||||||
|
// r = (-s * (4 * (u**3 + 7) + 3 * s * u**2)).sqrt()
|
||||||
|
const r = trySqrt(Fp.mul(Fp.neg(s), Fp.add(Fp.mul(_4n, t0), t1)));
|
||||||
|
if (r === undefined) return; // [2 condition]
|
||||||
|
if (ellCase & 1 && Fp.is0(r)) return;
|
||||||
|
v = Fp.div(Fp.add(Fp.neg(u), Fp.div(r, s)), _2n); // v = (-u + r / s) / 2
|
||||||
|
}
|
||||||
|
const w = trySqrt(s);
|
||||||
|
if (w === undefined) return; // [3 condition]
|
||||||
|
const last = ellCase & 5; // ellCase = 0..8, last = 0,1,4,5
|
||||||
|
const t0 = last & 1 ? Fp.add(_1n, MINUS_3_SQRT) : Fp.sub(_1n, MINUS_3_SQRT);
|
||||||
|
const w0 = last === 0 || last === 5 ? Fp.neg(w) : w; // -w | w
|
||||||
|
// w0 * (u * t0 / 2 + v)
|
||||||
|
return Fp.mul(w0, Fp.add(Fp.div(Fp.mul(u, t0), _2n), v));
|
||||||
|
},
|
||||||
|
// Encode public key (point or x coordinate bigint) into 64-byte pseudorandom encoding
|
||||||
|
encode: (x: bigint | PointType<bigint>): Uint8Array => {
|
||||||
|
if (x instanceof secp256k1.ProjectivePoint) x = x.x;
|
||||||
|
if (typeof x !== 'bigint') {
|
||||||
|
throw new Error(
|
||||||
|
'elligatorSwift.encode: wrong public key. Should be Projective point or x coordinate (bigint)'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// 200k test cycles per keygen: avg=4 max=48
|
||||||
|
// seems too much, but same as for reference implementation
|
||||||
|
while (true) {
|
||||||
|
// random scalar 1..Fp.ORDER
|
||||||
|
const u = Fp.create(Fp.fromBytes(secp256k1.utils.randomPrivateKey()));
|
||||||
|
const ellCase = randomBytes(1)[0] & 7; // [0..8)
|
||||||
|
const t = elligatorSwift._inv(x, u, ellCase);
|
||||||
|
if (!t) continue;
|
||||||
|
return concatBytes(numberToBytesBE(u, 32), numberToBytesBE(t, 32));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Decode elligatorSwift point to xonly
|
||||||
|
decode: (data: Hex): Uint8Array => {
|
||||||
|
const _data = ensureBytes('data', data, 64);
|
||||||
|
let u = Fp.create(Fp.fromBytes(_data.subarray(0, 32)));
|
||||||
|
let t = Fp.create(Fp.fromBytes(_data.subarray(32, 64)));
|
||||||
|
if (Fp.is0(u)) u = Fp.create(_1n);
|
||||||
|
if (Fp.is0(t)) t = Fp.create(_1n);
|
||||||
|
const u3 = Fp.mul(Fp.mul(u, u), u); // u**3
|
||||||
|
const u3plus7 = Fp.add(u3, _7n);
|
||||||
|
// u**3 + t**2 + 7 == 0 -> t = 2 * t
|
||||||
|
if (Fp.is0(Fp.add(u3plus7, Fp.mul(t, t)))) t = Fp.add(t, t);
|
||||||
|
// X = (u**3 + 7 - t**2) / (2 * t)
|
||||||
|
const x = Fp.div(Fp.sub(u3plus7, Fp.mul(t, t)), Fp.add(t, t));
|
||||||
|
// Y = (X + t) / (MINUS_3_SQRT * u);
|
||||||
|
const y = Fp.div(Fp.add(x, t), Fp.mul(MINUS_3_SQRT, u));
|
||||||
|
// try different cases
|
||||||
|
let res = Fp.add(u, Fp.mul(Fp.mul(y, y), _4n)); // u + 4 * Y ** 2,
|
||||||
|
if (isValidX(res)) return numberToBytesBE(res, 32);
|
||||||
|
res = Fp.div(Fp.sub(Fp.div(Fp.neg(x), y), u), _2n); // (-X / Y - u) / 2
|
||||||
|
if (isValidX(res)) return numberToBytesBE(res, 32);
|
||||||
|
res = Fp.div(Fp.sub(Fp.div(x, y), u), _2n); // (X / Y - u) / 2
|
||||||
|
if (isValidX(res)) return numberToBytesBE(res, 32);
|
||||||
|
throw new Error('elligatorSwift: cannot decode public key');
|
||||||
|
},
|
||||||
|
// Generate pair (public key, secret key)
|
||||||
|
keygen: () => {
|
||||||
|
const privateKey = secp256k1.utils.randomPrivateKey();
|
||||||
|
const publicKey = elligatorSwift.encode(Point.fromPrivateKey(privateKey));
|
||||||
|
return { privateKey, publicKey };
|
||||||
|
},
|
||||||
|
// Generates shared secret between a pub key and a priv key
|
||||||
|
getSharedSecret: (privateKeyA: Hex, publicKeyB: Hex) => {
|
||||||
|
const pub = elligatorSwift.decode(publicKeyB);
|
||||||
|
const priv = ensureBytes('privKey', privateKeyA, 32);
|
||||||
|
const point = lift_x(Fp.fromBytes(pub));
|
||||||
|
const d = bytesToNumberBE(priv);
|
||||||
|
return numberToBytesBE(point.multiply(d).x, 32);
|
||||||
|
},
|
||||||
|
// BIP324 shared secret
|
||||||
|
getSharedSecretBip324: (
|
||||||
|
privateKeyOurs: Hex,
|
||||||
|
publicKeyTheirs: Hex,
|
||||||
|
publicKeyOurs: Hex,
|
||||||
|
initiating: boolean
|
||||||
|
) => {
|
||||||
|
const ours = ensureBytes('publicKeyOurs', publicKeyOurs);
|
||||||
|
const theirs = ensureBytes('publicKeyTheirs', publicKeyTheirs);
|
||||||
|
const ecdhPoint = elligatorSwift.getSharedSecret(privateKeyOurs, theirs);
|
||||||
|
const pubs = initiating ? [ours, theirs] : [theirs, ours];
|
||||||
|
return taggedHash('bip324_ellswift_xonly_ecdh', ...pubs, ecdhPoint);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
@ -2,7 +2,7 @@ import { deepStrictEqual, throws } from 'assert';
|
|||||||
import { should, describe } from 'micro-should';
|
import { should, describe } from 'micro-should';
|
||||||
import * as fc from 'fast-check';
|
import * as fc from 'fast-check';
|
||||||
import * as mod from '../esm/abstract/modular.js';
|
import * as mod from '../esm/abstract/modular.js';
|
||||||
import { bytesToHex, isBytes, bytesToHex as toHex } from '../esm/abstract/utils.js';
|
import { bytesToHex as toHex } from '../esm/abstract/utils.js';
|
||||||
// Generic tests for all curves in package
|
// Generic tests for all curves in package
|
||||||
import { secp192r1, secp224r1 } from './_more-curves.helpers.js';
|
import { secp192r1, secp224r1 } from './_more-curves.helpers.js';
|
||||||
import { secp256r1 } from '../esm/p256.js';
|
import { secp256r1 } from '../esm/p256.js';
|
||||||
@ -595,18 +595,6 @@ for (const name in CURVES) {
|
|||||||
{ numRuns: NUM_RUNS }
|
{ numRuns: NUM_RUNS }
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
should('.verify() should verify random signatures in hex', () =>
|
|
||||||
fc.assert(
|
|
||||||
fc.property(fc.hexaString({ minLength: 64, maxLength: 64 }), (msg) => {
|
|
||||||
const priv = toHex(C.utils.randomPrivateKey());
|
|
||||||
const pub = toHex(C.getPublicKey(priv));
|
|
||||||
const sig = C.sign(msg, priv);
|
|
||||||
let sighex = isBytes(sig) ? toHex(sig) : sig.toCompactHex();
|
|
||||||
deepStrictEqual(C.verify(sighex, msg, pub), true, `priv=${priv},pub=${pub},msg=${msg}`);
|
|
||||||
}),
|
|
||||||
{ numRuns: NUM_RUNS }
|
|
||||||
)
|
|
||||||
);
|
|
||||||
should('.verify() should verify empty signatures', () => {
|
should('.verify() should verify empty signatures', () => {
|
||||||
const msg = new Uint8Array([]);
|
const msg = new Uint8Array([]);
|
||||||
const priv = C.utils.randomPrivateKey();
|
const priv = C.utils.randomPrivateKey();
|
||||||
|
@ -1173,8 +1173,6 @@ describe('verify()', () => {
|
|||||||
const pub = bls.getPublicKey(priv);
|
const pub = bls.getPublicKey(priv);
|
||||||
const res = bls.verify(sig, msg, pub);
|
const res = bls.verify(sig, msg, pub);
|
||||||
deepStrictEqual(res, true, `${priv}-${msg}`);
|
deepStrictEqual(res, true, `${priv}-${msg}`);
|
||||||
const resHex = bls.verify(bytesToHex(sig), msg, pub);
|
|
||||||
deepStrictEqual(resHex, true, `${priv}-${msg}-hex`);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
should('not verify signature with wrong message', () => {
|
should('not verify signature with wrong message', () => {
|
||||||
@ -1195,8 +1193,6 @@ describe('verify()', () => {
|
|||||||
const invPub = bls.getPublicKey(invPriv);
|
const invPub = bls.getPublicKey(invPriv);
|
||||||
const res = bls.verify(sig, msg, invPub);
|
const res = bls.verify(sig, msg, invPub);
|
||||||
deepStrictEqual(res, false);
|
deepStrictEqual(res, false);
|
||||||
const resHex = bls.verify(bytesToHex(sig), msg, invPub);
|
|
||||||
deepStrictEqual(resHex, false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
should('verify signed message (short signatures)', () => {
|
should('verify signed message (short signatures)', () => {
|
||||||
@ -1206,8 +1202,6 @@ describe('verify()', () => {
|
|||||||
const pub = bls.getPublicKeyForShortSignatures(priv);
|
const pub = bls.getPublicKeyForShortSignatures(priv);
|
||||||
const res = bls.verifyShortSignature(sig, msg, pub);
|
const res = bls.verifyShortSignature(sig, msg, pub);
|
||||||
deepStrictEqual(res, true, `${priv}-${msg}`);
|
deepStrictEqual(res, true, `${priv}-${msg}`);
|
||||||
const resHex = bls.verifyShortSignature(bytesToHex(sig), msg, pub);
|
|
||||||
deepStrictEqual(resHex, true, `${priv}-${msg}`);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
should('not verify signature with wrong message (short signatures)', () => {
|
should('not verify signature with wrong message (short signatures)', () => {
|
||||||
@ -1218,8 +1212,6 @@ describe('verify()', () => {
|
|||||||
const pub = bls.getPublicKeyForShortSignatures(priv);
|
const pub = bls.getPublicKeyForShortSignatures(priv);
|
||||||
const res = bls.verifyShortSignature(sig, invMsg, pub);
|
const res = bls.verifyShortSignature(sig, invMsg, pub);
|
||||||
deepStrictEqual(res, false);
|
deepStrictEqual(res, false);
|
||||||
const resHex = bls.verifyShortSignature(bytesToHex(sig), invMsg, pub);
|
|
||||||
deepStrictEqual(resHex, false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
should('not verify signature with wrong key', () => {
|
should('not verify signature with wrong key', () => {
|
||||||
@ -1230,8 +1222,6 @@ describe('verify()', () => {
|
|||||||
const invPub = bls.getPublicKeyForShortSignatures(invPriv);
|
const invPub = bls.getPublicKeyForShortSignatures(invPriv);
|
||||||
const res = bls.verifyShortSignature(sig, msg, invPub);
|
const res = bls.verifyShortSignature(sig, msg, invPub);
|
||||||
deepStrictEqual(res, false);
|
deepStrictEqual(res, false);
|
||||||
const resHex = bls.verifyShortSignature(bytesToHex(sig), msg, invPub);
|
|
||||||
deepStrictEqual(resHex, false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
describe('batch', () => {
|
describe('batch', () => {
|
||||||
@ -1244,10 +1234,6 @@ describe('verify()', () => {
|
|||||||
const signatures = messages.map((message, i) => bls.sign(message, privateKeys[i]));
|
const signatures = messages.map((message, i) => bls.sign(message, privateKeys[i]));
|
||||||
const aggregatedSignature = bls.aggregateSignatures(signatures);
|
const aggregatedSignature = bls.aggregateSignatures(signatures);
|
||||||
deepStrictEqual(bls.verifyBatch(aggregatedSignature, messages, publicKey), true);
|
deepStrictEqual(bls.verifyBatch(aggregatedSignature, messages, publicKey), true);
|
||||||
deepStrictEqual(
|
|
||||||
bls.verifyBatch(bytesToHex(aggregatedSignature), messages, publicKey),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -1266,10 +1252,6 @@ describe('verify()', () => {
|
|||||||
bls.verifyBatch(aggregatedSignature, wrongMessages, publicKey),
|
bls.verifyBatch(aggregatedSignature, wrongMessages, publicKey),
|
||||||
messages.every((m, i) => m === wrongMessages[i])
|
messages.every((m, i) => m === wrongMessages[i])
|
||||||
);
|
);
|
||||||
deepStrictEqual(
|
|
||||||
bls.verifyBatch(bytesToHex(aggregatedSignature), wrongMessages, publicKey),
|
|
||||||
messages.every((m, i) => m === wrongMessages[i])
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -1292,10 +1274,6 @@ describe('verify()', () => {
|
|||||||
bls.verifyBatch(aggregatedSignature, messages, wrongPublicKeys),
|
bls.verifyBatch(aggregatedSignature, messages, wrongPublicKeys),
|
||||||
wrongPrivateKeys.every((p, i) => p === privateKeys[i])
|
wrongPrivateKeys.every((p, i) => p === privateKeys[i])
|
||||||
);
|
);
|
||||||
deepStrictEqual(
|
|
||||||
bls.verifyBatch(bytesToHex(aggregatedSignature), messages, wrongPublicKeys),
|
|
||||||
wrongPrivateKeys.every((p, i) => p === privateKeys[i])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -1309,10 +1287,6 @@ describe('verify()', () => {
|
|||||||
const aggregatedSignature = bls.aggregateSignatures(signatures);
|
const aggregatedSignature = bls.aggregateSignatures(signatures);
|
||||||
const aggregatedPublicKey = bls.aggregatePublicKeys(publicKey);
|
const aggregatedPublicKey = bls.aggregatePublicKeys(publicKey);
|
||||||
deepStrictEqual(bls.verify(aggregatedSignature, message, aggregatedPublicKey), true);
|
deepStrictEqual(bls.verify(aggregatedSignature, message, aggregatedPublicKey), true);
|
||||||
deepStrictEqual(
|
|
||||||
bls.verify(bytesToHex(aggregatedSignature), message, aggregatedPublicKey),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -1328,10 +1302,6 @@ describe('verify()', () => {
|
|||||||
bls.verify(aggregatedSignature, wrongMessage, aggregatedPublicKey),
|
bls.verify(aggregatedSignature, wrongMessage, aggregatedPublicKey),
|
||||||
message === wrongMessage
|
message === wrongMessage
|
||||||
);
|
);
|
||||||
deepStrictEqual(
|
|
||||||
bls.verify(bytesToHex(aggregatedSignature), wrongMessage, aggregatedPublicKey),
|
|
||||||
message === wrongMessage
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -9,6 +9,7 @@ import './ed25519.test.js';
|
|||||||
import './ed25519-addons.test.js';
|
import './ed25519-addons.test.js';
|
||||||
import './secp256k1.test.js';
|
import './secp256k1.test.js';
|
||||||
import './secp256k1-schnorr.test.js';
|
import './secp256k1-schnorr.test.js';
|
||||||
|
import './secp256k1-bip-0324.test.js';
|
||||||
import './jubjub.test.js';
|
import './jubjub.test.js';
|
||||||
import './hash-to-curve.test.js';
|
import './hash-to-curve.test.js';
|
||||||
import './poseidon.test.js';
|
import './poseidon.test.js';
|
||||||
|
122
test/secp256k1-bip-0324.test.js
Normal file
122
test/secp256k1-bip-0324.test.js
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
import { deepStrictEqual } from 'assert';
|
||||||
|
import { should, describe } from 'micro-should';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import {
|
||||||
|
hexToBytes,
|
||||||
|
hexToNumber,
|
||||||
|
concatBytes,
|
||||||
|
bytesToHex as toHex,
|
||||||
|
} from '../esm/abstract/utils.js';
|
||||||
|
// Generic tests for all curves in package
|
||||||
|
import { secp256k1, elligatorSwift } from '../esm/secp256k1.js';
|
||||||
|
// ESM is broken.
|
||||||
|
import { dirname } from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
export const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
|
// https://eprint.iacr.org/2022/759
|
||||||
|
|
||||||
|
const parseCSV = (path) => {
|
||||||
|
const data = fs.readFileSync(`${__dirname}/vectors/secp256k1/${path}`, 'utf8');
|
||||||
|
const lines = data.split('\n').filter((i) => !!i);
|
||||||
|
const rows = lines.map((i) => i.trim().split(','));
|
||||||
|
const lengths = new Set(rows.map((i) => i.length));
|
||||||
|
if (lengths.size !== 1) throw new Error('wrong dimensions');
|
||||||
|
if (rows.length < 2) throw new Error('wrong rows length');
|
||||||
|
const [head, ...rest] = rows;
|
||||||
|
return rest.map((row) => Object.fromEntries(row.map((cell, j) => [head[j], cell])));
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('ElligatorSwift', () => {
|
||||||
|
should('packet_encoding_test_vectors', () => {
|
||||||
|
for (const t of parseCSV('bip-0324/packet_encoding_test_vectors.csv')) {
|
||||||
|
const inPriv = hexToNumber(t['in_priv_ours']);
|
||||||
|
const pubX = secp256k1.ProjectivePoint.BASE.multiply(inPriv)
|
||||||
|
.x.toString(16)
|
||||||
|
.padStart(2 * 32, '0');
|
||||||
|
deepStrictEqual(pubX, t['mid_x_ours']);
|
||||||
|
|
||||||
|
const bytesOurs = hexToBytes(t['in_ellswift_ours']);
|
||||||
|
const decoded = elligatorSwift.decode(bytesOurs);
|
||||||
|
deepStrictEqual(toHex(decoded), t['mid_x_ours']);
|
||||||
|
|
||||||
|
const bytesTheirs = hexToBytes(t['in_ellswift_theirs']);
|
||||||
|
deepStrictEqual(toHex(elligatorSwift.decode(bytesTheirs)), t['mid_x_theirs']);
|
||||||
|
|
||||||
|
const xShared = elligatorSwift.getSharedSecret(t['in_priv_ours'], bytesTheirs);
|
||||||
|
deepStrictEqual(toHex(xShared), t['mid_x_shared']);
|
||||||
|
|
||||||
|
const sharedSecret = elligatorSwift.getSharedSecretBip324(
|
||||||
|
t['in_priv_ours'],
|
||||||
|
t['in_ellswift_theirs'],
|
||||||
|
t['in_ellswift_ours'],
|
||||||
|
t['in_initiating'] === '1'
|
||||||
|
);
|
||||||
|
deepStrictEqual(toHex(sharedSecret), t['mid_shared_secret']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
should('xswiftec_inv_test_vectors', () => {
|
||||||
|
for (const t of parseCSV('bip-0324/xswiftec_inv_test_vectors.csv')) {
|
||||||
|
const Fp = secp256k1.CURVE.Fp;
|
||||||
|
const u = Fp.create(Fp.fromBytes(hexToBytes(t['u'])));
|
||||||
|
const x = Fp.create(Fp.fromBytes(hexToBytes(t['x'])));
|
||||||
|
for (let c = 0; c < 8; c++) {
|
||||||
|
const name = `case${c}_t`;
|
||||||
|
const ret = elligatorSwift._inv(x, u, c);
|
||||||
|
if (!ret) deepStrictEqual(t[name], '', 'empty case');
|
||||||
|
else {
|
||||||
|
deepStrictEqual(toHex(Fp.toBytes(ret)), t[name], 'real case');
|
||||||
|
deepStrictEqual(
|
||||||
|
elligatorSwift.decode(concatBytes(Fp.toBytes(u), Fp.toBytes(ret))),
|
||||||
|
Fp.toBytes(x)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
should('ellswift_decode_test_vectors', () => {
|
||||||
|
for (const t of parseCSV('bip-0324/ellswift_decode_test_vectors.csv')) {
|
||||||
|
deepStrictEqual(toHex(elligatorSwift.decode(t['ellswift'])), t['x']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
should('Example', () => {
|
||||||
|
// random, so test more.
|
||||||
|
for (let i = 0; i < 100; i++) {
|
||||||
|
const alice = elligatorSwift.keygen();
|
||||||
|
const bob = elligatorSwift.keygen();
|
||||||
|
// ECDH
|
||||||
|
const sharedAlice = elligatorSwift.getSharedSecret(alice.privateKey, bob.publicKey);
|
||||||
|
const sharedBob = elligatorSwift.getSharedSecret(bob.privateKey, alice.publicKey);
|
||||||
|
deepStrictEqual(sharedAlice, sharedBob);
|
||||||
|
// ECDH BIP324
|
||||||
|
const sharedAlice2 = elligatorSwift.getSharedSecretBip324(
|
||||||
|
alice.privateKey,
|
||||||
|
bob.publicKey,
|
||||||
|
alice.publicKey,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
const sharedBob2 = elligatorSwift.getSharedSecretBip324(
|
||||||
|
bob.privateKey,
|
||||||
|
alice.publicKey,
|
||||||
|
bob.publicKey,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
deepStrictEqual(sharedAlice2, sharedBob2);
|
||||||
|
// pubKey decoding
|
||||||
|
for (const k of [alice, bob]) {
|
||||||
|
deepStrictEqual(
|
||||||
|
toHex(elligatorSwift.decode(k.publicKey)),
|
||||||
|
toHex(secp256k1.getPublicKey(k.privateKey, true).subarray(1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// ESM is broken.
|
||||||
|
import url from 'url';
|
||||||
|
if (import.meta.url === url.pathToFileURL(process.argv[1]).href) {
|
||||||
|
should.run();
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
ellswift,x,comment
|
||||||
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,edd1fd3e327ce90cc7a3542614289aee9682003e9cf7dcc9cf2ca9743be5aa0c,u%p=0;t%p=0;valid_x(x2)
|
||||||
|
000000000000000000000000000000000000000000000000000000000000000001d3475bf7655b0fb2d852921035b2ef607f49069b97454e6795251062741771,b5da00b73cd6560520e7c364086e7cd23a34bf60d0e707be9fc34d4cd5fdfa2c,u%p=0;valid_x(x1)
|
||||||
|
000000000000000000000000000000000000000000000000000000000000000082277c4a71f9d22e66ece523f8fa08741a7c0912c66a69ce68514bfd3515b49f,f482f2e241753ad0fb89150d8491dc1e34ff0b8acfbb442cfe999e2e5e6fd1d2,u%p=0;valid_x(x3);valid_x(x2);valid_x(x1)
|
||||||
|
00000000000000000000000000000000000000000000000000000000000000008421cc930e77c9f514b6915c3dbe2a94c6d8f690b5b739864ba6789fb8a55dd0,9f59c40275f5085a006f05dae77eb98c6fd0db1ab4a72ac47eae90a4fc9e57e0,u%p=0;valid_x(x2)
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000bde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9fffffd6b,u%p=0;(u'^3-t'^2+7)%p=0;valid_x(x3)
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000d19c182d2759cd99824228d94799f8c6557c38a1c0d6779b9d4b729c6f1ccc42,70720db7e238d04121f5b1afd8cc5ad9d18944c6bdc94881f502b7a3af3aecff,u%p=0;valid_x(x3)
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,edd1fd3e327ce90cc7a3542614289aee9682003e9cf7dcc9cf2ca9743be5aa0c,u%p=0;t%p=0;valid_x(x2);t>=p
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff2664bbd5,50873db31badcc71890e4f67753a65757f97aaa7dd5f1e82b753ace32219064b,u%p=0;valid_x(x3);valid_x(x2);valid_x(x1);t>=p
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff7028de7d,1eea9cc59cfcf2fa151ac6c274eea4110feb4f7b68c5965732e9992e976ef68e,u%p=0;valid_x(x2);t>=p
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffcbcfb7e7,12303941aedc208880735b1f1795c8e55be520ea93e103357b5d2adb7ed59b8e,u%p=0;valid_x(x1);t>=p
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffff3113ad9,7eed6b70e7b0767c7d7feac04e57aa2a12fef5e0f48f878fcbb88b3b6b5e0783,u%p=0;valid_x(x3);t>=p
|
||||||
|
0a2d2ba93507f1df233770c2a797962cc61f6d15da14ecd47d8d27ae1cd5f8530000000000000000000000000000000000000000000000000000000000000000,532167c11200b08c0e84a354e74dcc40f8b25f4fe686e30869526366278a0688,t%p=0;(u'^3+t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1)
|
||||||
|
0a2d2ba93507f1df233770c2a797962cc61f6d15da14ecd47d8d27ae1cd5f853fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,532167c11200b08c0e84a354e74dcc40f8b25f4fe686e30869526366278a0688,t%p=0;(u'^3+t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1);t>=p
|
||||||
|
0ffde9ca81d751e9cdaffc1a50779245320b28996dbaf32f822f20117c22fbd6c74d99efceaa550f1ad1c0f43f46e7ff1ee3bd0162b7bf55f2965da9c3450646,74e880b3ffd18fe3cddf7902522551ddf97fa4a35a3cfda8197f947081a57b8f,valid_x(x3)
|
||||||
|
0ffde9ca81d751e9cdaffc1a50779245320b28996dbaf32f822f20117c22fbd6ffffffffffffffffffffffffffffffffffffffffffffffffffffffff156ca896,377b643fce2271f64e5c8101566107c1be4980745091783804f654781ac9217c,valid_x(x2);t>=p
|
||||||
|
123658444f32be8f02ea2034afa7ef4bbe8adc918ceb49b12773b625f490b368ffffffffffffffffffffffffffffffffffffffffffffffffffffffff8dc5fe11,ed16d65cf3a9538fcb2c139f1ecbc143ee14827120cbc2659e667256800b8142,(u'^3-t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1);t>=p
|
||||||
|
146f92464d15d36e35382bd3ca5b0f976c95cb08acdcf2d5b3570617990839d7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff3145e93b,0d5cd840427f941f65193079ab8e2e83024ef2ee7ca558d88879ffd879fb6657,(u'^3+t'^2+7)%p=0;valid_x(x3);t>=p
|
||||||
|
15fdf5cf09c90759add2272d574d2bb5fe1429f9f3c14c65e3194bf61b82aa73ffffffffffffffffffffffffffffffffffffffffffffffffffffffff04cfd906,16d0e43946aec93f62d57eb8cde68951af136cf4b307938dd1447411e07bffe1,(u'^3+t'^2+7)%p=0;valid_x(x2);t>=p
|
||||||
|
1f67edf779a8a649d6def60035f2fa22d022dd359079a1a144073d84f19b92d50000000000000000000000000000000000000000000000000000000000000000,025661f9aba9d15c3118456bbe980e3e1b8ba2e047c737a4eb48a040bb566f6c,t%p=0;valid_x(x2)
|
||||||
|
1f67edf779a8a649d6def60035f2fa22d022dd359079a1a144073d84f19b92d5fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,025661f9aba9d15c3118456bbe980e3e1b8ba2e047c737a4eb48a040bb566f6c,t%p=0;valid_x(x2);t>=p
|
||||||
|
1fe1e5ef3fceb5c135ab7741333ce5a6e80d68167653f6b2b24bcbcfaaaff507fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,98bec3b2a351fa96cfd191c1778351931b9e9ba9ad1149f6d9eadca80981b801,t%p=0;(u'^3-t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1);t>=p
|
||||||
|
4056a34a210eec7892e8820675c860099f857b26aad85470ee6d3cf1304a9dcf375e70374271f20b13c9986ed7d3c17799698cfc435dbed3a9f34b38c823c2b4,868aac2003b29dbcad1a3e803855e078a89d16543ac64392d122417298cec76e,(u'^3-t'^2+7)%p=0;valid_x(x3)
|
||||||
|
4197ec3723c654cfdd32ab075506648b2ff5070362d01a4fff14b336b78f963fffffffffffffffffffffffffffffffffffffffffffffffffffffffffb3ab1e95,ba5a6314502a8952b8f456e085928105f665377a8ce27726a5b0eb7ec1ac0286,(u'^3+t'^2+7)%p=0;valid_x(x1);t>=p
|
||||||
|
47eb3e208fedcdf8234c9421e9cd9a7ae873bfbdbc393723d1ba1e1e6a8e6b24ffffffffffffffffffffffffffffffffffffffffffffffffffffffff7cd12cb1,d192d52007e541c9807006ed0468df77fd214af0a795fe119359666fdcf08f7c,(u'^3+t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1);t>=p
|
||||||
|
5eb9696a2336fe2c3c666b02c755db4c0cfd62825c7b589a7b7bb442e141c1d693413f0052d49e64abec6d5831d66c43612830a17df1fe4383db896468100221,ef6e1da6d6c7627e80f7a7234cb08a022c1ee1cf29e4d0f9642ae924cef9eb38,(u'^3+t'^2+7)%p=0;valid_x(x1)
|
||||||
|
7bf96b7b6da15d3476a2b195934b690a3a3de3e8ab8474856863b0de3af90b0e0000000000000000000000000000000000000000000000000000000000000000,50851dfc9f418c314a437295b24feeea27af3d0cd2308348fda6e21c463e46ff,t%p=0;valid_x(x1)
|
||||||
|
7bf96b7b6da15d3476a2b195934b690a3a3de3e8ab8474856863b0de3af90b0efffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,50851dfc9f418c314a437295b24feeea27af3d0cd2308348fda6e21c463e46ff,t%p=0;valid_x(x1);t>=p
|
||||||
|
851b1ca94549371c4f1f7187321d39bf51c6b7fb61f7cbf027c9da62021b7a65fc54c96837fb22b362eda63ec52ec83d81bedd160c11b22d965d9f4a6d64d251,3e731051e12d33237eb324f2aa5b16bb868eb49a1aa1fadc19b6e8761b5a5f7b,(u'^3+t'^2+7)%p=0;valid_x(x2)
|
||||||
|
943c2f775108b737fe65a9531e19f2fc2a197f5603e3a2881d1d83e4008f91250000000000000000000000000000000000000000000000000000000000000000,311c61f0ab2f32b7b1f0223fa72f0a78752b8146e46107f8876dd9c4f92b2942,t%p=0;valid_x(x3);valid_x(x2);valid_x(x1)
|
||||||
|
943c2f775108b737fe65a9531e19f2fc2a197f5603e3a2881d1d83e4008f9125fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,311c61f0ab2f32b7b1f0223fa72f0a78752b8146e46107f8876dd9c4f92b2942,t%p=0;valid_x(x3);valid_x(x2);valid_x(x1);t>=p
|
||||||
|
a0f18492183e61e8063e573606591421b06bc3513631578a73a39c1c3306239f2f32904f0d2a33ecca8a5451705bb537d3bf44e071226025cdbfd249fe0f7ad6,97a09cf1a2eae7c494df3c6f8a9445bfb8c09d60832f9b0b9d5eabe25fbd14b9,valid_x(x1)
|
||||||
|
a1ed0a0bd79d8a23cfe4ec5fef5ba5cccfd844e4ff5cb4b0f2e71627341f1c5b17c499249e0ac08d5d11ea1c2c8ca7001616559a7994eadec9ca10fb4b8516dc,65a89640744192cdac64b2d21ddf989cdac7500725b645bef8e2200ae39691f2,valid_x(x2)
|
||||||
|
ba94594a432721aa3580b84c161d0d134bc354b690404d7cd4ec57c16d3fbe98ffffffffffffffffffffffffffffffffffffffffffffffffffffffffea507dd7,5e0d76564aae92cb347e01a62afd389a9aa401c76c8dd227543dc9cd0efe685a,valid_x(x1);t>=p
|
||||||
|
bcaf7219f2f6fbf55fe5e062dce0e48c18f68103f10b8198e974c184750e1be3932016cbf69c4471bd1f656c6a107f1973de4af7086db897277060e25677f19a,2d97f96cac882dfe73dc44db6ce0f1d31d6241358dd5d74eb3d3b50003d24c2b,valid_x(x3);valid_x(x2);valid_x(x1)
|
||||||
|
bcaf7219f2f6fbf55fe5e062dce0e48c18f68103f10b8198e974c184750e1be3ffffffffffffffffffffffffffffffffffffffffffffffffffffffff6507d09a,e7008afe6e8cbd5055df120bd748757c686dadb41cce75e4addcc5e02ec02b44,valid_x(x3);valid_x(x2);valid_x(x1);t>=p
|
||||||
|
c5981bae27fd84401c72a155e5707fbb811b2b620645d1028ea270cbe0ee225d4b62aa4dca6506c1acdbecc0552569b4b21436a5692e25d90d3bc2eb7ce24078,948b40e7181713bc018ec1702d3d054d15746c59a7020730dd13ecf985a010d7,(u'^3+t'^2+7)%p=0;valid_x(x3)
|
||||||
|
c894ce48bfec433014b931a6ad4226d7dbd8eaa7b6e3faa8d0ef94052bcf8cff336eeb3919e2b4efb746c7f71bbca7e9383230fbbc48ffafe77e8bcc69542471,f1c91acdc2525330f9b53158434a4d43a1c547cff29f15506f5da4eb4fe8fa5a,(u'^3-t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1)
|
||||||
|
cbb0deab125754f1fdb2038b0434ed9cb3fb53ab735391129994a535d925f6730000000000000000000000000000000000000000000000000000000000000000,872d81ed8831d9998b67cb7105243edbf86c10edfebb786c110b02d07b2e67cd,t%p=0;(u'^3-t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1)
|
||||||
|
d917b786dac35670c330c9c5ae5971dfb495c8ae523ed97ee2420117b171f41effffffffffffffffffffffffffffffffffffffffffffffffffffffff2001f6f6,e45b71e110b831f2bdad8651994526e58393fde4328b1ec04d59897142584691,valid_x(x3);t>=p
|
||||||
|
e28bd8f5929b467eb70e04332374ffb7e7180218ad16eaa46b7161aa679eb4260000000000000000000000000000000000000000000000000000000000000000,66b8c980a75c72e598d383a35a62879f844242ad1e73ff12edaa59f4e58632b5,t%p=0;valid_x(x3)
|
||||||
|
e28bd8f5929b467eb70e04332374ffb7e7180218ad16eaa46b7161aa679eb426fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,66b8c980a75c72e598d383a35a62879f844242ad1e73ff12edaa59f4e58632b5,t%p=0;valid_x(x3);t>=p
|
||||||
|
e7ee5814c1706bf8a89396a9b032bc014c2cac9c121127dbf6c99278f8bb53d1dfd04dbcda8e352466b6fcd5f2dea3e17d5e133115886eda20db8a12b54de71b,e842c6e3529b234270a5e97744edc34a04d7ba94e44b6d2523c9cf0195730a50,(u'^3+t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1)
|
||||||
|
f292e46825f9225ad23dc057c1d91c4f57fcb1386f29ef10481cb1d22518593fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7011c989,3cea2c53b8b0170166ac7da67194694adacc84d56389225e330134dab85a4d55,(u'^3-t'^2+7)%p=0;valid_x(x3);t>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0000000000000000000000000000000000000000000000000000000000000000,edd1fd3e327ce90cc7a3542614289aee9682003e9cf7dcc9cf2ca9743be5aa0c,u%p=0;t%p=0;valid_x(x2);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f01d3475bf7655b0fb2d852921035b2ef607f49069b97454e6795251062741771,b5da00b73cd6560520e7c364086e7cd23a34bf60d0e707be9fc34d4cd5fdfa2c,u%p=0;valid_x(x1);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9fffffd6b,u%p=0;(u'^3-t'^2+7)%p=0;valid_x(x3);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f82277c4a71f9d22e66ece523f8fa08741a7c0912c66a69ce68514bfd3515b49f,f482f2e241753ad0fb89150d8491dc1e34ff0b8acfbb442cfe999e2e5e6fd1d2,u%p=0;valid_x(x3);valid_x(x2);valid_x(x1);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f8421cc930e77c9f514b6915c3dbe2a94c6d8f690b5b739864ba6789fb8a55dd0,9f59c40275f5085a006f05dae77eb98c6fd0db1ab4a72ac47eae90a4fc9e57e0,u%p=0;valid_x(x2);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fd19c182d2759cd99824228d94799f8c6557c38a1c0d6779b9d4b729c6f1ccc42,70720db7e238d04121f5b1afd8cc5ad9d18944c6bdc94881f502b7a3af3aecff,u%p=0;valid_x(x3);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2ffffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,edd1fd3e327ce90cc7a3542614289aee9682003e9cf7dcc9cf2ca9743be5aa0c,u%p=0;t%p=0;valid_x(x2);u>=p;t>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fffffffffffffffffffffffffffffffffffffffffffffffffffffffff2664bbd5,50873db31badcc71890e4f67753a65757f97aaa7dd5f1e82b753ace32219064b,u%p=0;valid_x(x3);valid_x(x2);valid_x(x1);u>=p;t>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7028de7d,1eea9cc59cfcf2fa151ac6c274eea4110feb4f7b68c5965732e9992e976ef68e,u%p=0;valid_x(x2);u>=p;t>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fffffffffffffffffffffffffffffffffffffffffffffffffffffffffcbcfb7e7,12303941aedc208880735b1f1795c8e55be520ea93e103357b5d2adb7ed59b8e,u%p=0;valid_x(x1);u>=p;t>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3113ad9,7eed6b70e7b0767c7d7feac04e57aa2a12fef5e0f48f878fcbb88b3b6b5e0783,u%p=0;valid_x(x3);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff13cea4a70000000000000000000000000000000000000000000000000000000000000000,649984435b62b4a25d40c6133e8d9ab8c53d4b059ee8a154a3be0fcf4e892edb,t%p=0;valid_x(x1);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff13cea4a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,649984435b62b4a25d40c6133e8d9ab8c53d4b059ee8a154a3be0fcf4e892edb,t%p=0;valid_x(x1);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff15028c590063f64d5a7f1c14915cd61eac886ab295bebd91992504cf77edb028bdd6267f,3fde5713f8282eead7d39d4201f44a7c85a5ac8a0681f35e54085c6b69543374,(u'^3+t'^2+7)%p=0;valid_x(x2);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff2715de860000000000000000000000000000000000000000000000000000000000000000,3524f77fa3a6eb4389c3cb5d27f1f91462086429cd6c0cb0df43ea8f1e7b3fb4,t%p=0;valid_x(x3);valid_x(x2);valid_x(x1);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff2715de86fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,3524f77fa3a6eb4389c3cb5d27f1f91462086429cd6c0cb0df43ea8f1e7b3fb4,t%p=0;valid_x(x3);valid_x(x2);valid_x(x1);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff2c2c5709e7156c417717f2feab147141ec3da19fb759575cc6e37b2ea5ac9309f26f0f66,d2469ab3e04acbb21c65a1809f39caafe7a77c13d10f9dd38f391c01dc499c52,(u'^3-t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff3a08cc1efffffffffffffffffffffffffffffffffffffffffffffffffffffffff760e9f0,38e2a5ce6a93e795e16d2c398bc99f0369202ce21e8f09d56777b40fc512bccc,valid_x(x3);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff3e91257d932016cbf69c4471bd1f656c6a107f1973de4af7086db897277060e25677f19a,864b3dc902c376709c10a93ad4bbe29fce0012f3dc8672c6286bba28d7d6d6fc,valid_x(x3);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff795d6c1c322cadf599dbb86481522b3cc55f15a67932db2afa0111d9ed6981bcd124bf44,766dfe4a700d9bee288b903ad58870e3d4fe2f0ef780bcac5c823f320d9a9bef,(u'^3+t'^2+7)%p=0;valid_x(x1);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff8e426f0392389078c12b1a89e9542f0593bc96b6bfde8224f8654ef5d5cda935a3582194,faec7bc1987b63233fbc5f956edbf37d54404e7461c58ab8631bc68e451a0478,valid_x(x1);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff91192139ffffffffffffffffffffffffffffffffffffffffffffffffffffffff45f0f1eb,ec29a50bae138dbf7d8e24825006bb5fc1a2cc1243ba335bc6116fb9e498ec1f,valid_x(x2);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff98eb9ab76e84499c483b3bf06214abfe065dddf43b8601de596d63b9e45a166a580541fe,1e0ff2dee9b09b136292a9e910f0d6ac3e552a644bba39e64e9dd3e3bbd3d4d4,(u'^3-t'^2+7)%p=0;valid_x(x3);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff9b77b7f2c74d99efceaa550f1ad1c0f43f46e7ff1ee3bd0162b7bf55f2965da9c3450646,8b7dd5c3edba9ee97b70eff438f22dca9849c8254a2f3345a0a572ffeaae0928,valid_x(x2);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff9b77b7f2ffffffffffffffffffffffffffffffffffffffffffffffffffffffff156ca896,0881950c8f51d6b9a6387465d5f12609ef1bb25412a08a74cb2dfb200c74bfbf,valid_x(x3);valid_x(x2);valid_x(x1);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffa2f5cd838816c16c4fe8a1661d606fdb13cf9af04b979a2e159a09409ebc8645d58fde02,2f083207b9fd9b550063c31cd62b8746bd543bdc5bbf10e3a35563e927f440c8,(u'^3+t'^2+7)%p=0;valid_x(x3);valid_x(x2);valid_x(x1);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffb13f75c00000000000000000000000000000000000000000000000000000000000000000,4f51e0be078e0cddab2742156adba7e7a148e73157072fd618cd60942b146bd0,t%p=0;valid_x(x3);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffb13f75c0fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,4f51e0be078e0cddab2742156adba7e7a148e73157072fd618cd60942b146bd0,t%p=0;valid_x(x3);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7bc1f8d0000000000000000000000000000000000000000000000000000000000000000,16c2ccb54352ff4bd794f6efd613c72197ab7082da5b563bdf9cb3edaafe74c2,t%p=0;valid_x(x2);u>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7bc1f8dfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,16c2ccb54352ff4bd794f6efd613c72197ab7082da5b563bdf9cb3edaafe74c2,t%p=0;valid_x(x2);u>=p;t>=p
|
||||||
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffef64d162750546ce42b0431361e52d4f5242d8f24f33e6b1f99b591647cbc808f462af51,d41244d11ca4f65240687759f95ca9efbab767ededb38fd18c36e18cd3b6f6a9,(u'^3+t'^2+7)%p=0;valid_x(x3);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0e5be52372dd6e894b2a326fc3605a6e8f3c69c710bf27d630dfe2004988b78eb6eab36,64bf84dd5e03670fdb24c0f5d3c2c365736f51db6c92d95010716ad2d36134c8,valid_x(x3);valid_x(x2);valid_x(x1);u>=p
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffefbb982fffffffffffffffffffffffffffffffffffffffffffffffffffffffff6d6db1f,1c92ccdfcf4ac550c28db57cff0c8515cb26936c786584a70114008d6c33a34b,valid_x(x1);u>=p;t>=p
|
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,33 @@
|
|||||||
|
u,x,case0_t,case1_t,case2_t,case3_t,case4_t,case5_t,case6_t,case7_t,comment
|
||||||
|
05ff6bdad900fc3261bc7fe34e2fb0f569f06e091ae437d3a52e9da0cbfb9590,80cdf63774ec7022c89a5a8558e373a279170285e0ab27412dbce510bdfe23fc,,,45654798ece071ba79286d04f7f3eb1c3f1d17dd883610f2ad2efd82a287466b,0aeaa886f6b76c7158452418cbf5033adc5747e9e9b5d3b2303db96936528557,,,ba9ab867131f8e4586d792fb080c14e3c0e2e82277c9ef0d52d1027c5d78b5c4,f51557790948938ea7badbe7340afcc523a8b816164a2c4dcfc24695c9ad76d8,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:info[v=0]&ok;case3:ok;case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:info[v=0]&ok;case7:ok
|
||||||
|
1737a85f4c8d146cec96e3ffdca76d9903dcf3bd53061868d478c78c63c2aa9e,39e48dd150d2f429be088dfd5b61882e7e8407483702ae9a5ab35927b15f85ea,1be8cc0b04be0c681d0c6a68f733f82c6c896e0c8a262fcd392918e303a7abf4,605b5814bf9b8cb066667c9e5480d22dc5b6c92f14b4af3ee0a9eb83b03685e3,,,e41733f4fb41f397e2f3959708cc07d3937691f375d9d032c6d6e71bfc58503b,9fa4a7eb4064734f99998361ab7f2dd23a4936d0eb4b50c11f56147b4fc9764c,,,case0:ok;case1:ok;case2:info[v=0]&bad[non_square(s)];case3:bad[non_square(s)];case4:ok;case5:ok;case6:info[v=0]&bad[non_square(s)];case7:bad[non_square(s)]
|
||||||
|
1aaa1ccebf9c724191033df366b36f691c4d902c228033ff4516d122b2564f68,c75541259d3ba98f207eaa30c69634d187d0b6da594e719e420f4898638fc5b0,,,,,,,,,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:bad[non_square(q)];case3:bad[non_square(q)];case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:bad[non_square(q)];case7:bad[non_square(q)]
|
||||||
|
2323a1d079b0fd72fc8bb62ec34230a815cb0596c2bfac998bd6b84260f5dc26,239342dfb675500a34a196310b8d87d54f49dcac9da50c1743ceab41a7b249ff,f63580b8aa49c4846de56e39e1b3e73f171e881eba8c66f614e67e5c975dfc07,b6307b332e699f1cf77841d90af25365404deb7fed5edb3090db49e642a156b6,,,09ca7f4755b63b7b921a91c61e4c18c0e8e177e145739909eb1981a268a20028,49cf84ccd19660e30887be26f50dac9abfb2148012a124cf6f24b618bd5ea579,,,case0:ok;case1:ok;case2:bad[non_square(q)];case3:bad[non_square(q)];case4:ok;case5:ok;case6:bad[non_square(q)];case7:bad[non_square(q)]
|
||||||
|
2dc90e640cb646ae9164c0b5a9ef0169febe34dc4437d6e46acb0e27e219d1e8,d236f19bf349b9516e9b3f4a5610fe960141cb23bbc8291b9534f1d71de62a47,e69df7d9c026c36600ebdf588072675847c0c431c8eb730682533e964b6252c9,4f18bbdf7c2d6c5f818c18802fa35cd069eaa79fff74e4fc837c80d93fece2f8,,,196208263fd93c99ff1420a77f8d98a7b83f3bce37148cf97dacc168b49da966,b0e7442083d293a07e73e77fd05ca32f96155860008b1b037c837f25c0131937,,,case0:ok;case1:info[v=0]&ok;case2:bad[non_square(q)];case3:bad[non_square(q)];case4:ok;case5:info[v=0]&ok;case6:bad[non_square(q)];case7:bad[non_square(q)]
|
||||||
|
3edd7b3980e2f2f34d1409a207069f881fda5f96f08027ac4465b63dc278d672,053a98de4a27b1961155822b3a3121f03b2a14458bd80eb4a560c4c7a85c149c,,,b3dae4b7dcf858e4c6968057cef2b156465431526538199cf52dc1b2d62fda30,4aa77dd55d6b6d3cfa10cc9d0fe42f79232e4575661049ae36779c1d0c666d88,,,4c251b482307a71b39697fa8310d4ea9b9abcead9ac7e6630ad23e4c29d021ff,b558822aa29492c305ef3362f01bd086dcd1ba8a99efb651c98863e1f3998ea7,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:ok;case3:ok;case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:ok;case7:ok
|
||||||
|
4295737efcb1da6fb1d96b9ca7dcd1e320024b37a736c4948b62598173069f70,fa7ffe4f25f88362831c087afe2e8a9b0713e2cac1ddca6a383205a266f14307,,,,,,,,,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:bad[non_square(s)];case3:bad[non_square(s)];case4:bad[non_square(s)];case5:bad[non_square(s)];case6:bad[non_square(s)];case7:bad[non_square(s)]
|
||||||
|
587c1a0cee91939e7f784d23b963004a3bf44f5d4e32a0081995ba20b0fca59e,2ea988530715e8d10363907ff25124524d471ba2454d5ce3be3f04194dfd3a3c,cfd5a094aa0b9b8891b76c6ab9438f66aa1c095a65f9f70135e8171292245e74,a89057d7c6563f0d6efa19ae84412b8a7b47e791a191ecdfdf2af84fd97bc339,475d0ae9ef46920df07b34117be5a0817de1023e3cc32689e9be145b406b0aef,a0759178ad80232454f827ef05ea3e72ad8d75418e6d4cc1cd4f5306c5e7c453,302a5f6b55f464776e48939546bc709955e3f6a59a0608feca17e8ec6ddb9dbb,576fa82839a9c0f29105e6517bbed47584b8186e5e6e132020d507af268438f6,b8a2f51610b96df20f84cbee841a5f7e821efdc1c33cd9761641eba3bf94f140,5f8a6e87527fdcdbab07d810fa15c18d52728abe7192b33e32b0acf83a1837dc,case0:ok;case1:ok;case2:ok;case3:ok;case4:ok;case5:ok;case6:ok;case7:ok
|
||||||
|
5fa88b3365a635cbbcee003cce9ef51dd1a310de277e441abccdb7be1e4ba249,79461ff62bfcbcac4249ba84dd040f2cec3c63f725204dc7f464c16bf0ff3170,,,6bb700e1f4d7e236e8d193ff4a76c1b3bcd4e2b25acac3d51c8dac653fe909a0,f4c73410633da7f63a4f1d55aec6dd32c4c6d89ee74075edb5515ed90da9e683,,,9448ff1e0b281dc9172e6c00b5893e4c432b1d4da5353c2ae3725399c016f28f,0b38cbef9cc25809c5b0e2aa513922cd3b39276118bf8a124aaea125f25615ac,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:ok;case3:info[v=0]&ok;case4:bad[non_square(s)];case5:bad[non_square(s)];case6:ok;case7:info[v=0]&ok
|
||||||
|
6fb31c7531f03130b42b155b952779efbb46087dd9807d241a48eac63c3d96d6,56f81be753e8d4ae4940ea6f46f6ec9fda66a6f96cc95f506cb2b57490e94260,,,59059774795bdb7a837fbe1140a5fa59984f48af8df95d57dd6d1c05437dcec1,22a644db79376ad4e7b3a009e58b3f13137c54fdf911122cc93667c47077d784,,,a6fa688b86a424857c8041eebf5a05a667b0b7507206a2a82292e3f9bc822d6e,dd59bb2486c8952b184c5ff61a74c0ecec83ab0206eeedd336c9983a8f8824ab,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:ok;case3:info[v=0]&ok;case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:ok;case7:info[v=0]&ok
|
||||||
|
704cd226e71cb6826a590e80dac90f2d2f5830f0fdf135a3eae3965bff25ff12,138e0afa68936ee670bd2b8db53aedbb7bea2a8597388b24d0518edd22ad66ec,,,,,,,,,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:bad[non_square(q)];case3:bad[non_square(q)];case4:bad[non_square(s)];case5:bad[non_square(s)];case6:bad[non_square(q)];case7:bad[non_square(q)]
|
||||||
|
725e914792cb8c8949e7e1168b7cdd8a8094c91c6ec2202ccd53a6a18771edeb,8da16eb86d347376b6181ee9748322757f6b36e3913ddfd332ac595d788e0e44,dd357786b9f6873330391aa5625809654e43116e82a5a5d82ffd1d6624101fc4,a0b7efca01814594c59c9aae8e49700186ca5d95e88bcc80399044d9c2d8613d,,,22ca8879460978cccfc6e55a9da7f69ab1bcee917d5a5a27d002e298dbefdc6b,5f481035fe7eba6b3a63655171b68ffe7935a26a1774337fc66fbb253d279af2,,,case0:ok;case1:info[v=0]&ok;case2:bad[non_square(s)];case3:bad[non_square(s)];case4:ok;case5:info[v=0]&ok;case6:bad[non_square(s)];case7:bad[non_square(s)]
|
||||||
|
78fe6b717f2ea4a32708d79c151bf503a5312a18c0963437e865cc6ed3f6ae97,8701948e80d15b5cd8f72863eae40afc5aced5e73f69cbc8179a33902c094d98,,,,,,,,,case0:bad[non_square(s)];case1:info[v=0]&bad[non_square(s)];case2:bad[non_square(q)];case3:bad[non_square(q)];case4:bad[non_square(s)];case5:info[v=0]&bad[non_square(s)];case6:bad[non_square(q)];case7:bad[non_square(q)]
|
||||||
|
7c37bb9c5061dc07413f11acd5a34006e64c5c457fdb9a438f217255a961f50d,5c1a76b44568eb59d6789a7442d9ed7cdc6226b7752b4ff8eaf8e1a95736e507,,,b94d30cd7dbff60b64620c17ca0fafaa40b3d1f52d077a60a2e0cafd145086c2,,,,46b2cf32824009f49b9df3e835f05055bf4c2e0ad2f8859f5d1f3501ebaf756d,,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:info[q=0]&info[X=0]&ok;case3:info[q=0]&bad[r=0];case4:bad[non_square(s)];case5:bad[non_square(s)];case6:info[q=0]&info[X=0]&ok;case7:info[q=0]&bad[r=0]
|
||||||
|
82388888967f82a6b444438a7d44838e13c0d478b9ca060da95a41fb94303de6,29e9654170628fec8b4972898b113cf98807f4609274f4f3140d0674157c90a0,,,,,,,,,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:bad[non_square(s)];case3:info[v=0]&bad[non_square(s)];case4:bad[non_square(s)];case5:bad[non_square(s)];case6:bad[non_square(s)];case7:info[v=0]&bad[non_square(s)]
|
||||||
|
91298f5770af7a27f0a47188d24c3b7bf98ab2990d84b0b898507e3c561d6472,144f4ccbd9a74698a88cbf6fd00ad886d339d29ea19448f2c572cac0a07d5562,e6a0ffa3807f09dadbe71e0f4be4725f2832e76cad8dc1d943ce839375eff248,837b8e68d4917544764ad0903cb11f8615d2823cefbb06d89049dbabc69befda,,,195f005c7f80f6252418e1f0b41b8da0d7cd189352723e26bc317c6b8a1009e7,7c8471972b6e8abb89b52f6fc34ee079ea2d7dc31044f9276fb6245339640c55,,,case0:ok;case1:ok;case2:bad[non_square(s)];case3:info[v=0]&bad[non_square(s)];case4:ok;case5:ok;case6:bad[non_square(s)];case7:info[v=0]&bad[non_square(s)]
|
||||||
|
b682f3d03bbb5dee4f54b5ebfba931b4f52f6a191e5c2f483c73c66e9ace97e1,904717bf0bc0cb7873fcdc38aa97f19e3a62630972acff92b24cc6dda197cb96,,,,,,,,,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:bad[non_square(s)];case3:bad[non_square(s)];case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:bad[non_square(s)];case7:bad[non_square(s)]
|
||||||
|
c17ec69e665f0fb0dbab48d9c2f94d12ec8a9d7eacb58084833091801eb0b80b,147756e66d96e31c426d3cc85ed0c4cfbef6341dd8b285585aa574ea0204b55e,6f4aea431a0043bdd03134d6d9159119ce034b88c32e50e8e36c4ee45eac7ae9,fd5be16d4ffa2690126c67c3ef7cb9d29b74d397c78b06b3605fda34dc9696a6,5e9c60792a2f000e45c6250f296f875e174efc0e9703e628706103a9dd2d82c7,,90b515bce5ffbc422fcecb2926ea6ee631fcb4773cd1af171c93b11aa1538146,02a41e92b005d96fed93983c1083462d648b2c683874f94c9fa025ca23696589,a1639f86d5d0fff1ba39daf0d69078a1e8b103f168fc19d78f9efc5522d27968,,case0:ok;case1:ok;case2:info[q=0]&info[X=0]&ok;case3:info[q=0]&bad[r=0];case4:ok;case5:ok;case6:info[q=0]&info[X=0]&ok;case7:info[q=0]&bad[r=0]
|
||||||
|
c25172fc3f29b6fc4a1155b8575233155486b27464b74b8b260b499a3f53cb14,1ea9cbdb35cf6e0329aa31b0bb0a702a65123ed008655a93b7dcd5280e52e1ab,,,7422edc7843136af0053bb8854448a8299994f9ddcefd3a9a92d45462c59298a,78c7774a266f8b97ea23d05d064f033c77319f923f6b78bce4e20bf05fa5398d,,,8bdd12387bcec950ffac4477abbb757d6666b06223102c5656d2bab8d3a6d2a5,873888b5d990746815dc2fa2f9b0fcc388ce606dc09487431b1df40ea05ac2a2,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:ok;case3:ok;case4:bad[non_square(s)];case5:bad[non_square(s)];case6:ok;case7:ok
|
||||||
|
cab6626f832a4b1280ba7add2fc5322ff011caededf7ff4db6735d5026dc0367,2b2bef0852c6f7c95d72ac99a23802b875029cd573b248d1f1b3fc8033788eb6,,,,,,,,,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:info[v=0]&bad[non_square(s)];case3:bad[non_square(s)];case4:bad[non_square(s)];case5:bad[non_square(s)];case6:info[v=0]&bad[non_square(s)];case7:bad[non_square(s)]
|
||||||
|
d8621b4ffc85b9ed56e99d8dd1dd24aedcecb14763b861a17112dc771a104fd2,812cabe972a22aa67c7da0c94d8a936296eb9949d70c37cb2b2487574cb3ce58,fbc5febc6fdbc9ae3eb88a93b982196e8b6275a6d5a73c17387e000c711bd0e3,8724c96bd4e5527f2dd195a51c468d2d211ba2fac7cbe0b4b3434253409fb42d,,,043a014390243651c147756c467de691749d8a592a58c3e8c781fff28ee42b4c,78db36942b1aad80d22e6a5ae3b972d2dee45d0538341f4b4cbcbdabbf604802,,,case0:ok;case1:ok;case2:bad[non_square(s)];case3:bad[non_square(s)];case4:ok;case5:ok;case6:bad[non_square(s)];case7:bad[non_square(s)]
|
||||||
|
da463164c6f4bf7129ee5f0ec00f65a675a8adf1bd931b39b64806afdcda9a22,25b9ce9b390b408ed611a0f13ff09a598a57520e426ce4c649b7f94f2325620d,,,,,,,,,case0:bad[non_square(s)];case1:info[v=0]&bad[non_square(s)];case2:bad[non_square(s)];case3:bad[non_square(s)];case4:bad[non_square(s)];case5:info[v=0]&bad[non_square(s)];case6:bad[non_square(s)];case7:bad[non_square(s)]
|
||||||
|
dafc971e4a3a7b6dcfb42a08d9692d82ad9e7838523fcbda1d4827e14481ae2d,250368e1b5c58492304bd5f72696d27d526187c7adc03425e2b7d81dbb7e4e02,,,370c28f1be665efacde6aa436bf86fe21e6e314c1e53dd040e6c73a46b4c8c49,cd8acee98ffe56531a84d7eb3e48fa4034206ce825ace907d0edf0eaeb5e9ca2,,,c8f3d70e4199a105321955bc9407901de191ceb3e1ac22fbf1938c5a94b36fe6,327531167001a9ace57b2814c1b705bfcbdf9317da5316f82f120f1414a15f8d,case0:bad[non_square(s)];case1:info[v=0]&bad[non_square(s)];case2:ok;case3:ok;case4:bad[non_square(s)];case5:info[v=0]&bad[non_square(s)];case6:ok;case7:ok
|
||||||
|
e0294c8bc1a36b4166ee92bfa70a5c34976fa9829405efea8f9cd54dcb29b99e,ae9690d13b8d20a0fbbf37bed8474f67a04e142f56efd78770a76b359165d8a1,,,dcd45d935613916af167b029058ba3a700d37150b9df34728cb05412c16d4182,,,,232ba26ca9ec6e950e984fd6fa745c58ff2c8eaf4620cb8d734fabec3e92baad,,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:info[q=0]&info[X=0]&ok;case3:info[q=0]&bad[r=0];case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:info[q=0]&info[X=0]&ok;case7:info[q=0]&bad[r=0]
|
||||||
|
e148441cd7b92b8b0e4fa3bd68712cfd0d709ad198cace611493c10e97f5394e,164a639794d74c53afc4d3294e79cdb3cd25f99f6df45c000f758aba54d699c0,,,,,,,,,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:bad[non_square(s)];case3:info[v=0]&bad[non_square(s)];case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:bad[non_square(s)];case7:info[v=0]&bad[non_square(s)]
|
||||||
|
e4b00ec97aadcca97644d3b0c8a931b14ce7bcf7bc8779546d6e35aa5937381c,94e9588d41647b3fcc772dc8d83c67ce3be003538517c834103d2cd49d62ef4d,c88d25f41407376bb2c03a7fffeb3ec7811cc43491a0c3aac0378cdc78357bee,51c02636ce00c2345ecd89adb6089fe4d5e18ac924e3145e6669501cd37a00d4,205b3512db40521cb200952e67b46f67e09e7839e0de44004138329ebd9138c5,58aab390ab6fb55c1d1b80897a207ce94a78fa5b4aa61a33398bcae9adb20d3e,3772da0bebf8c8944d3fc5800014c1387ee33bcb6e5f3c553fc8732287ca8041,ae3fd9c931ff3dcba132765249f7601b2a1e7536db1ceba19996afe22c85fb5b,dfa4caed24bfade34dff6ad1984b90981f6187c61f21bbffbec7cd60426ec36a,a7554c6f54904aa3e2e47f7685df8316b58705a4b559e5ccc6743515524deef1,case0:ok;case1:ok;case2:ok;case3:info[v=0]&ok;case4:ok;case5:ok;case6:ok;case7:info[v=0]&ok
|
||||||
|
e5bbb9ef360d0a501618f0067d36dceb75f5be9a620232aa9fd5139d0863fde5,e5bbb9ef360d0a501618f0067d36dceb75f5be9a620232aa9fd5139d0863fde5,,,,,,,,,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:bad[s=0];case3:bad[s=0];case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:bad[s=0];case7:bad[s=0]
|
||||||
|
e6bcb5c3d63467d490bfa54fbbc6092a7248c25e11b248dc2964a6e15edb1457,19434a3c29cb982b6f405ab04439f6d58db73da1ee4db723d69b591da124e7d8,67119877832ab8f459a821656d8261f544a553b89ae4f25c52a97134b70f3426,ffee02f5e649c07f0560eff1867ec7b32d0e595e9b1c0ea6e2a4fc70c97cd71f,b5e0c189eb5b4bacd025b7444d74178be8d5246cfa4a9a207964a057ee969992,5746e4591bf7f4c3044609ea372e908603975d279fdef8349f0b08d32f07619d,98ee67887cd5470ba657de9a927d9e0abb5aac47651b0da3ad568eca48f0c809,0011fd0a19b63f80fa9f100e7981384cd2f1a6a164e3f1591d5b038e36832510,4a1f3e7614a4b4532fda48bbb28be874172adb9305b565df869b5fa71169629d,a8b91ba6e4080b3cfbb9f615c8d16f79fc68a2d8602107cb60f4f72bd0f89a92,case0:ok;case1:info[v=0]&ok;case2:ok;case3:ok;case4:ok;case5:info[v=0]&ok;case6:ok;case7:ok
|
||||||
|
f28fba64af766845eb2f4302456e2b9f8d80affe57e7aae42738d7cddb1c2ce6,f28fba64af766845eb2f4302456e2b9f8d80affe57e7aae42738d7cddb1c2ce6,4f867ad8bb3d840409d26b67307e62100153273f72fa4b7484becfa14ebe7408,5bbc4f59e452cc5f22a99144b10ce8989a89a995ec3cea1c91ae10e8f721bb5d,,,b079852744c27bfbf62d9498cf819deffeacd8c08d05b48b7b41305db1418827,a443b0a61bad33a0dd566ebb4ef317676576566a13c315e36e51ef1608de40d2,,,case0:ok;case1:ok;case2:bad[s=0];case3:bad[s=0];case4:ok;case5:ok;case6:bad[s=0];case7:bad[s=0]
|
||||||
|
f455605bc85bf48e3a908c31023faf98381504c6c6d3aeb9ede55f8dd528924d,d31fbcd5cdb798f6c00db6692f8fe8967fa9c79dd10958f4a194f01374905e99,,,0c00c5715b56fe632d814ad8a77f8e66628ea47a6116834f8c1218f3a03cbd50,df88e44fac84fa52df4d59f48819f18f6a8cd4151d162afaf773166f57c7ff46,,,f3ff3a8ea4a9019cd27eb527588071999d715b859ee97cb073ede70b5fc33edf,20771bb0537b05ad20b2a60b77e60e7095732beae2e9d505088ce98fa837fce9,case0:bad[non_square(s)];case1:bad[non_square(s)];case2:info[v=0]&ok;case3:ok;case4:bad[non_square(s)];case5:bad[non_square(s)];case6:info[v=0]&ok;case7:ok
|
||||||
|
f58cd4d9830bad322699035e8246007d4be27e19b6f53621317b4f309b3daa9d,78ec2b3dc0948de560148bbc7c6dc9633ad5df70a5a5750cbed721804f082a3b,6c4c580b76c7594043569f9dae16dc2801c16a1fbe12860881b75f8ef929bce5,94231355e7385c5f25ca436aa64191471aea4393d6e86ab7a35fe2afacaefd0d,dff2a1951ada6db574df834048149da3397a75b829abf58c7e69db1b41ac0989,a52b66d3c907035548028bf804711bf422aba95f1a666fc86f4648e05f29caae,93b3a7f48938a6bfbca9606251e923d7fe3e95e041ed79f77e48a07006d63f4a,6bdcecaa18c7a3a0da35bc9559be6eb8e515bc6c291795485ca01d4f5350ff22,200d5e6ae525924a8b207cbfb7eb625cc6858a47d6540a73819624e3be53f2a6,5ad4992c36f8fcaab7fd7407fb8ee40bdd5456a0e599903790b9b71ea0d63181,case0:ok;case1:ok;case2:info[v=0]&ok;case3:ok;case4:ok;case5:ok;case6:info[v=0]&ok;case7:ok
|
||||||
|
fd7d912a40f182a3588800d69ebfb5048766da206fd7ebc8d2436c81cbef6421,8d37c862054debe731694536ff46b273ec122b35a9bf1445ac3c4ff9f262c952,,,,,,,,,case0:bad[valid_x(-x-u)];case1:bad[valid_x(-x-u)];case2:info[v=0]&bad[non_square(s)];case3:bad[non_square(s)];case4:bad[valid_x(-x-u)];case5:bad[valid_x(-x-u)];case6:info[v=0]&bad[non_square(s)];case7:bad[non_square(s)]
|
|
33
test/vectors/secp256k1/bip-0324/xswiftec_test_vectors.csv
Normal file
33
test/vectors/secp256k1/bip-0324/xswiftec_test_vectors.csv
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
u,x,case0_t,case1_t,case2_t,case3_t,case4_t,case5_t,case6_t,case7_t
|
||||||
|
08da7c45cb204377e7e42249cda5713fa865116ddbb4cb5a1949b2e5b438a6ab,e087b707dabf2796b03b2fb4f976c3f2f5abb36110d00ef656432117f2c93f0a,,,,,,,,
|
||||||
|
0a6361b3a802f55cd5ae06101c88a1e216320fe11cc0cfe1d791eed08a1200fd,a0223bc98997647daf4d520129bdb66e4937a00d1533af1fa29645fb96fb5bb5,60a3ed14bd9df0bfb89ada9372a7b5790b123a66bf130f5788237e8cd5225de4,9c4ee4629f10220fda49532d0c859a539dec5148eefc78bf48d93d2828027a9c,fc5e72f042fd1792cbf88728a374a2cc1e03e1f9ec8813fa3692e497cfa7d5e6,cb39fac005f26dc0a383ea64cb9b3b0b26767f20232cae4486f32904df4f04e3,9f5c12eb42620f404765256c8d584a86f4edc59940ecf0a877dc81722add9e4b,63b11b9d60efddf025b6acd2f37a65ac6213aeb711038740b726c2d6d7fd8193,03a18d0fbd02e86d340778d75c8b5d33e1fc1e061377ec05c96d1b6730582649,34c6053ffa0d923f5c7c159b3464c4f4d98980dfdcd351bb790cd6fa20b0f74c
|
||||||
|
102b51b9765a56a3e899f7cf0ee38e5251f9c503b357b330a49183eb7b155604,102b51b9765a56a3e899f7cf0ee38e5251f9c503b357b330a49183eb7b155604,bdb5bd58ca96eae36147a6c55bc2bef2cee55a757ee193cb619edc8d3590f90a,bda953c1da02059350e740b83f59149628e0be50c24ac8dc6908a2225931b4a0,,,424a42a73569151c9eb8593aa43d410d311aa58a811e6c349e612371ca6f0325,4256ac3e25fdfa6caf18bf47c0a6eb69d71f41af3db5372396f75ddca6ce478f,,
|
||||||
|
2921a11f25dadaa24aa79a548e4e81508c2e5e56af2d833d65e2bcce448ce2f5,3a70c472406b83d9f1c4398b8ecef786499bc44a3b30c34ac30f2d8a418bffa3,b9c76c21d3fabb948fa0326bf9e999068e9eed56ee4e76cb81558aa26969c56c,ef7dd84338732a0cac3a8995f3bacf9b2896582b8d3317ed508e5d9a5a3447af,,,463893de2c05446b705fcd94061666f9716112a911b189347eaa755c969636c3,108227bcc78cd5f353c5766a0c453064d769a7d472cce812af71a264a5cbb480,,
|
||||||
|
33b67cb5385ceddad93d0ee960679041613bed34b8b4a5e6362fe7539ba2d3ce,0105c74958a165e016502eeb87835195505d89714c95272b6fa88fe6c60b33ac,,,069e1b3b155c6da989b9b6a8735bba3c5c1049dcf01fe4474772244db89cf9ca,c77b10bca540e95ee66c1f57ab6297787849a89b2b883116e700593e3c0fe66d,,,f961e4c4eaa39256764649578ca445c3a3efb6230fe01bb8b88ddbb147630265,3884ef435abf16a11993e0a8549d688787b65764d477cee918ffa6c0c3f015c2
|
||||||
|
3a898eecdae167231275338e9a79153cbe53f7bf99943eeb72ee64e57bb58699,41ffd7362aaa7b90fe03936deeebe9afafd9c18967122d8f972db2c050d4f07b,60abf7ed2a7ffd3d2ac242a782331ea663d55ca157af994e5e964e9c79a0db40,3c3c39dc37753ab9160dfbc2e0596c3a5114784690caa1836e12036814453da3,adcd3f100de60723f127278998c591fbf081af8e0a77f2a9090bed67d8aa2aa3,,9f540812d58002c2d53dbd587dcce1599c2aa35ea85066b1a169b162865f20ef,c3c3c623c88ac546e9f2043d1fa693c5aeeb87b96f355e7c91edfc96ebbabe8c,5232c0eff219f8dc0ed8d876673a6e040f7e5071f5880d56f6f412972755d18c,
|
||||||
|
46e04d129d7b45d054469ce34e24069a1426b3e34f1b68a3d1bff1e070aee192,c6ce9611bd908c16eba5c599e5219de2d18d82c96aafb0180b23ee315513618f,,,,,,,,
|
||||||
|
47dc540c94ceb704a23875c11273e16bb0b8a87aed84de911f2133568115f254,13964717dbc998964d7c19ec3d9981fe1d4a9a80845552a98fb9352898532844,,,,,,,,
|
||||||
|
4cab73ce2a7e6220975001c8a354143267a3c1ce8bf7692313e654481e616a93,9114cf2edd3b53dbb6581290a5cca532db38b4e9ceeacc9b0437a0e49bf97211,903b600ed648d4ddc48f0f628829c8992c88fab44b692413fb8b3d783854f9a2,2952afe39557606d08c311345788a5071413580917207c86ea7cb829cf2f2c6d,05f414320d0c4004cff10f798c3fda6c4fc335b5a2db940993b3d78147a25c18,48e2531c7e3ec99f807210d6c5330114b4f04d7345535ca5a6e6abf478bdb723,6fc49ff129b72b223b70f09d77d63766d377054bb496dbec0474c286c7ab028d,d6ad501c6aa89f92f73ceecba8775af8ebeca7f6e8df8379158347d530d0cfc2,fa0bebcdf2f3bffb300ef08673c02593b03cca4a5d246bf66c4c287db85da017,b71dace381c136607f8def293accfeeb4b0fb28cbaaca35a5919540a8742450c
|
||||||
|
5aeca385d8b781825b07bbec7c858b7170426c88088935850bc13dd6402368a5,a5135c7a27487e7da4f84413837a748e8fbd9377f776ca7af43ec228bfdc938a,8da4f71fb2700758f623d73c24ac91747da43f2302fce16c8d438a769c63495f,6b8f345fc0a25a76455541ddbf2791ff4b943c98b16db2b6eb6cea94a6b19afb,,,725b08e04d8ff8a709dc28c3db536e8b825bc0dcfd031e9372bc7588639cb2d0,9470cba03f5da589baaabe2240d86e00b46bc3674e924d491493156a594e6134,,
|
||||||
|
707bf0b938f307b5c222e670598b865d5e1f8a8003df82c7abbf7c9f8fa4d720,8f840f46c70cf84a3ddd198fa67479a2a1e0757ffc207d385440835f705b250f,,,eab90fb459bace62d3ce8fbd69c9f1039f0627d0e93e2f42bffd87889cb236a4,157c26578b226c66daf8edfa56f7560f1131f41d1685175e6d76cc95b4f89f10,,,1546f04ba645319d2c31704296360efc60f9d82f16c1d0bd40027876634dc58b,ea83d9a874dd939925071205a908a9f0eece0be2e97ae8a1928933694b075d1f
|
||||||
|
766caa663e1025b9accd7ededd24fbc8193180e028eedae2f41d6bb0b1d36468,22825ee826f8b76c27220e43c79c884a8518bc20f4978cc15f83f9c48346a314,,,8fe95c178da66d1dd249ea6a4dc614a6d46d79c83cbc4beafee518090263e48a,7b044cb756eb207226db302ba05e164781c2f5161dccd72607282cb9ad86a282,,,7016a3e8725992e22db61595b239eb592b928637c343b415011ae7f5fd9c17a5,84fbb348a914df8dd924cfd45fa1e9b87e3d0ae9e23328d9f8d7d345527959ad
|
||||||
|
78a23af8da46b1b37e8767921a2d3f528fdc8eca37cea8aea775fd2b283d3776,73d5f35d96f3ce1ef5802ead8edc10787700c593b5e0ddcc3bfb2720b9d36de3,8465ad20bd0f2b4a2d37106769af46288a109bc10b527c3b033c930c0e4b1025,1b7f03bd2c915bb736622aec85601bcabec89268c98945e19a0de4126ed62524,,,7b9a52df42f0d4b5d2c8ef989650b9d775ef643ef4ad83c4fcc36cf2f1b4ec0a,e480fc42d36ea448c99dd5137a9fe43541376d973676ba1e65f21bec9129d70b,,
|
||||||
|
78b4be1f9eeef9da65c393e4385f67edd142709b400ca7d900bd952e0c3cf727,089329e17a58a91e71ffe6ddd851e8a352e85a29fcc289b34a3bfdeaf958fe91,,,6008d703955b38da0166bd975ad3535af3b701b2efdf653fc5e7e6eb6afff0a3,,,,9ff728fc6aa4c725fe994268a52caca50c48fe4d10209ac03a18191395000b8c,
|
||||||
|
7a2a7c0a81d1bd595dff09b918f8ecb5b5e8493654a4f83496956ed8eb017674,85d583f57e2e42a6a200f646e707134a4a17b6c9ab5b07cb696a912614fe85bb,,,,,,,,
|
||||||
|
913da1f8df6f8fd47593840d533ba0458cc9873996bf310460abb495b34c232a,a7803f8e02b70718443a06db502c67925640e936b3fa46dd2ed6b8f7c80fa329,67d916ba2cc154464d87ff4e0cfe3bb816b22a961831c2daf62597a8b0681e87,a4b84520f8853e5482ee7689732ed7dd7da59945d26edeee0bf5f55d3507192f,,,9826e945d33eabb9b27800b1f301c447e94dd569e7ce3d2509da68564f97dda8,5b47badf077ac1ab7d1189768cd12822825a66ba2d912111f40a0aa1caf8e300,,
|
||||||
|
96a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7,7684ab3b1a43e20a97a7b5520e5b5347841a7d95984fd76b2478a2b710f1a2ce,,,,,,,,
|
||||||
|
99be5efb88ca2013bd8e4eb035fd42d5245468fe9afa70d8ba9c1c419a48c4e8,08ee83ae5c7af0c9b2341e595fe347537272d94f2fe9f10b9a8f913279fc6230,,,,,,,,
|
||||||
|
9b4fb24edd6d1d8830e272398263cdbf026b97392cc35387b991dc0248a628f9,80e81d40a50b53712a8dac5f468b0903c05219544a56af70aa152ebf17887701,,,6e94af5a32ac100c5230f1e119c538742b7051934b02f3850522cff26bd32d97,e9bd309fbf041342311be3d5bab0b9d16c9f80c6640eb47e311d3178c2adc75d,,,916b50a5cd53eff3adcf0e1ee63ac78bd48fae6cb4fd0c7afadd300c942cce98,1642cf6040fbecbdcee41c2a454f462e93607f399bf14b81cee2ce863d5234d2
|
||||||
|
9def996cb1ea87e596b6cadccca3839a352e99d9ce07e635cdb239f38ca294f8,294850a665ab014a0e75eb4b52ee66dd8a8d2b5e453074e58afacb5e019ee90a,b1a29367b95e1996f7e393fb389e7ace812d4135f6ddcdcd77467fc000dfca8c,a340aabc95b4000e3043ba6139178c450046c985fbf09676c440bc6430ddaa5b,4c4cd400d0be335dd651370c5565c2b742a298016212a8605187b3c0751a811e,d90fa208bbb5f3f6e16c5a42b419188ec1951c1eb358f04741b7b48df9e55f79,4e5d6c9846a1e669081c6c04c76185317ed2beca0922323288b9803eff2031a3,5cbf55436a4bfff1cfbc459ec6e873baffb9367a040f69893bbf439acf2251d4,b3b32bff2f41cca229aec8f3aa9a3d48bd5d67fe9ded579fae784c3e8ae57b11,26f05df7444a0c091e93a5bd4be6e7713e6ae3e14ca70fb8be484b71061a9cb6
|
||||||
|
a2c4aed1cf757cd9a509734a267ffc7b1166b55f4c8f9c3e3550c56e743328fc,a2c4aed1cf757cd9a509734a267ffc7b1166b55f4c8f9c3e3550c56e743328fc,,,,,,,,
|
||||||
|
a8e437abf9c0e74dc6d51eabf2d261a00e785c7e21efeac1f322b610273ba066,5a64cce4be767964e7dba23e78e30149326c539353b647e0d5d7cc361943b13b,,,6f73bdd6b748790b5f788935ca02aee3b9e560c4ba6caf47d716fbde1dd6e92c,b1ff705694188e672f58c6a05eeecc379dd1b60fd3cb9f19fcb02b1d9cab4bc5,,,908c422948b786f4a08776ca35fd511c461a9f3b459350b828e90420e2291303,4e008fa96be77198d0a7395fa11133c8622e49f02c3460e6034fd4e16354b06a
|
||||||
|
bf60e4349cace6bce0d552e8d783428db66d0d649bd9e430a3627e2ee14ac839,409f1bcb635319431f2aad17287cbd724992f29b64261bcf5c9d81d01eb533f6,,,,,,,,
|
||||||
|
c0ba8a33ac67f44abff5984dfbb6f56c46b880ac2b86e1f23e7fa9c402c53ae7,4767c4cab0d08133980a8e66c3f93a055c8ae62f89a92f8dcfa47607cee0bc57,4c21052f5ffccadb4f707aa1cba828ef384d7861af1690c59d638dfee9f368e7,dbcc8fe22896478161452d44688a6b138050a4d0964470c175a521dcecc5519a,,,b3defad0a0033524b08f855e3457d710c7b2879e50e96f3a629c7200160c9348,2433701dd769b87e9ebad2bb977594ec7faf5b2f69bb8f3e8a5ade22133aaa95,,
|
||||||
|
cbe2268747c9c8072c7f9926f2288f270637dc55bb9d14d3368361d5e47d25be,0e4e25736b614910c4984843e606b1e229def08bfd672ab61e2707cde8248c6d,,,c30567184201fac8e1cb9e776d921e17d28cdb7333223abd1c8f860a16393df1,,,,3cfa98e7bdfe05371e346188926de1e82d73248cccddc542e37079f4e9c6be3e,
|
||||||
|
ceb827ad3d3884fd4d50ae6099d6d50c09a21e72ebd309708e8b69d93df19e55,a6a0c8c94462f16f1b92502c3d5f9d1618f12ffa756227d5b19b01b9373cd940,,,,,,,,
|
||||||
|
d57e9d4f5842134f140032eaf38b5333638e8c4b145fcf86a23d48d3e9acc0f8,2a8162b0a7bdecb0ebffcd150c74accc9c7173b4eba030795dc2b72b16533b37,349a9a592d2c56e5378ae869d646043fc09ffb8fe5fd9debd83a11274da08892,9875f58028cc991cafab9fb1183b350bc1d8d5ce5723813cc2b8434ed1a2100f,,,cb6565a6d2d3a91ac875179629b9fbc03f6004701a02621427c5eed7b25f739d,678a0a7fd73366e35054604ee7c4caf43e272a31a8dc7ec33d47bcb02e5dec20,,
|
||||||
|
d94e7f1e9bb1f8a9b90996ba12c461b84956f0e7f230145cc594c2f80b067aa0,b4f4632803cff65c013a566748cd3386d58cd3a28f5b4721056cbe9d278a67a4,,,fad51eda7d418ee2785df9f3788ac9152576312177fc0fd83c65036750581620,749259382784be63f86cc927a5defa6aa8cecb98e38d68f6b7a7e958303c94ad,,,052ae12582be711d87a2060c877536eada89cede8803f027c39afc97afa7e60f,8b6da6c7d87b419c079336d85a210595573134671c729709485816a6cfc36782
|
||||||
|
e545d395bb3fd971f91bf9a2b6722831df704efae6c1aa9da0989ed0970b77bb,760486143a1d512da5219d3e5febc7c5c9990d21ca7a501ed23f86c91ddee4cf,,,090892960a84c69967fe5a5d014d3ca19173e4cb72a908586fbce9d1e531a265,42a47f65d00ff2004faa98865ee8ed4f8a9a5ddc9f75042d728de335664bb546,,,f6f76d69f57b39669801a5a2feb2c35e6e8c1b348d56f7a79043162d1ace59ca,bd5b809a2ff00dffb0556779a11712b07565a223608afbd28d721cc999b446e9
|
||||||
|
e9f86cefcfd61558fe75da7d4ea48a6c82d93191c6d49579aab49f99e543dcad,5db7371325a7bb83b030691b2d87cd9f199f43d91e302568391ac48181b7cea6,,,,,,,,
|
||||||
|
eec4121f2a07b61aba16414812aa9afc39ab0a136360a5ace2240dc19b0464eb,0b623c5296c13218a1eb24e79d00b04bf15788f6c2f7ec100a4a16f1473124a2,,,,,,,,
|
||||||
|
f566cc6fccc657365c0197accf3a7d6f80f85209ff666ff774f4dcbc524aa842,0a9933903339a8c9a3fe685330c582907f07adf6009990088b0b2342adb553ed,3ab8dc4ecbc0441c685436ac0d76f16393769c353be6092bd6ec4ce094106bd8,3bd189b4ef3d1baa5610f2b14cb4a2b377eb171511e6f36ef6a05a2c7c52e368,1594764c6296402aadd123675d81f3505d35f2a52c52881568eadb7b675b53f0,c64fbf71138e66de8ce0abdf3b6f51d151ca8e1037ab5b979e62b2faa15be81c,c54723b1343fbbe397abc953f2890e9c6c8963cac419f6d42913b31e6bef9057,c42e764b10c2e455a9ef0d4eb34b5d4c8814e8eaee190c91095fa5d283ad18c7,ea6b89b39d69bfd5522edc98a27e0cafa2ca0d5ad3ad77ea9715248398a4a83f,39b0408eec719921731f5420c490ae2eae3571efc854a468619d4d045ea41413
|
|
@ -1,9 +1,25 @@
|
|||||||
{
|
{
|
||||||
"extends": "@paulmillr/jsbt/tsconfigs/esm.json",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "esm",
|
"target": "es2020",
|
||||||
"target": "ES2015"
|
"lib": ["es2020"],
|
||||||
|
"strict": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"allowSyntheticDefaultImports": false,
|
||||||
|
"allowUnreachableCode": false,
|
||||||
|
"esModuleInterop": false,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noUncheckedIndexedAccess": false,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@noble/hashes/crypto": ["src/crypto"]
|
||||||
},
|
},
|
||||||
"include": ["index.ts", "src"],
|
"module": "es2020",
|
||||||
|
"outDir": "esm",
|
||||||
|
"moduleResolution": "bundler"
|
||||||
|
},
|
||||||
|
"include": ["src"],
|
||||||
"exclude": ["node_modules", "lib"]
|
"exclude": ["node_modules", "lib"]
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": "@paulmillr/jsbt/tsconfigs/cjs.json",
|
"extends": "./tsconfig.esm.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node10",
|
||||||
"outDir": ".",
|
"outDir": ".",
|
||||||
"target": "ES2015"
|
"declaration": true,
|
||||||
},
|
"declarationMap": true
|
||||||
"include": ["index.ts", "src"],
|
}
|
||||||
"exclude": ["node_modules", "lib"]
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user