aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-07-05 12:16:41 -0600
committerIván Ávalos <avalos@disroot.org>2023-07-26 12:09:17 -0600
commit0ac5dba0889fa6443b93faf6051b96e5ddb7a6ab (patch)
treee6811a2b1d018913e0076a1a8fca108b75846db8
parent0f6310bba423dc910a89693509038b62c85f35b4 (diff)
taler-wallet-embedded: add argon2id testv0.9.3-dev.18
-rw-r--r--packages/taler-wallet-embedded/src/wallet-qjs.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts b/packages/taler-wallet-embedded/src/wallet-qjs.ts
index 0a252f514..04efb458a 100644
--- a/packages/taler-wallet-embedded/src/wallet-qjs.ts
+++ b/packages/taler-wallet-embedded/src/wallet-qjs.ts
@@ -47,6 +47,9 @@ import {
getRecoveryStartState,
ReducerState,
} from "@gnu-taler/anastasis-core";
+import {
+ userIdentifierDerive,
+} from "@gnu-taler/anastasis-core/lib/crypto.js";
setGlobalLogLevelFromString("trace");
@@ -307,7 +310,31 @@ export async function testWithLocal() {
w.wallet.stop();
}
+export async function testArgon2id() {
+ const userIdVector = {
+ input_id_data: {
+ name: "Fleabag",
+ ssn: "AB123",
+ },
+ input_server_salt: "FZ48EFS7WS3R2ZR4V53A3GFFY4",
+ output_id:
+ "YS45R6CGJV84K1NN7T14ZBCPVTZ6H15XJSM1FV0R748MHPV82SM0126EBZKBAAGCR34Q9AFKPEW1HRT2Q9GQ5JRA3642AB571DKZS18",
+ };
+
+ if (await userIdentifierDerive(
+ userIdVector.input_id_data,
+ userIdVector.input_server_salt,
+ ) != userIdVector.output_id) {
+ throw Error("argon2id is not working!");
+ }
+
+ console.log("argon2id is working!");
+}
+
// @ts-ignore
globalThis.testWithGv = testWithGv;
// @ts-ignore
globalThis.testWithLocal = testWithLocal;
+// @ts-ignore
+globalThis.testArgon2id = testArgon2id;
+