diff --git a/configs/tsconfig.json b/configs/tsconfig.json index 7842299..401b459 100644 --- a/configs/tsconfig.json +++ b/configs/tsconfig.json @@ -1,14 +1,15 @@ { "compilerOptions": { "target": "ES2022", - "module": "ES2022", + "module": "node16", "strict": true, "noUnusedParameters": true, "noImplicitReturns": true, "noUnusedLocals": true, "removeComments": false, "preserveConstEnums": true, - "moduleResolution": "Bundler", + "moduleResolution": "node16", + "verbatimModuleSyntax": true, "newLine": "LF", "sourceMap": true, "declaration": true, diff --git a/packages/aes-kw/aes-kw.test.ts b/packages/aes-kw/aes-kw.test.ts index 172620f..b25f4ce 100644 --- a/packages/aes-kw/aes-kw.test.ts +++ b/packages/aes-kw/aes-kw.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { AESKW } from "./aes-kw"; +import { AESKW } from "./aes-kw.js"; import { encode, decode } from "@stablelib/hex"; // Test vectors sourced from RFC 3394 diff --git a/packages/aes/aes.bench.ts b/packages/aes/aes.bench.ts index d22304b..64f1c41 100644 --- a/packages/aes/aes.bench.ts +++ b/packages/aes/aes.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { AES } from "./aes"; +import { AES } from "./aes.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const key = byteSeq(32); diff --git a/packages/aes/aes.test.ts b/packages/aes/aes.test.ts index fde4bcc..964ea51 100644 --- a/packages/aes/aes.test.ts +++ b/packages/aes/aes.test.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { AES } from "./aes"; +import { AES } from "./aes.js"; import { encode, decode } from "@stablelib/hex"; // TODO(dchest): add more AES test vectors. diff --git a/packages/base64/base64.bench.ts b/packages/base64/base64.bench.ts index 076f9a6..c824dfd 100644 --- a/packages/base64/base64.bench.ts +++ b/packages/base64/base64.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { encode, decode } from "./base64"; +import { encode, decode } from "./base64.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf = byteSeq(1024); diff --git a/packages/base64/base64.test.ts b/packages/base64/base64.test.ts index c575926..8098fa7 100644 --- a/packages/base64/base64.test.ts +++ b/packages/base64/base64.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { encode, decode, encodeURLSafe, decodeURLSafe } from "./base64"; +import { encode, decode, encodeURLSafe, decodeURLSafe } from "./base64.js"; const testVectors: [number[], string][] = [ // https://tools.ietf.org/html/rfc4648 diff --git a/packages/binary/binary.test.ts b/packages/binary/binary.test.ts index b88278f..9e72a2b 100644 --- a/packages/binary/binary.test.ts +++ b/packages/binary/binary.test.ts @@ -11,7 +11,7 @@ import { readUintLE, writeUintLE, readUintBE, writeUintBE, readFloat32BE, writeFloat32BE, readFloat64BE, writeFloat64BE, readFloat32LE, writeFloat32LE, readFloat64LE, writeFloat64LE -} from "./binary"; +} from "./binary.js"; const int16BEVectors: [number, number[]][] = [ [0, [0, 0]], diff --git a/packages/blake2b/blake2b.bench.ts b/packages/blake2b/blake2b.bench.ts index 4df3872..0a922e1 100644 --- a/packages/blake2b/blake2b.bench.ts +++ b/packages/blake2b/blake2b.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { hash } from "./blake2b"; +import { hash } from "./blake2b.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf1M = byteSeq(1024 << 10); diff --git a/packages/blake2b/blake2b.test.ts b/packages/blake2b/blake2b.test.ts index a3547b4..3c867f1 100644 --- a/packages/blake2b/blake2b.test.ts +++ b/packages/blake2b/blake2b.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { BLAKE2b } from "./blake2b"; +import { BLAKE2b } from "./blake2b.js"; import { encode } from "@stablelib/hex"; const vectors = [ diff --git a/packages/blake2s/blake2s.bench.ts b/packages/blake2s/blake2s.bench.ts index 612a739..2626d1b 100644 --- a/packages/blake2s/blake2s.bench.ts +++ b/packages/blake2s/blake2s.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { hash } from "./blake2s"; +import { hash } from "./blake2s.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf1M = byteSeq(1024 << 10); diff --git a/packages/blake2s/blake2s.test.ts b/packages/blake2s/blake2s.test.ts index d070109..54ae618 100644 --- a/packages/blake2s/blake2s.test.ts +++ b/packages/blake2s/blake2s.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { BLAKE2s } from "./blake2s"; +import { BLAKE2s } from "./blake2s.js"; import { encode } from "@stablelib/hex"; const vectors = [ diff --git a/packages/blake2xs/blake2xs.bench.ts b/packages/blake2xs/blake2xs.bench.ts index 9e887e8..e0afcba 100644 --- a/packages/blake2xs/blake2xs.bench.ts +++ b/packages/blake2xs/blake2xs.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { xof } from "./blake2xs"; +import { xof } from "./blake2xs.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let key = byteSeq(32); diff --git a/packages/blake2xs/blake2xs.test.ts b/packages/blake2xs/blake2xs.test.ts index 11114bd..9be457d 100644 --- a/packages/blake2xs/blake2xs.test.ts +++ b/packages/blake2xs/blake2xs.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest'; import * as hex from "@stablelib/hex"; import { concat } from "@stablelib/bytes"; -import { BLAKE2Xs } from "./blake2xs"; +import { BLAKE2Xs } from "./blake2xs.js"; /* eslint:disable */ const vectors = [ diff --git a/packages/bytereader/bytereader.bench.ts b/packages/bytereader/bytereader.bench.ts index bb0128c..10073dc 100644 --- a/packages/bytereader/bytereader.bench.ts +++ b/packages/bytereader/bytereader.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { ByteReader } from "./bytereader"; +import { ByteReader } from "./bytereader.js"; import { report, benchmark, byteSeq } from "@stablelib/benchmark"; const buf = byteSeq(8 << 10); diff --git a/packages/bytereader/bytereader.test.ts b/packages/bytereader/bytereader.test.ts index 7c1ebcc..c3c3ee9 100644 --- a/packages/bytereader/bytereader.test.ts +++ b/packages/bytereader/bytereader.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { ByteReader } from "./bytereader"; +import { ByteReader } from "./bytereader.js"; describe("ByteReader", () => { it("should read bytes", () => { diff --git a/packages/bytes/bytes.bench.ts b/packages/bytes/bytes.bench.ts index 4e20af8..7bf1616 100644 --- a/packages/bytes/bytes.bench.ts +++ b/packages/bytes/bytes.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { concat } from "./bytes"; +import { concat } from "./bytes.js"; import { benchmark, report } from "@stablelib/benchmark"; const a0 = new Uint8Array([1, 2, 3]); diff --git a/packages/bytes/bytes.test.ts b/packages/bytes/bytes.test.ts index 7b7096e..1cb038c 100644 --- a/packages/bytes/bytes.test.ts +++ b/packages/bytes/bytes.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { concat } from "./bytes"; +import { concat } from "./bytes.js"; describe("concat", () => { it("should concatenate byte arrays", () => { diff --git a/packages/bytewriter/bytewriter.bench.ts b/packages/bytewriter/bytewriter.bench.ts index 2218f6f..f89d7a6 100644 --- a/packages/bytewriter/bytewriter.bench.ts +++ b/packages/bytewriter/bytewriter.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { ByteWriter } from "./bytewriter"; +import { ByteWriter } from "./bytewriter.js"; import { report, benchmark, byteSeq } from "@stablelib/benchmark"; report("ByteWriter write", benchmark(() => benchmarkWrite(8192), 8192)); diff --git a/packages/bytewriter/bytewriter.test.ts b/packages/bytewriter/bytewriter.test.ts index 58cf807..c2e726b 100644 --- a/packages/bytewriter/bytewriter.test.ts +++ b/packages/bytewriter/bytewriter.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { ByteWriter } from "./bytewriter"; +import { ByteWriter } from "./bytewriter.js"; describe("ByteWriter", () => { it("should write bytes", () => { diff --git a/packages/cbor/cbor.bench.ts b/packages/cbor/cbor.bench.ts index c651e58..c2cdf4a 100644 --- a/packages/cbor/cbor.bench.ts +++ b/packages/cbor/cbor.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { encode, decode, Tagged } from "./cbor"; +import { encode, decode, Tagged } from "./cbor.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf = byteSeq(128); diff --git a/packages/cbor/cbor.test.ts b/packages/cbor/cbor.test.ts index 52751e2..f8d9afe 100644 --- a/packages/cbor/cbor.test.ts +++ b/packages/cbor/cbor.test.ts @@ -4,11 +4,11 @@ import { describe, expect, it } from 'vitest'; import * as hex from "@stablelib/hex"; import { concat } from "@stablelib/bytes"; -import type { TaggedEncoder, TaggedDecoder} from "./cbor"; +import type { TaggedEncoder, TaggedDecoder} from "./cbor.js"; import { encode, decode, Simple, Tagged, DEFAULT_TAGGED_ENCODERS, DEFAULT_TAGGED_DECODERS -} from "./cbor"; +} from "./cbor.js"; // Test vectors from RFC 7049: Appendix A. Examples. const encoderTestVectors = [ diff --git a/packages/chacha-drbg/chacha-drbg.bench.ts b/packages/chacha-drbg/chacha-drbg.bench.ts index c6fe8e4..ed9577b 100644 --- a/packages/chacha-drbg/chacha-drbg.bench.ts +++ b/packages/chacha-drbg/chacha-drbg.bench.ts @@ -1,8 +1,8 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { ChaChaDRBG } from "./chacha-drbg"; -import type { RandomSource } from "@stablelib/random/source"; +import { ChaChaDRBG } from "./chacha-drbg.js"; +import type { RandomSource } from "@stablelib/random/source/index.js"; import { benchmark, report } from "@stablelib/benchmark"; class XKCDSource implements RandomSource { diff --git a/packages/chacha/chacha.bench.ts b/packages/chacha/chacha.bench.ts index 3b51cd3..a233bb8 100644 --- a/packages/chacha/chacha.bench.ts +++ b/packages/chacha/chacha.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { streamXOR } from "./chacha"; +import { streamXOR } from "./chacha.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf16K = byteSeq(16 << 10); diff --git a/packages/chacha/chacha.test.ts b/packages/chacha/chacha.test.ts index 0c34d97..2284ade 100644 --- a/packages/chacha/chacha.test.ts +++ b/packages/chacha/chacha.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { streamXOR, stream } from "./chacha"; +import { streamXOR, stream } from "./chacha.js"; import { encode, decode } from "@stablelib/hex"; function seq(len: number): Uint8Array { diff --git a/packages/chacha20poly1305/chacha20poly1305.bench.ts b/packages/chacha20poly1305/chacha20poly1305.bench.ts index a638db0..95aeaee 100644 --- a/packages/chacha20poly1305/chacha20poly1305.bench.ts +++ b/packages/chacha20poly1305/chacha20poly1305.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { ChaCha20Poly1305 } from "./chacha20poly1305"; +import { ChaCha20Poly1305 } from "./chacha20poly1305.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf8192 = byteSeq(8192); diff --git a/packages/chacha20poly1305/chacha20poly1305.test.ts b/packages/chacha20poly1305/chacha20poly1305.test.ts index 819b346..4c4432f 100644 --- a/packages/chacha20poly1305/chacha20poly1305.test.ts +++ b/packages/chacha20poly1305/chacha20poly1305.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { ChaCha20Poly1305 } from "./chacha20poly1305"; +import { ChaCha20Poly1305 } from "./chacha20poly1305.js"; import { encode, decode } from "@stablelib/hex"; const testVectors = [ diff --git a/packages/cmac/cmac.bench.ts b/packages/cmac/cmac.bench.ts index fc67d37..de85489 100644 --- a/packages/cmac/cmac.bench.ts +++ b/packages/cmac/cmac.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { CMAC } from "./cmac"; +import { CMAC } from "./cmac.js"; import { AES } from "@stablelib/aes"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; diff --git a/packages/cmac/cmac.test.ts b/packages/cmac/cmac.test.ts index 1939ee3..2aa53ae 100644 --- a/packages/cmac/cmac.test.ts +++ b/packages/cmac/cmac.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { CMAC } from "./cmac"; +import { CMAC } from "./cmac.js"; import { AES } from "@stablelib/aes"; import { encode, decode } from "@stablelib/hex"; diff --git a/packages/constant-time/constant-time.test.ts b/packages/constant-time/constant-time.test.ts index faac42b..ca210af 100644 --- a/packages/constant-time/constant-time.test.ts +++ b/packages/constant-time/constant-time.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { select, lessOrEqual, compare, equal } from "./constant-time"; +import { select, lessOrEqual, compare, equal } from "./constant-time.js"; describe("constant-time.select", () => { it("should select correct value", () => { diff --git a/packages/ctr/ctr.bench.ts b/packages/ctr/ctr.bench.ts index 6fda54d..88f4632 100644 --- a/packages/ctr/ctr.bench.ts +++ b/packages/ctr/ctr.bench.ts @@ -3,7 +3,7 @@ import { AES } from "@stablelib/aes"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; -import { CTR } from "./ctr"; +import { CTR } from "./ctr.js"; const buf8192 = byteSeq(8192); const buf1111 = byteSeq(1111); diff --git a/packages/ctr/ctr.test.ts b/packages/ctr/ctr.test.ts index 9f48197..673b0b6 100644 --- a/packages/ctr/ctr.test.ts +++ b/packages/ctr/ctr.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest'; import { AES } from "@stablelib/aes"; import { encode, decode } from "@stablelib/hex"; -import { CTR } from "./ctr"; +import { CTR } from "./ctr.js"; describe("AES-CTR", () => { const v = { diff --git a/packages/ed25519/ed25519.bench.ts b/packages/ed25519/ed25519.bench.ts index e556ecd..739ee72 100644 --- a/packages/ed25519/ed25519.bench.ts +++ b/packages/ed25519/ed25519.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { sign, verify, generateKeyPairFromSeed, generateKeyPair } from "./ed25519"; +import { sign, verify, generateKeyPairFromSeed, generateKeyPair } from "./ed25519.js"; import { benchmark, report } from "@stablelib/benchmark"; const k = generateKeyPair(); diff --git a/packages/ed25519/ed25519.test.ts b/packages/ed25519/ed25519.test.ts index 2c241e6..f5184eb 100644 --- a/packages/ed25519/ed25519.test.ts +++ b/packages/ed25519/ed25519.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'; import { encode, decode } from "@stablelib/base64"; -import { sign, verify, generateKeyPair, extractPublicKeyFromSecretKey, convertPublicKeyToX25519, convertSecretKeyToX25519 } from "./ed25519"; +import { sign, verify, generateKeyPair, extractPublicKeyFromSecretKey, convertPublicKeyToX25519, convertSecretKeyToX25519 } from "./ed25519.js"; /* eslint:disable */ const testVectors = [ diff --git a/packages/float/float.test.ts b/packages/float/float.test.ts index a6193ea..6484243 100644 --- a/packages/float/float.test.ts +++ b/packages/float/float.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { isNegativeZero, fround } from "./float"; +import { isNegativeZero, fround } from "./float.js"; describe("isNegativeZero", () => { it("should return true for -0", () => { diff --git a/packages/gcm/gcm.bench.ts b/packages/gcm/gcm.bench.ts index 9c3d977..7135c16 100644 --- a/packages/gcm/gcm.bench.ts +++ b/packages/gcm/gcm.bench.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { AES } from "@stablelib/aes"; -import { GCM } from "./gcm"; +import { GCM } from "./gcm.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf8192 = byteSeq(8192); diff --git a/packages/gcm/gcm.test.ts b/packages/gcm/gcm.test.ts index 64cb85a..7439589 100644 --- a/packages/gcm/gcm.test.ts +++ b/packages/gcm/gcm.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'; import { AES } from "@stablelib/aes"; -import { GCM } from "./gcm"; +import { GCM } from "./gcm.js"; import { encode, decode } from "@stablelib/hex"; // TODO(dchest): add more test vectors. diff --git a/packages/gf256/gf256.bench.ts b/packages/gf256/gf256.bench.ts index 9dbfab4..f89d4bc 100644 --- a/packages/gf256/gf256.bench.ts +++ b/packages/gf256/gf256.bench.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { benchmark, report } from "@stablelib/benchmark"; -import { mul, div } from "./gf256"; +import { mul, div } from "./gf256.js"; report("gf256.mul", benchmark(() => mul(100, 18))); report("gf256.div", benchmark(() => div(100, 18))); diff --git a/packages/gf256/gf256.test.ts b/packages/gf256/gf256.test.ts index aca1293..0b568e4 100644 --- a/packages/gf256/gf256.test.ts +++ b/packages/gf256/gf256.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { add, sub, mul, div } from "./gf256"; +import { add, sub, mul, div } from "./gf256.js"; describe("add/sub", () => { diff --git a/packages/halfsiphash/halfsiphash.bench.ts b/packages/halfsiphash/halfsiphash.bench.ts index 47b92bf..ae9f121 100644 --- a/packages/halfsiphash/halfsiphash.bench.ts +++ b/packages/halfsiphash/halfsiphash.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2017 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { halfSipHash } from "./halfsiphash"; +import { halfSipHash } from "./halfsiphash.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf1M = byteSeq(1024 << 10); diff --git a/packages/halfsiphash/halfsiphash.test.ts b/packages/halfsiphash/halfsiphash.test.ts index a41101e..fa713e2 100644 --- a/packages/halfsiphash/halfsiphash.test.ts +++ b/packages/halfsiphash/halfsiphash.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'; import * as hex from "@stablelib/hex"; -import { halfSipHash } from "./halfsiphash"; +import { halfSipHash } from "./halfsiphash.js"; const testVectors = [ "A9359F5B", diff --git a/packages/hex/hex.bench.ts b/packages/hex/hex.bench.ts index e5c8547..c763fa6 100644 --- a/packages/hex/hex.bench.ts +++ b/packages/hex/hex.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { encode, decode } from "./hex"; +import { encode, decode } from "./hex.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf = byteSeq(1024); diff --git a/packages/hex/hex.test.ts b/packages/hex/hex.test.ts index 1243ae2..8d5a646 100644 --- a/packages/hex/hex.test.ts +++ b/packages/hex/hex.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { encode, decode } from "./hex"; +import { encode, decode } from "./hex.js"; let buf = new Uint8Array(256); for (let i = 0; i < buf.length; i++) { diff --git a/packages/hkdf/hkdf.bench.ts b/packages/hkdf/hkdf.bench.ts index 692a404..732f9c1 100644 --- a/packages/hkdf/hkdf.bench.ts +++ b/packages/hkdf/hkdf.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { HKDF } from "./hkdf"; +import { HKDF } from "./hkdf.js"; import { SHA256 } from "@stablelib/sha256"; import { SHA512 } from "@stablelib/sha512"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; diff --git a/packages/hkdf/hkdf.test.ts b/packages/hkdf/hkdf.test.ts index 3d96454..e9a6b70 100644 --- a/packages/hkdf/hkdf.test.ts +++ b/packages/hkdf/hkdf.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { HKDF } from "./hkdf"; +import { HKDF } from "./hkdf.js"; import { SHA256, DIGEST_LENGTH } from "@stablelib/sha256"; import { encode, decode } from "@stablelib/hex"; diff --git a/packages/hmac-drbg/hmac-drbg.bench.ts b/packages/hmac-drbg/hmac-drbg.bench.ts index b0676c3..87ed461 100644 --- a/packages/hmac-drbg/hmac-drbg.bench.ts +++ b/packages/hmac-drbg/hmac-drbg.bench.ts @@ -1,8 +1,8 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { HMACDRBG } from "./hmac-drbg"; -import type { RandomSource } from "@stablelib/random/source"; +import { HMACDRBG } from "./hmac-drbg.js"; +import type { RandomSource } from "@stablelib/random/source/index.js"; import { benchmark, report } from "@stablelib/benchmark"; class XKCDSource implements RandomSource { diff --git a/packages/hmac/hmac.test.ts b/packages/hmac/hmac.test.ts index 8043aef..a71dc2e 100644 --- a/packages/hmac/hmac.test.ts +++ b/packages/hmac/hmac.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { HMAC, hmac } from "./hmac"; +import { HMAC, hmac } from "./hmac.js"; import { SHA256 } from "@stablelib/sha256"; import { SHA224 } from "@stablelib/sha224"; import { encode } from "@stablelib/base64"; diff --git a/packages/int/int.test.ts b/packages/int/int.test.ts index 3a7a353..70258f7 100644 --- a/packages/int/int.test.ts +++ b/packages/int/int.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { mul, add, sub } from "./int"; +import { mul, add, sub } from "./int.js"; describe("int.mul", () => { it("should overflow", () => { diff --git a/packages/keyagreement/concat.ts b/packages/keyagreement/concat.ts index d08bcd4..9e728c5 100644 --- a/packages/keyagreement/concat.ts +++ b/packages/keyagreement/concat.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import type { KeyAgreement } from "./keyagreement"; +import type { KeyAgreement } from "./keyagreement.js"; import { concat } from "@stablelib/bytes"; /** diff --git a/packages/nacl/box.ts b/packages/nacl/box.ts index 9a3d487..2f60ffc 100644 --- a/packages/nacl/box.ts +++ b/packages/nacl/box.ts @@ -3,7 +3,7 @@ import { scalarMult } from "@stablelib/x25519"; import { hsalsa } from "@stablelib/xsalsa20"; -import { secretBox, openSecretBox } from "./secretbox"; +import { secretBox, openSecretBox } from "./secretbox.js"; import { wipe } from "@stablelib/wipe"; export { generateKeyPair } from "@stablelib/x25519"; diff --git a/packages/nacl/nacl.ts b/packages/nacl/nacl.ts index b83d847..c7ea42f 100644 --- a/packages/nacl/nacl.ts +++ b/packages/nacl/nacl.ts @@ -5,5 +5,5 @@ * Package nacl implements NaCl (Networking and Cryptography library) cryptography. */ -export * from "./box"; -export * from "./secretbox"; +export * from "./box.js"; +export * from "./secretbox.js"; diff --git a/packages/nacl/secretbox.bench.ts b/packages/nacl/secretbox.bench.ts index f51c74e..08e0e80 100644 --- a/packages/nacl/secretbox.bench.ts +++ b/packages/nacl/secretbox.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { secretBox } from "./secretbox"; +import { secretBox } from "./secretbox.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf8192 = byteSeq(8192); diff --git a/packages/nacl/secretbox.test.ts b/packages/nacl/secretbox.test.ts index 5e17574..ff8d671 100644 --- a/packages/nacl/secretbox.test.ts +++ b/packages/nacl/secretbox.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { secretBox, openSecretBox } from "./secretbox"; +import { secretBox, openSecretBox } from "./secretbox.js"; import { encode, decode } from "@stablelib/hex"; describe("secretBox", () => { diff --git a/packages/newhope/newhope.bench.ts b/packages/newhope/newhope.bench.ts index e5c7774..403a70a 100644 --- a/packages/newhope/newhope.bench.ts +++ b/packages/newhope/newhope.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { NewHope } from "./newhope"; +import { NewHope } from "./newhope.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const seed = byteSeq(32); diff --git a/packages/newhope/newhope.test.ts b/packages/newhope/newhope.test.ts index c59a44e..02543fb 100644 --- a/packages/newhope/newhope.test.ts +++ b/packages/newhope/newhope.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { NewHope } from "./newhope"; +import { NewHope } from "./newhope.js"; import { stream } from "@stablelib/chacha"; import * as hex from "@stablelib/hex"; diff --git a/packages/newhope/newhope.ts b/packages/newhope/newhope.ts index 2b7a803..1c7d5be 100644 --- a/packages/newhope/newhope.ts +++ b/packages/newhope/newhope.ts @@ -28,8 +28,8 @@ import type { RandomSource } from "@stablelib/random"; import { SHAKE128, SHA3256 } from "@stablelib/sha3"; -import type { SeedExpander} from "./custom"; -import { CustomNewHope } from "./custom"; +import type { SeedExpander } from "./custom.js"; +import { CustomNewHope } from "./custom.js"; export { PUBLIC_SEED_LENGTH, @@ -37,7 +37,7 @@ export { OFFER_MESSAGE_LENGTH, ACCEPT_MESSAGE_LENGTH, SAVED_STATE_LENGTH -} from "./custom"; +} from "./custom.js"; // Byte length of shared key. export const SHARED_KEY_LENGTH = 32; // SHA-3 digest length diff --git a/packages/pbkdf2/pbkdf2.bench.ts b/packages/pbkdf2/pbkdf2.bench.ts index 8cbfe41..137fbbb 100644 --- a/packages/pbkdf2/pbkdf2.bench.ts +++ b/packages/pbkdf2/pbkdf2.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { deriveKey } from "./pbkdf2"; +import { deriveKey } from "./pbkdf2.js"; import { SHA256 } from "@stablelib/sha256"; import { SHA512 } from "@stablelib/sha512"; import { SHA3512 } from "@stablelib/sha3"; diff --git a/packages/pbkdf2/pbkdf2.test.ts b/packages/pbkdf2/pbkdf2.test.ts index 9578b3d..9260daf 100644 --- a/packages/pbkdf2/pbkdf2.test.ts +++ b/packages/pbkdf2/pbkdf2.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { deriveKey } from "./pbkdf2"; +import { deriveKey } from "./pbkdf2.js"; import { SHA256 } from "@stablelib/sha256"; import { SHA224 } from "@stablelib/sha224"; import { SHA512 } from "@stablelib/sha512"; diff --git a/packages/poly1305/poly1305.bench.ts b/packages/poly1305/poly1305.bench.ts index 4d1599e..40d807c 100644 --- a/packages/poly1305/poly1305.bench.ts +++ b/packages/poly1305/poly1305.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { oneTimeAuth } from "./poly1305"; +import { oneTimeAuth } from "./poly1305.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf8192 = byteSeq(8192); diff --git a/packages/poly1305/poly1305.test.ts b/packages/poly1305/poly1305.test.ts index be7299b..884a34a 100644 --- a/packages/poly1305/poly1305.test.ts +++ b/packages/poly1305/poly1305.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest'; import { encode, decode } from "@stablelib/hex"; import { concat } from "@stablelib/bytes"; -import { oneTimeAuth, Poly1305 } from "./poly1305"; +import { oneTimeAuth, Poly1305 } from "./poly1305.js"; const testVectors = [ { diff --git a/packages/random/random.test.ts b/packages/random/random.test.ts index 5853ff1..1cfda61 100644 --- a/packages/random/random.test.ts +++ b/packages/random/random.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest'; import { randomBytes, randomUint32, randomString, randomStringForEntropy -} from "./random"; +} from "./random.js"; describe("randomBytes", () => { it("should generate random bytes", () => { diff --git a/packages/random/random.ts b/packages/random/random.ts index b358ea1..360c2f0 100644 --- a/packages/random/random.ts +++ b/packages/random/random.ts @@ -6,12 +6,12 @@ * cryptographically secure random byte generator. */ -import type { RandomSource } from "./source"; -import { SystemRandomSource } from "./source/system"; +import type { RandomSource } from "./source/index.js"; +import { SystemRandomSource } from "./source/system.js"; import { readUint32LE } from "@stablelib/binary"; import { wipe } from "@stablelib/wipe"; -export { RandomSource } from "./source"; +export type { RandomSource } from "./source/index.js"; export const defaultRandomSource = new SystemRandomSource(); diff --git a/packages/random/source/system.test.ts b/packages/random/source/system.test.ts index 2ec421c..846ff99 100644 --- a/packages/random/source/system.test.ts +++ b/packages/random/source/system.test.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SystemRandomSource } from "./system"; +import { SystemRandomSource } from "./system.js"; describe("SystemRandomSource.randomBytes", () => { diff --git a/packages/random/source/system.ts b/packages/random/source/system.ts index ddd000f..727af0c 100644 --- a/packages/random/source/system.ts +++ b/packages/random/source/system.ts @@ -1,7 +1,7 @@ // Copyright (C) 2024 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { RandomSource } from "./"; +import type { RandomSource } from "./index.js"; const QUOTA = 65536; diff --git a/packages/salsa20/salsa20.bench.ts b/packages/salsa20/salsa20.bench.ts index 6c043fb..9c97b0c 100644 --- a/packages/salsa20/salsa20.bench.ts +++ b/packages/salsa20/salsa20.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { streamXOR } from "./salsa20"; +import { streamXOR } from "./salsa20.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf8192 = byteSeq(8192); diff --git a/packages/salsa20/salsa20.test.ts b/packages/salsa20/salsa20.test.ts index 73248ad..361df5b 100644 --- a/packages/salsa20/salsa20.test.ts +++ b/packages/salsa20/salsa20.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { streamXOR, stream } from "./salsa20"; +import { streamXOR, stream } from "./salsa20.js"; import { encode, decode } from "@stablelib/hex"; function seq(len: number): Uint8Array { diff --git a/packages/scrypt/scrypt.bench.ts b/packages/scrypt/scrypt.bench.ts index 26f14cd..7050520 100644 --- a/packages/scrypt/scrypt.bench.ts +++ b/packages/scrypt/scrypt.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { deriveKey, deriveKeyNonBlocking, Scrypt } from "./scrypt"; +import { deriveKey, deriveKeyNonBlocking, Scrypt } from "./scrypt.js"; import { benchmarkPromise, benchmark, report, byteSeq } from "@stablelib/benchmark"; (async () => { diff --git a/packages/scrypt/scrypt.test.ts b/packages/scrypt/scrypt.test.ts index b17e2ef..e4ddd12 100644 --- a/packages/scrypt/scrypt.test.ts +++ b/packages/scrypt/scrypt.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest'; import { encode as encodeBase64 } from "@stablelib/base64"; import { encode as encodeUTF8 } from "@stablelib/utf8"; -import { deriveKey, deriveKeyNonBlocking } from "./scrypt"; +import { deriveKey, deriveKeyNonBlocking } from "./scrypt.js"; const vectors = [ { diff --git a/packages/sha224/sha224.test.ts b/packages/sha224/sha224.test.ts index 57bf3fb..d036480 100644 --- a/packages/sha224/sha224.test.ts +++ b/packages/sha224/sha224.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SHA224, hash } from "./sha224"; +import { SHA224, hash } from "./sha224.js"; import { encode } from "@stablelib/base64"; const vectors = [ diff --git a/packages/sha256/sha256.bench.ts b/packages/sha256/sha256.bench.ts index 992905e..ecc0260 100644 --- a/packages/sha256/sha256.bench.ts +++ b/packages/sha256/sha256.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { hash } from "./sha256"; +import { hash } from "./sha256.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf1M = byteSeq(1024 << 10); diff --git a/packages/sha256/sha256.test.ts b/packages/sha256/sha256.test.ts index 0dd38c8..5d430a1 100644 --- a/packages/sha256/sha256.test.ts +++ b/packages/sha256/sha256.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SHA256, hash } from "./sha256"; +import { SHA256, hash } from "./sha256.js"; import { encode } from "@stablelib/base64"; const vectors = [ diff --git a/packages/sha3/sha3.bench.ts b/packages/sha3/sha3.bench.ts index 5dbea0d..0143014 100644 --- a/packages/sha3/sha3.bench.ts +++ b/packages/sha3/sha3.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { hash256 } from "./sha3"; +import { hash256 } from "./sha3.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf1M = byteSeq(1024 << 10); diff --git a/packages/sha3/sha3.test.ts b/packages/sha3/sha3.test.ts index 174b31e..43d0c6e 100644 --- a/packages/sha3/sha3.test.ts +++ b/packages/sha3/sha3.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SHA3, SHA3256, SHAKE128, SHAKE256 } from "./sha3"; +import { SHA3, SHA3256, SHAKE128, SHAKE256 } from "./sha3.js"; import { encode } from "@stablelib/base64"; const vectors256 = [ diff --git a/packages/sha384/sha384.test.ts b/packages/sha384/sha384.test.ts index f6e30a4..e23f6a0 100644 --- a/packages/sha384/sha384.test.ts +++ b/packages/sha384/sha384.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SHA384, hash } from "./sha384"; +import { SHA384, hash } from "./sha384.js"; import { encode } from "@stablelib/base64"; const vectors = [ diff --git a/packages/sha512/sha512.bench.ts b/packages/sha512/sha512.bench.ts index 237d8ae..c52f620 100644 --- a/packages/sha512/sha512.bench.ts +++ b/packages/sha512/sha512.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { hash } from "./sha512"; +import { hash } from "./sha512.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; let buf1M = byteSeq(1024 << 10); diff --git a/packages/sha512/sha512.test.ts b/packages/sha512/sha512.test.ts index a3d1f79..93f2b74 100644 --- a/packages/sha512/sha512.test.ts +++ b/packages/sha512/sha512.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SHA512, hash } from "./sha512"; +import { SHA512, hash } from "./sha512.js"; import { encode } from "@stablelib/base64"; const vectors = [ diff --git a/packages/sha512_256/sha512_256.test.ts b/packages/sha512_256/sha512_256.test.ts index 4af2b42..7168bbc 100644 --- a/packages/sha512_256/sha512_256.test.ts +++ b/packages/sha512_256/sha512_256.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SHA512_256, hash } from "./sha512_256"; +import { SHA512_256, hash } from "./sha512_256.js"; import { encode } from "@stablelib/base64"; const vectors = [ diff --git a/packages/siv/siv.bench.ts b/packages/siv/siv.bench.ts index 366ef57..582496b 100644 --- a/packages/siv/siv.bench.ts +++ b/packages/siv/siv.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2017 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { SIV } from "./siv"; +import { SIV } from "./siv.js"; import { AES } from "@stablelib/aes"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; diff --git a/packages/siv/siv.test.ts b/packages/siv/siv.test.ts index 2b275e3..4f8c23a 100644 --- a/packages/siv/siv.test.ts +++ b/packages/siv/siv.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { SIV } from "./siv"; +import { SIV } from "./siv.js"; import { AES } from "@stablelib/aes"; import { encode, decode } from "@stablelib/hex"; import { byteSeq } from "@stablelib/benchmark"; diff --git a/packages/snappy/snappy.bench.ts b/packages/snappy/snappy.bench.ts index 46a5681..a24a8c5 100644 --- a/packages/snappy/snappy.bench.ts +++ b/packages/snappy/snappy.bench.ts @@ -2,10 +2,10 @@ // MIT License. See LICENSE file for details. import { benchmark, report } from "@stablelib/benchmark"; -import { compress, maxCompressedLength } from "./compress"; -import { decompress } from "./decompress"; +import { compress, maxCompressedLength } from "./compress.js"; +import { decompress } from "./decompress.js"; import * as zlib from "zlib"; -import data from "./compress.test-data"; +import data from "./compress.test-data.js"; const compressedData = compress(data); diff --git a/packages/snappy/snappy.test.ts b/packages/snappy/snappy.test.ts index 2cce9c6..35ef05a 100644 --- a/packages/snappy/snappy.test.ts +++ b/packages/snappy/snappy.test.ts @@ -5,9 +5,9 @@ import { describe, expect, it } from 'vitest'; import * as utf8 from "@stablelib/utf8"; import * as hex from "@stablelib/hex"; import { byteSeq } from "@stablelib/benchmark"; -import { compress } from "./compress"; -import { decompress } from "./decompress"; -import bigTestData from "./compress.test-data"; +import { compress } from "./compress.js"; +import { decompress } from "./decompress.js"; +import bigTestData from "./compress.test-data.js"; const smallTestData = utf8.encode("aaaaaaaaaabbabbbabbbabbabccccccccbbbbbbbaaaaaaabbabbabba"); // generated with github.com/golang/snappy diff --git a/packages/snappy/snappy.ts b/packages/snappy/snappy.ts index 1a13994..e535fd0 100644 --- a/packages/snappy/snappy.ts +++ b/packages/snappy/snappy.ts @@ -11,5 +11,5 @@ * Package snappy implements Snappy compression and decompression. */ -export * from "./compress"; -export * from "./decompress"; +export * from "./compress.js"; +export * from "./decompress.js"; diff --git a/packages/tss/tss.bench.ts b/packages/tss/tss.bench.ts index 4455e14..5400bb2 100644 --- a/packages/tss/tss.bench.ts +++ b/packages/tss/tss.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { splitRaw, combineRaw, split, combine } from "./tss"; +import { splitRaw, combineRaw, split, combine } from "./tss.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const secret = byteSeq(32); diff --git a/packages/tss/tss.test.ts b/packages/tss/tss.test.ts index a3e3d2b..84a10ef 100644 --- a/packages/tss/tss.test.ts +++ b/packages/tss/tss.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { split, combine, combineRaw } from "./tss"; +import { split, combine, combineRaw } from "./tss.js"; import { decode } from "@stablelib/hex"; describe("tss", () => { diff --git a/packages/utf8/utf8.bench.ts b/packages/utf8/utf8.bench.ts index 9b914a6..c78cbab 100644 --- a/packages/utf8/utf8.bench.ts +++ b/packages/utf8/utf8.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { encode, decode } from "./utf8"; +import { encode, decode } from "./utf8.js"; import { benchmark, report } from "@stablelib/benchmark"; const text = `— Еh bien, mon prince. Gênes et Lucques ne sont plus que des apanages, diff --git a/packages/utf8/utf8.test.ts b/packages/utf8/utf8.test.ts index ce6142b..3c0b962 100644 --- a/packages/utf8/utf8.test.ts +++ b/packages/utf8/utf8.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'; import * as hex from "@stablelib/hex"; -import { encode, decode } from "./utf8"; +import { encode, decode } from "./utf8.js"; describe("utf8", () => { it("should encode and decode strings", () => { diff --git a/packages/uuid/uuid.test.ts b/packages/uuid/uuid.test.ts index db44d05..781a1a0 100644 --- a/packages/uuid/uuid.test.ts +++ b/packages/uuid/uuid.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { uuid } from "./uuid"; +import { uuid } from "./uuid.js"; describe("uuid", () => { it("should generate UUID", () => { diff --git a/packages/wipe/wipe.test.ts b/packages/wipe/wipe.test.ts index 2432cbe..4cc9806 100644 --- a/packages/wipe/wipe.test.ts +++ b/packages/wipe/wipe.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { wipe } from "./wipe"; +import { wipe } from "./wipe.js"; describe("wipe", () => { it("should wipe bytes", () => { diff --git a/packages/x25519-session/keyagreement.ts b/packages/x25519-session/keyagreement.ts index d5e4561..afc1b02 100644 --- a/packages/x25519-session/keyagreement.ts +++ b/packages/x25519-session/keyagreement.ts @@ -12,8 +12,8 @@ import { PUBLIC_KEY_LENGTH, SHARED_KEY_LENGTH, generateKeyPairFromSeed, sharedKey } from "@stablelib/x25519"; -import type { SessionKeys} from "./x25519-session"; -import { clientSessionKeysFromSharedKey, serverSessionKeysFromSharedKey } from "./x25519-session"; +import type { SessionKeys} from "./x25519-session.js"; +import { clientSessionKeysFromSharedKey, serverSessionKeysFromSharedKey } from "./x25519-session.js"; /** Constants for key agreement */ export const OFFER_MESSAGE_LENGTH = PUBLIC_KEY_LENGTH; diff --git a/packages/x25519-session/x25519-session.bench.ts b/packages/x25519-session/x25519-session.bench.ts index 20e39d7..14c7dd2 100644 --- a/packages/x25519-session/x25519-session.bench.ts +++ b/packages/x25519-session/x25519-session.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { X25519Session } from "./keyagreement"; +import { X25519Session } from "./keyagreement.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const r = new Uint8Array(32); r[0] = 1; diff --git a/packages/x25519-session/x25519-session.test.ts b/packages/x25519-session/x25519-session.test.ts index 6d8f6d9..e5424e4 100644 --- a/packages/x25519-session/x25519-session.test.ts +++ b/packages/x25519-session/x25519-session.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest'; import type { RandomSource } from "@stablelib/random"; import { encode } from "@stablelib/hex"; -import { X25519Session } from './keyagreement'; +import { X25519Session } from './keyagreement.js'; // For testing with generated test vectors, instead of proper PRNG // use the deterministic generator that generates byte sequences diff --git a/packages/x25519-session/x25519-session.ts b/packages/x25519-session/x25519-session.ts index 0f1bba4..8927cf8 100644 --- a/packages/x25519-session/x25519-session.ts +++ b/packages/x25519-session/x25519-session.ts @@ -9,7 +9,7 @@ import { BLAKE2b } from "@stablelib/blake2b"; import type { Hash } from "@stablelib/hash"; import type { KeyPair } from "@stablelib/x25519"; import { sharedKey as deriveSharedKey } from "@stablelib/x25519"; -export { X25519Session } from "./keyagreement"; +export { X25519Session } from "./keyagreement.js"; const SESSION_KEY_LENGTH = 32; diff --git a/packages/x25519/keyagreement.ts b/packages/x25519/keyagreement.ts index 4b6eb41..8c0d26f 100644 --- a/packages/x25519/keyagreement.ts +++ b/packages/x25519/keyagreement.ts @@ -5,7 +5,7 @@ import type { KeyAgreement } from "@stablelib/keyagreement"; import type { RandomSource } from "@stablelib/random"; import { randomBytes } from "@stablelib/random"; import { wipe } from "@stablelib/wipe"; -import { PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, SHARED_KEY_LENGTH, generateKeyPairFromSeed, sharedKey } from "./x25519"; +import { PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, SHARED_KEY_LENGTH, generateKeyPairFromSeed, sharedKey } from "./x25519.js"; /** Constants for key agreement */ export const OFFER_MESSAGE_LENGTH = PUBLIC_KEY_LENGTH; diff --git a/packages/x25519/x25519.bench.ts b/packages/x25519/x25519.bench.ts index e8f5e10..973bd19 100644 --- a/packages/x25519/x25519.bench.ts +++ b/packages/x25519/x25519.bench.ts @@ -1,8 +1,8 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { scalarMultBase } from "./x25519"; -import { X25519KeyAgreement } from "./keyagreement"; +import { scalarMultBase } from "./x25519.js"; +import { X25519KeyAgreement } from "./keyagreement.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const r = new Uint8Array(32); r[0] = 1; diff --git a/packages/x25519/x25519.test.ts b/packages/x25519/x25519.test.ts index aad7318..ed65b48 100644 --- a/packages/x25519/x25519.test.ts +++ b/packages/x25519/x25519.test.ts @@ -6,8 +6,8 @@ import type { RandomSource } from "@stablelib/random"; import { encode, decode } from "@stablelib/hex"; import { scalarMultBase, sharedKey, generateKeyPair -} from "./x25519"; -import { X25519KeyAgreement } from './keyagreement'; +} from "./x25519.js"; +import { X25519KeyAgreement } from './keyagreement.js'; describe("x25519.scalarMultBase", () => { it("should return correct result", () => { diff --git a/packages/xchacha20/xchacha20.bench.ts b/packages/xchacha20/xchacha20.bench.ts index e6dd68d..48e7aa7 100644 --- a/packages/xchacha20/xchacha20.bench.ts +++ b/packages/xchacha20/xchacha20.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { streamXOR } from "./xchacha20"; +import { streamXOR } from "./xchacha20.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf16K = byteSeq(16 << 10); diff --git a/packages/xchacha20/xchacha20.test.ts b/packages/xchacha20/xchacha20.test.ts index 16d6842..4ce50a1 100644 --- a/packages/xchacha20/xchacha20.test.ts +++ b/packages/xchacha20/xchacha20.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { hchacha, stream, streamXOR } from "./xchacha20"; +import { hchacha, stream, streamXOR } from "./xchacha20.js"; import { encode, decode } from "@stablelib/hex"; // test taken from draft-arciszewski-xchacha-03 section 2.2.1 diff --git a/packages/xchacha20poly1305/xchacha20poly1305.bench.ts b/packages/xchacha20poly1305/xchacha20poly1305.bench.ts index f2e241d..23da92f 100644 --- a/packages/xchacha20poly1305/xchacha20poly1305.bench.ts +++ b/packages/xchacha20poly1305/xchacha20poly1305.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { XChaCha20Poly1305 } from "./xchacha20poly1305"; +import { XChaCha20Poly1305 } from "./xchacha20poly1305.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf8192 = byteSeq(8192); diff --git a/packages/xchacha20poly1305/xchacha20poly1305.test.ts b/packages/xchacha20poly1305/xchacha20poly1305.test.ts index 0f7e9a3..4993402 100644 --- a/packages/xchacha20poly1305/xchacha20poly1305.test.ts +++ b/packages/xchacha20poly1305/xchacha20poly1305.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { XChaCha20Poly1305 } from "./xchacha20poly1305"; +import { XChaCha20Poly1305 } from "./xchacha20poly1305.js"; import { encode, decode } from "@stablelib/hex"; const testVectors = [ diff --git a/packages/xsalsa20/xsalsa20.bench.ts b/packages/xsalsa20/xsalsa20.bench.ts index aceea7c..0e723d5 100644 --- a/packages/xsalsa20/xsalsa20.bench.ts +++ b/packages/xsalsa20/xsalsa20.bench.ts @@ -1,7 +1,7 @@ // Copyright (C) 2016 Dmitry Chestnykh // MIT License. See LICENSE file for details. -import { streamXOR } from "./xsalsa20"; +import { streamXOR } from "./xsalsa20.js"; import { benchmark, report, byteSeq } from "@stablelib/benchmark"; const buf8192 = byteSeq(8192); diff --git a/packages/xsalsa20/xsalsa20.test.ts b/packages/xsalsa20/xsalsa20.test.ts index 680ac3d..e81d704 100644 --- a/packages/xsalsa20/xsalsa20.test.ts +++ b/packages/xsalsa20/xsalsa20.test.ts @@ -2,7 +2,7 @@ // MIT License. See LICENSE file for details. import { describe, expect, it } from 'vitest'; -import { stream, hsalsa } from "./xsalsa20"; +import { stream, hsalsa } from "./xsalsa20.js"; import { encode, decode } from "@stablelib/hex"; describe("xsalsa20.hsalsa", () => {