taler-wallet-embedded: add argon2id test
This commit is contained in:
parent
0f6310bba4
commit
0ac5dba088
@ -47,6 +47,9 @@ import {
|
|||||||
getRecoveryStartState,
|
getRecoveryStartState,
|
||||||
ReducerState,
|
ReducerState,
|
||||||
} from "@gnu-taler/anastasis-core";
|
} from "@gnu-taler/anastasis-core";
|
||||||
|
import {
|
||||||
|
userIdentifierDerive,
|
||||||
|
} from "@gnu-taler/anastasis-core/lib/crypto.js";
|
||||||
|
|
||||||
setGlobalLogLevelFromString("trace");
|
setGlobalLogLevelFromString("trace");
|
||||||
|
|
||||||
@ -307,7 +310,31 @@ export async function testWithLocal() {
|
|||||||
w.wallet.stop();
|
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
|
// @ts-ignore
|
||||||
globalThis.testWithGv = testWithGv;
|
globalThis.testWithGv = testWithGv;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
globalThis.testWithLocal = testWithLocal;
|
globalThis.testWithLocal = testWithLocal;
|
||||||
|
// @ts-ignore
|
||||||
|
globalThis.testArgon2id = testArgon2id;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user