diff --git a/README.md b/README.md index 2a36cd2..48e5c8c 100644 --- a/README.md +++ b/README.md @@ -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'; diff --git a/curve-definitions/src/bn.ts b/curve-definitions/src/bn.ts index 6aa014b..1a51a27 100644 --- a/curve-definitions/src/bn.ts +++ b/curve-definitions/src/bn.ts @@ -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'; diff --git a/curve-definitions/src/ed.ts b/curve-definitions/src/ed.ts index fb820c2..30894a0 100644 --- a/curve-definitions/src/ed.ts +++ b/curve-definitions/src/ed.ts @@ -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( diff --git a/curve-definitions/src/nist.ts b/curve-definitions/src/nist.ts index 34b8102..9f40c75 100644 --- a/curve-definitions/src/nist.ts +++ b/curve-definitions/src/nist.ts @@ -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. diff --git a/curve-definitions/src/pasta.ts b/curve-definitions/src/pasta.ts index 6748f2d..8d0d37c 100644 --- a/curve-definitions/src/pasta.ts +++ b/curve-definitions/src/pasta.ts @@ -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 { diff --git a/curve-definitions/src/starknet.ts b/curve-definitions/src/starknet.ts index 4bccb13..d554cd5 100644 --- a/curve-definitions/src/starknet.ts +++ b/curve-definitions/src/starknet.ts @@ -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) { diff --git a/package.json b/package.json index 08b4167..a4b9bab 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/twistede.ts b/src/edwards.ts similarity index 100% rename from src/twistede.ts rename to src/edwards.ts diff --git a/src/shortw.ts b/src/weierstrass.ts similarity index 100% rename from src/shortw.ts rename to src/weierstrass.ts