@noble/curves 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  import { sha256 } from '@noble/hashes/sha256';
3
3
  import { mod, pow2 } from '../modular';
4
4
  import { createCurve } from './_shortw_utils.js';
5
- import { ensureBytes, concatBytes, hexToBytes, bytesToNumberBE, randomBytes } from '../utils';
5
+ import { ensureBytes, concatBytes, hexToBytes, bytesToNumberBE, randomBytes, } from '../utils';
6
6
  /**
7
7
  * secp256k1 belongs to Koblitz curves: it has
8
8
  * efficiently computable Frobenius endomorphism.
@@ -8,7 +8,7 @@
8
8
  // 4. Point decompression code is different too (unexpected), now using generalized formula
9
9
  // 5. Domain function was no-op for ed25519, but adds some data even with empty context for ed448
10
10
  import * as mod from './modular.js';
11
- import { bytesToHex, concatBytes, ensureBytes, numberToBytesLE, bytesToNumberLE, hashToPrivateScalar, validateOpts as utilOpts, randomBytes as utilRandomBytes } from './utils.js'; // TODO: import * as u from './utils.js'?
11
+ import { bytesToHex, concatBytes, ensureBytes, numberToBytesLE, bytesToNumberLE, hashToPrivateScalar, validateOpts as utilOpts, randomBytes as utilRandomBytes, } from './utils.js'; // TODO: import * as u from './utils.js'?
12
12
  import { wNAF } from './group.js';
13
13
  // Be friendly to bad ECMAScript parsers by not using bigint literals like 123n
14
14
  const _0n = BigInt(0);
@@ -199,7 +199,6 @@ export function weierstrass(curveDef) {
199
199
  num = BigInt(key);
200
200
  }
201
201
  else if (typeof key === 'string') {
202
- // key = key.padStart(2 * groupLen, '0'); // Eth-like hexes
203
202
  if (key.length !== 2 * groupLen)
204
203
  throw new Error(`Expected ${groupLen} bytes of private key`);
205
204
  num = hexToNumber(key);
@@ -202,7 +202,6 @@ function weierstrass(curveDef) {
202
202
  num = BigInt(key);
203
203
  }
204
204
  else if (typeof key === 'string') {
205
- // key = key.padStart(2 * groupLen, '0'); // Eth-like hexes
206
205
  if (key.length !== 2 * groupLen)
207
206
  throw new Error(`Expected ${groupLen} bytes of private key`);
208
207
  num = (0, utils_js_1.hexToNumber)(key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noble/curves",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Minimal, zero-dependency JS implementation of elliptic curve cryptography",
5
5
  "files": [
6
6
  "index.js",
@@ -72,6 +72,16 @@
72
72
  "types": "./lib/utils.d.ts",
73
73
  "import": "./lib/esm/utils.js",
74
74
  "default": "./lib/utils.js"
75
+ },
76
+ "./definitions/secp256k1": {
77
+ "types": "./lib/definitions/secp256k1.d.ts",
78
+ "import": "./lib/esm/definitions/secp256k1.js",
79
+ "default": "./lib/definitions/secp256k1.js"
80
+ },
81
+ "./definitions/ed25519": {
82
+ "types": "./lib/definitions/ed25519.d.ts",
83
+ "import": "./lib/esm/definitions/ed25519.js",
84
+ "default": "./lib/definitions/ed25519.js"
75
85
  }
76
86
  },
77
87
  "browser": {