diff --git a/test/basic.test.js b/test/basic.test.js index 6699fc3..487d7ee 100644 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -1,21 +1,21 @@ import { deepStrictEqual, throws } from 'assert'; import { should, describe } from 'micro-should'; import * as fc from 'fast-check'; -import * as mod from '../esm/abstract/modular.js'; -import { bytesToHex as toHex } from '../esm/abstract/utils.js'; +import * as mod from '../abstract/modular.js'; +import { bytesToHex as toHex } from '../abstract/utils.js'; // Generic tests for all curves in package import { secp192r1, secp224r1 } from './_more-curves.helpers.js'; -import { secp256r1 } from '../esm/p256.js'; -import { secp384r1 } from '../esm/p384.js'; -import { secp521r1 } from '../esm/p521.js'; -import { secp256k1 } from '../esm/secp256k1.js'; -import { ed25519, ed25519ctx, ed25519ph, x25519 } from '../esm/ed25519.js'; -import { ed448, ed448ph } from '../esm/ed448.js'; -import { _starkCurve as starkCurve } from '../esm/stark.js'; -import { pallas, vesta } from '../esm/pasta.js'; -import { bn254 } from '../esm/bn.js'; -import { jubjub } from '../esm/jubjub.js'; -import { bls12_381 } from '../esm/bls12-381.js'; +import { secp256r1 } from '../p256.js'; +import { secp384r1 } from '../p384.js'; +import { secp521r1 } from '../p521.js'; +import { secp256k1 } from '../secp256k1.js'; +import { ed25519, ed25519ctx, ed25519ph, x25519 } from '../ed25519.js'; +import { ed448, ed448ph } from '../ed448.js'; +import { _starkCurve as starkCurve } from '../stark.js'; +import { pallas, vesta } from '../pasta.js'; +import { bn254 } from '../bn.js'; +import { jubjub } from '../jubjub.js'; +import { bls12_381 } from '../bls12-381.js'; // Fields tests const FIELDS = { diff --git a/test/bls12-381.test.js b/test/bls12-381.test.js index 18d1efa..d3183c2 100644 --- a/test/bls12-381.test.js +++ b/test/bls12-381.test.js @@ -2,10 +2,10 @@ import { deepStrictEqual, notDeepStrictEqual, throws } from 'assert'; import * as fc from 'fast-check'; import { readFileSync } from 'fs'; import { describe, should } from 'micro-should'; -import { wNAF } from '../esm/abstract/curve.js'; -import { bytesToHex, utf8ToBytes } from '../esm/abstract/utils.js'; -import { hash_to_field } from '../esm/abstract/hash-to-curve.js'; -import { bls12_381 as bls } from '../esm/bls12-381.js'; +import { wNAF } from '../abstract/curve.js'; +import { bytesToHex, utf8ToBytes } from '../abstract/utils.js'; +import { hash_to_field } from '../abstract/hash-to-curve.js'; +import { bls12_381 as bls } from '../bls12-381.js'; import zkVectors from './bls12-381/zkcrypto/converted.json' assert { type: 'json' }; import pairingVectors from './bls12-381/go_pairing_vectors/pairing.json' assert { type: 'json' }; diff --git a/test/ed25519-addons.test.js b/test/ed25519-addons.test.js index 03e010a..ad859f0 100644 --- a/test/ed25519-addons.test.js +++ b/test/ed25519-addons.test.js @@ -2,9 +2,9 @@ import { sha512 } from '@noble/hashes/sha512'; import { hexToBytes, bytesToHex, randomBytes } from '@noble/hashes/utils'; import { deepStrictEqual, strictEqual, throws } from 'assert'; import { describe, should } from 'micro-should'; -import { bytesToNumberLE, numberToBytesLE } from '../esm/abstract/utils.js'; +import { bytesToNumberLE, numberToBytesLE } from '../abstract/utils.js'; import { default as x25519vectors } from './wycheproof/x25519_test.json' assert { type: 'json' }; -import { ed25519ctx, ed25519ph, RistrettoPoint, x25519 } from '../esm/ed25519.js'; +import { ed25519ctx, ed25519ph, RistrettoPoint, x25519 } from '../ed25519.js'; // const ed = ed25519; const hex = bytesToHex; diff --git a/test/ed25519.helpers.js b/test/ed25519.helpers.js index c426896..d030bec 100644 --- a/test/ed25519.helpers.js +++ b/test/ed25519.helpers.js @@ -1 +1 @@ -export { ed25519, ED25519_TORSION_SUBGROUP } from '../esm/ed25519.js'; +export { ed25519, ED25519_TORSION_SUBGROUP } from '../ed25519.js'; diff --git a/test/ed448.test.js b/test/ed448.test.js index f892cad..534e1ca 100644 --- a/test/ed448.test.js +++ b/test/ed448.test.js @@ -1,9 +1,9 @@ import { deepStrictEqual, throws } from 'assert'; import { describe, should } from 'micro-should'; import * as fc from 'fast-check'; -import { ed448, ed448ph, x448 } from '../esm/ed448.js'; +import { ed448, ed448ph, x448 } from '../ed448.js'; import { hexToBytes, bytesToHex, randomBytes } from '@noble/hashes/utils'; -import { numberToBytesLE } from '../esm/abstract/utils.js'; +import { numberToBytesLE } from '../abstract/utils.js'; import { default as ed448vectors } from './wycheproof/ed448_test.json' assert { type: 'json' }; import { default as x448vectors } from './wycheproof/x448_test.json' assert { type: 'json' }; diff --git a/test/hash-to-curve.test.js b/test/hash-to-curve.test.js index a23b67f..2bdc4bc 100644 --- a/test/hash-to-curve.test.js +++ b/test/hash-to-curve.test.js @@ -5,15 +5,15 @@ import { bytesToHex } from '@noble/hashes/utils'; import { sha256 } from '@noble/hashes/sha256'; import { sha512 } from '@noble/hashes/sha512'; import { shake128, shake256 } from '@noble/hashes/sha3'; -import * as secp256r1 from '../esm/p256.js'; -import * as secp384r1 from '../esm/p384.js'; -import * as secp521r1 from '../esm/p521.js'; -import * as ed25519 from '../esm/ed25519.js'; -import * as ed448 from '../esm/ed448.js'; -import * as secp256k1 from '../esm/secp256k1.js'; -import { bls12_381 } from '../esm/bls12-381.js'; -import { expand_message_xmd, expand_message_xof } from '../esm/abstract/hash-to-curve.js'; -import { utf8ToBytes } from '../esm/abstract/utils.js'; +import * as secp256r1 from '../p256.js'; +import * as secp384r1 from '../p384.js'; +import * as secp521r1 from '../p521.js'; +import * as ed25519 from '../ed25519.js'; +import * as ed448 from '../ed448.js'; +import * as secp256k1 from '../secp256k1.js'; +import { bls12_381 } from '../bls12-381.js'; +import { expand_message_xmd, expand_message_xof } from '../abstract/hash-to-curve.js'; +import { utf8ToBytes } from '../abstract/utils.js'; // XMD import { default as xmd_sha256_38 } from './hash-to-curve/expand_message_xmd_SHA256_38.json' assert { type: 'json' }; import { default as xmd_sha256_256 } from './hash-to-curve/expand_message_xmd_SHA256_256.json' assert { type: 'json' }; diff --git a/test/jubjub.test.js b/test/jubjub.test.js index e443bff..d97dcf0 100644 --- a/test/jubjub.test.js +++ b/test/jubjub.test.js @@ -1,4 +1,4 @@ -import { jubjub, findGroupHash } from '../esm/jubjub.js'; +import { jubjub, findGroupHash } from '../jubjub.js'; import { describe, should } from 'micro-should'; import { deepStrictEqual, throws } from 'assert'; const Point = jubjub.ExtendedPoint; diff --git a/test/nist.test.js b/test/nist.test.js index 62751b3..5aa21a3 100644 --- a/test/nist.test.js +++ b/test/nist.test.js @@ -1,11 +1,11 @@ import { deepStrictEqual } from 'assert'; import { describe, should } from 'micro-should'; import { secp192r1, secp224r1, P192, P224 } from './_more-curves.helpers.js'; -import { secp256r1, P256 } from '../esm/p256.js'; -import { secp384r1, P384 } from '../esm/p384.js'; -import { secp521r1, P521 } from '../esm/p521.js'; -import { secp256k1 } from '../esm/secp256k1.js'; -import { hexToBytes, bytesToHex } from '../esm/abstract/utils.js'; +import { secp256r1, P256 } from '../p256.js'; +import { secp384r1, P384 } from '../p384.js'; +import { secp521r1, P521 } from '../p521.js'; +import { secp256k1 } from '../secp256k1.js'; +import { hexToBytes, bytesToHex } from '../abstract/utils.js'; import { default as ecdsa } from './wycheproof/ecdsa_test.json' assert { type: 'json' }; import { default as ecdh } from './wycheproof/ecdh_test.json' assert { type: 'json' }; import { default as rfc6979 } from './fixtures/rfc6979.json' assert { type: 'json' }; diff --git a/test/poseidon.test.js b/test/poseidon.test.js index e469fc7..0d0fe0f 100644 --- a/test/poseidon.test.js +++ b/test/poseidon.test.js @@ -1,8 +1,8 @@ import { deepStrictEqual, throws } from 'assert'; import { should, describe } from 'micro-should'; -import * as poseidon from '../esm/abstract/poseidon.js'; -import * as stark from '../esm/stark.js'; -import * as mod from '../esm/abstract/modular.js'; +import * as poseidon from '../abstract/poseidon.js'; +import * as stark from '../stark.js'; +import * as mod from '../abstract/modular.js'; import { default as pvectors } from './vectors/poseidon.json' assert { type: 'json' }; const { st1, st2, st3, st4 } = pvectors; diff --git a/test/secp256k1-schnorr.test.js b/test/secp256k1-schnorr.test.js index 6e0d887..4080ca7 100644 --- a/test/secp256k1-schnorr.test.js +++ b/test/secp256k1-schnorr.test.js @@ -2,7 +2,7 @@ import { deepStrictEqual, throws } from 'assert'; import { readFileSync } from 'fs'; import { should, describe } from 'micro-should'; import { bytesToHex as hex } from '@noble/hashes/utils'; -import { schnorr } from '../esm/secp256k1.js'; +import { schnorr } from '../secp256k1.js'; const schCsv = readFileSync('./test/vectors/schnorr.csv', 'utf-8'); describe('schnorr.sign()', () => { diff --git a/test/secp256k1.helpers.js b/test/secp256k1.helpers.js index c907ddd..5d871a8 100644 --- a/test/secp256k1.helpers.js +++ b/test/secp256k1.helpers.js @@ -1,8 +1,8 @@ // @ts-ignore -export { secp256k1 as secp } from '../esm/secp256k1.js'; -import { secp256k1 as _secp } from '../esm/secp256k1.js'; -export { bytesToNumberBE, numberToBytesBE } from '../esm/abstract/utils.js'; -export { mod } from '../esm/abstract/modular.js'; +export { secp256k1 as secp } from '../secp256k1.js'; +import { secp256k1 as _secp } from '../secp256k1.js'; +export { bytesToNumberBE, numberToBytesBE } from '../abstract/utils.js'; +export { mod } from '../abstract/modular.js'; export const sigFromDER = (der) => { return _secp.Signature.fromDER(der); }; diff --git a/test/stark/basic.test.js b/test/stark/basic.test.js index a63d491..9b3fab4 100644 --- a/test/stark/basic.test.js +++ b/test/stark/basic.test.js @@ -1,6 +1,6 @@ import { deepStrictEqual, throws } from 'assert'; import { describe, should } from 'micro-should'; -import * as starknet from '../../esm/stark.js'; +import * as starknet from '../../stark.js'; import { default as issue2 } from './fixtures/issue2.json' assert { type: 'json' }; import * as bip32 from '@scure/bip32'; import * as bip39 from '@scure/bip39'; diff --git a/test/stark/benchmark/index.js b/test/stark/benchmark/index.js index f283d36..3fce628 100644 --- a/test/stark/benchmark/index.js +++ b/test/stark/benchmark/index.js @@ -1,4 +1,4 @@ -import * as microStark from '../../../esm/stark.js'; +import * as microStark from '../../../stark.js'; import * as starkwareCrypto from '@starkware-industries/starkware-crypto-utils'; import * as bench from 'micro-bmark'; const { run, mark } = bench; // or bench.mark diff --git a/test/stark/poseidon.test.js b/test/stark/poseidon.test.js index 9ac4382..62bd928 100644 --- a/test/stark/poseidon.test.js +++ b/test/stark/poseidon.test.js @@ -1,6 +1,6 @@ import { deepStrictEqual, throws } from 'assert'; import { describe, should } from 'micro-should'; -import * as starknet from '../../esm/stark.js'; +import * as starknet from '../../stark.js'; import { bytesToHex as hex } from '@noble/hashes/utils'; import * as fs from 'fs'; diff --git a/test/stark/property.test.js b/test/stark/property.test.js index 930861f..c02ecb2 100644 --- a/test/stark/property.test.js +++ b/test/stark/property.test.js @@ -1,6 +1,6 @@ import { deepStrictEqual, throws } from 'assert'; import { describe, should } from 'micro-should'; -import * as starknet from '../../esm/stark.js'; +import * as starknet from '../../stark.js'; import * as fc from 'fast-check'; const FC_BIGINT = fc.bigInt(1n + 1n, starknet.CURVE.n - 1n); diff --git a/test/stark/stark.test.js b/test/stark/stark.test.js index c1aa007..d56d669 100644 --- a/test/stark/stark.test.js +++ b/test/stark/stark.test.js @@ -3,7 +3,7 @@ import { describe, should } from 'micro-should'; import { utf8ToBytes } from '@noble/hashes/utils'; import * as bip32 from '@scure/bip32'; import * as bip39 from '@scure/bip39'; -import * as starknet from '../../esm/stark.js'; +import * as starknet from '../../stark.js'; import { default as sigVec } from './fixtures/rfc6979_signature_test_vector.json' assert { type: 'json' }; import { default as precomputedKeys } from './fixtures/keys_precomputed.json' assert { type: 'json' };