summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/taler-crypto.ts
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-07-02 23:01:47 -0600
committerIván Ávalos <avalos@disroot.org>2023-07-26 12:09:17 -0600
commite0f32dc8996f684bf9447bf88c13c35f4e59d94f (patch)
treee8f00ed7bc92b5d0f4e755b207db4b5f66318a31 /packages/taler-util/src/taler-crypto.ts
parentef51ba983f49b32a04bb8460f24f720f7952f306 (diff)
downloadwallet-core-e0f32dc8996f684bf9447bf88c13c35f4e59d94f.tar.gz
wallet-core-e0f32dc8996f684bf9447bf88c13c35f4e59d94f.tar.bz2
wallet-core-e0f32dc8996f684bf9447bf88c13c35f4e59d94f.zip
taler-util: import hash-wasm only when building for Node
Diffstat (limited to 'packages/taler-util/src/taler-crypto.ts')
-rw-r--r--packages/taler-util/src/taler-crypto.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/packages/taler-util/src/taler-crypto.ts b/packages/taler-util/src/taler-crypto.ts
index cabe2b7d0..408b7e7c2 100644
--- a/packages/taler-util/src/taler-crypto.ts
+++ b/packages/taler-util/src/taler-crypto.ts
@@ -24,7 +24,7 @@
import * as nacl from "./nacl-fast.js";
import { hmacSha256, hmacSha512 } from "./kdf.js";
import bigint from "big-integer";
-import { argon2id } from "hash-wasm";
+import * as argon2 from "./argon2.js";
import {
CoinEnvelope,
CoinPublicKeyString,
@@ -277,15 +277,13 @@ export async function hashArgon2id(
hashLength,
);
}
- return await argon2id({
- password: password,
- salt: salt,
- iterations: iterations,
- memorySize: memorySize,
- hashLength: hashLength,
- parallelism: 1,
- outputType: "binary",
- });
+ return await argon2.hashArgon2id(
+ password,
+ salt,
+ iterations,
+ memorySize,
+ hashLength,
+ );
}
export function eddsaGetPublic(eddsaPriv: Uint8Array): Uint8Array {