embedded: expose anastasis reducer for testing

This commit is contained in:
Florian Dold 2023-08-09 19:43:11 +02:00
parent d33b70b069
commit e6c0689806
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -49,9 +49,7 @@ import {
mergeDiscoveryAggregate,
ReducerState,
} from "@gnu-taler/anastasis-core";
import {
userIdentifierDerive,
} from "@gnu-taler/anastasis-core/lib/crypto.js";
import { userIdentifierDerive } from "@gnu-taler/anastasis-core/lib/crypto.js";
setGlobalLogLevelFromString("trace");
@ -338,10 +336,12 @@ export async function testArgon2id() {
"YS45R6CGJV84K1NN7T14ZBCPVTZ6H15XJSM1FV0R748MHPV82SM0126EBZKBAAGCR34Q9AFKPEW1HRT2Q9GQ5JRA3642AB571DKZS18",
};
if (await userIdentifierDerive(
if (
(await userIdentifierDerive(
userIdVector.input_id_data,
userIdVector.input_server_salt,
) != userIdVector.output_id) {
)) != userIdVector.output_id
) {
throw Error("argon2id is not working!");
}
@ -354,4 +354,5 @@ globalThis.testWithGv = testWithGv;
globalThis.testWithLocal = testWithLocal;
// @ts-ignore
globalThis.testArgon2id = testArgon2id;
// @ts-ignore
globalThis.testReduceAction = reduceAction;