Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
"license": "MIT",
"packageManager": "pnpm@10.22.0",
"dependencies": {
"@noble/ciphers": "^1.2.1",
"@noble/curves": "^1.8.2",
"@noble/hashes": "^1.7.2"
"@noble/ciphers": "^2.0.1",
"@noble/curves": "^2.0.1",
"@noble/hashes": "^2.0.1"
},
"devDependencies": {
"@types/libsodium-wrappers": "^0.7.14",
"libsodium-wrappers": "^0.7.15",
"prettier": "^3.5.3",
"typescript": "^5.8.3",
"vitest": "^3.1.1"
"prettier": "^3.6.2",
"typescript": "^5.9.3",
"vitest": "^4.0.9"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
809 changes: 394 additions & 415 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/crypto-box-easy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { hsalsa, secretbox } from "@noble/ciphers/salsa";
import { x25519 } from "@noble/curves/ed25519";
import { u32, u8 } from "@noble/hashes/utils";
import { hsalsa, secretbox } from "@noble/ciphers/salsa.js";
import { x25519 } from "@noble/curves/ed25519.js";
import { u32, u8 } from "@noble/hashes/utils.js";

type CryptoBoxEasyParams = {
message: Uint8Array;
Expand Down
4 changes: 2 additions & 2 deletions src/crypto-box-key-pair.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { x25519 } from "@noble/curves/ed25519";
import { randomBytes } from "@noble/hashes/utils";
import { x25519 } from "@noble/curves/ed25519.js";
import { randomBytes } from "@noble/hashes/utils.js";
import { crypto_box_SECRETKEYBYTES } from "./constants.js";
import type { KeyPair } from "./types.js";

Expand Down
6 changes: 3 additions & 3 deletions src/crypto-box-open-easy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { hsalsa, secretbox } from "@noble/ciphers/salsa";
import { x25519 } from "@noble/curves/ed25519";
import { u32, u8 } from "@noble/hashes/utils";
import { hsalsa, secretbox } from "@noble/ciphers/salsa.js";
import { x25519 } from "@noble/curves/ed25519.js";
import { u32, u8 } from "@noble/hashes/utils.js";

type CryptoBoxOpenEasyParams = {
ciphertext: Uint8Array;
Expand Down
2 changes: 1 addition & 1 deletion src/crypto-box-seal-open.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { blake2b } from "@noble/hashes/blake2b";
import { blake2b } from "@noble/hashes/blake2.js";
import {
crypto_box_NONCEBYTES,
crypto_box_PUBLICKEYBYTES,
Expand Down
2 changes: 1 addition & 1 deletion src/crypto-box-seal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { blake2b } from "@noble/hashes/blake2b";
import { blake2b } from "@noble/hashes/blake2.js";
import { crypto_box_NONCEBYTES } from "./constants.js";
import { cryptoBoxEasy } from "./crypto-box-easy.js";
import { cryptoBoxKeyPair } from "./crypto-box-key-pair.js";
Expand Down
2 changes: 1 addition & 1 deletion src/crypto-sign-detached.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ed25519 } from "@noble/curves/ed25519";
import { ed25519 } from "@noble/curves/ed25519.js";

type CryptoSignDetachedParams = {
message: Uint8Array;
Expand Down
4 changes: 2 additions & 2 deletions src/crypto-sign-key-pair.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ed25519 } from "@noble/curves/ed25519";
import { ed25519 } from "@noble/curves/ed25519.js";
import type { KeyPair } from "./types.js";

export function cryptoSignKeyPair(): KeyPair {
const privateKey = ed25519.utils.randomPrivateKey();
const privateKey = ed25519.utils.randomSecretKey();
const publicKey = ed25519.getPublicKey(privateKey);
const sodiumPrivateKey = new Uint8Array([...privateKey, ...publicKey]);
return { keyType: "ed25519", publicKey, privateKey: sodiumPrivateKey };
Expand Down
2 changes: 1 addition & 1 deletion src/crypto-sign-verify-detached.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ed25519 } from "@noble/curves/ed25519";
import { ed25519 } from "@noble/curves/ed25519.js";

type CryptoSignVerifyDetachedParams = {
signature: Uint8Array;
Expand Down