embedded: expose anastasis reducer for testing
This commit is contained in:
parent
d33b70b069
commit
e6c0689806
@ -49,9 +49,7 @@ import {
|
|||||||
mergeDiscoveryAggregate,
|
mergeDiscoveryAggregate,
|
||||||
ReducerState,
|
ReducerState,
|
||||||
} from "@gnu-taler/anastasis-core";
|
} from "@gnu-taler/anastasis-core";
|
||||||
import {
|
import { userIdentifierDerive } from "@gnu-taler/anastasis-core/lib/crypto.js";
|
||||||
userIdentifierDerive,
|
|
||||||
} from "@gnu-taler/anastasis-core/lib/crypto.js";
|
|
||||||
|
|
||||||
setGlobalLogLevelFromString("trace");
|
setGlobalLogLevelFromString("trace");
|
||||||
|
|
||||||
@ -335,13 +333,15 @@ export async function testArgon2id() {
|
|||||||
},
|
},
|
||||||
input_server_salt: "FZ48EFS7WS3R2ZR4V53A3GFFY4",
|
input_server_salt: "FZ48EFS7WS3R2ZR4V53A3GFFY4",
|
||||||
output_id:
|
output_id:
|
||||||
"YS45R6CGJV84K1NN7T14ZBCPVTZ6H15XJSM1FV0R748MHPV82SM0126EBZKBAAGCR34Q9AFKPEW1HRT2Q9GQ5JRA3642AB571DKZS18",
|
"YS45R6CGJV84K1NN7T14ZBCPVTZ6H15XJSM1FV0R748MHPV82SM0126EBZKBAAGCR34Q9AFKPEW1HRT2Q9GQ5JRA3642AB571DKZS18",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (await userIdentifierDerive(
|
if (
|
||||||
userIdVector.input_id_data,
|
(await userIdentifierDerive(
|
||||||
userIdVector.input_server_salt,
|
userIdVector.input_id_data,
|
||||||
) != userIdVector.output_id) {
|
userIdVector.input_server_salt,
|
||||||
|
)) != userIdVector.output_id
|
||||||
|
) {
|
||||||
throw Error("argon2id is not working!");
|
throw Error("argon2id is not working!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,4 +354,5 @@ globalThis.testWithGv = testWithGv;
|
|||||||
globalThis.testWithLocal = testWithLocal;
|
globalThis.testWithLocal = testWithLocal;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
globalThis.testArgon2id = testArgon2id;
|
globalThis.testArgon2id = testArgon2id;
|
||||||
|
// @ts-ignore
|
||||||
|
globalThis.testReduceAction = reduceAction;
|
||||||
|
Loading…
Reference in New Issue
Block a user