Rename curves.

This commit is contained in:
Paul Miller 2022-12-10 20:43:19 +00:00
parent c660712fee
commit 4c6ca2326a
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B
9 changed files with 15 additions and 15 deletions

@ -45,8 +45,8 @@ npm install @noble/curves
```
```ts
import shortw from '@noble/curves/shortw'; // Short Weierstrass curve
import twistede from '@noble/curves/twistede'; // Twisted Edwards curve
import weierstrass from '@noble/curves/weierstrass'; // Short Weierstrass curve
import twistedEdwards from '@noble/curves/edwards'; // Twisted Edwards curve
import { sha256 } from '@noble/hashes/sha256';
import { hmac } from '@noble/hashes/hmac';
import { concatBytes, randomBytes } from '@noble/hashes/utils';

@ -1,5 +1,5 @@
/*! @noble/curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { weierstrass, CHash } from '@noble/curves/shortw';
import { weierstrass, CHash } from '@noble/curves/weierstrass';
import { concatBytes, randomBytes } from '@noble/hashes/utils';
import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha256';

@ -1,7 +1,7 @@
import { sha512 } from '@noble/hashes/sha512';
import { shake256 } from '@noble/hashes/sha3';
import { concatBytes, randomBytes, utf8ToBytes, wrapConstructor } from '@noble/hashes/utils';
import { twistedEdwards } from '@noble/curves/twistede';
import { twistedEdwards } from '@noble/curves/edwards';
import { mod, pow2, isNegativeLE } from '@noble/curves/modular';
const ed25519P = BigInt(

@ -3,7 +3,7 @@ import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha256';
import { sha384, sha512 } from '@noble/hashes/sha512';
import { concatBytes, randomBytes } from '@noble/hashes/utils';
import { weierstrass, CurveType, CHash } from '@noble/curves/shortw';
import { weierstrass, CurveType, CHash } from '@noble/curves/weierstrass';
import { mod, pow2 } from '@noble/curves/modular';
// TODO: ability to provide API for different default hash.

@ -2,7 +2,7 @@
import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha256';
import { concatBytes, randomBytes } from '@noble/hashes/utils';
import { weierstrass, CHash } from '@noble/curves/shortw';
import { weierstrass, CHash } from '@noble/curves/weierstrass';
function getHash(hash: CHash) {
return {

@ -3,7 +3,7 @@ import { keccak_256 } from '@noble/hashes/sha3';
import { sha256 } from '@noble/hashes/sha256';
import { hmac } from '@noble/hashes/hmac';
import { concatBytes, randomBytes } from '@noble/hashes/utils';
import { weierstrass, CHash, JacobianPointType } from '@noble/curves/shortw';
import { weierstrass, CHash, JacobianPointType } from '@noble/curves/weierstrass';
import * as cutils from '@noble/curves/utils';
function getHash(hash: CHash) {

@ -37,15 +37,15 @@
"import": "./lib/esm/modular.js",
"default": "./lib/modular.js"
},
"./shortw": {
"types": "./lib/shortw.d.ts",
"import": "./lib/esm/shortw.js",
"default": "./lib/shortw.js"
"./weierstrass": {
"types": "./lib/weierstrass.d.ts",
"import": "./lib/esm/weierstrass.js",
"default": "./lib/weierstrass.js"
},
"./twistede": {
"types": "./lib/twistede.d.ts",
"import": "./lib/esm/twistede.js",
"default": "./lib/twistede.js"
"./edwards": {
"types": "./lib/edwards.d.ts",
"import": "./lib/esm/edwards.js",
"default": "./lib/edwards.js"
},
"./utils": {
"types": "./lib/utils.d.ts",