feat: Added tests for invaild mrz, signature and econtent.

This commit is contained in:
0xvikasrushi
2024-07-28 21:14:27 +00:00
parent 33fa8c7bf1
commit adf661f801
2 changed files with 78 additions and 5 deletions

View File

@@ -64,8 +64,6 @@ export function getLeaf(pubkey: any, i?: number): bigint {
sigAlgFormattedForCircuit === 'ecdsa_with_SHA512'
) {
try {
// this will be replaced by just X and Y or pubkey in publicKeyQ
if (!pubkey.publicKeyQ) {
throw new Error('publicKeyQ is undefined');
}
@@ -79,12 +77,9 @@ export function getLeaf(pubkey: any, i?: number): bigint {
let qx = BigintToArray(43, 6, BigInt(hexToDecimal(x)));
let qy = BigintToArray(43, 6, BigInt(hexToDecimal(y)));
// bigint_to_array();
let poseidon_hasher_dsc_modules_x = poseidon6(qx);
let poseidon_hasher_dsc_modules_y = poseidon6(qy);
console.log(SignatureAlgorithm[sigAlgFormattedForCircuit], 's');
// ! @TODO check if this is correct
return poseidon3([
SignatureAlgorithm[sigAlgFormattedForCircuit],
poseidon_hasher_dsc_modules_x, // pub.x