2021-10-07 12:01:40 +02:00
|
|
|
import test from "ava";
|
2021-10-07 15:09:40 +02:00
|
|
|
import { userIdentifierDerive } from "./crypto.js";
|
2021-10-07 12:01:40 +02:00
|
|
|
|
|
|
|
// Vector generated with taler-anastasis-tvg
|
|
|
|
const userIdVector = {
|
|
|
|
input_id_data: {
|
|
|
|
name: "Fleabag",
|
|
|
|
ssn: "AB123",
|
|
|
|
},
|
|
|
|
input_server_salt: "FZ48EFS7WS3R2ZR4V53A3GFFY4",
|
|
|
|
output_id:
|
|
|
|
"YS45R6CGJV84K1NN7T14ZBCPVTZ6H15XJSM1FV0R748MHPV82SM0126EBZKBAAGCR34Q9AFKPEW1HRT2Q9GQ5JRA3642AB571DKZS18",
|
|
|
|
};
|
|
|
|
|
|
|
|
test("user ID derivation", async (t) => {
|
2021-10-07 15:09:40 +02:00
|
|
|
const res = await userIdentifierDerive(
|
|
|
|
userIdVector.input_id_data,
|
|
|
|
userIdVector.input_server_salt,
|
|
|
|
);
|
|
|
|
t.is(res, userIdVector.output_id);
|
2021-10-07 12:01:40 +02:00
|
|
|
});
|