-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Dear SQIsign team,
My name is LeeJ, and I am working on implementing and optimizing the SQIsign reference code on an Arm architecture. While checking the code's correctness, I've come across an issue where the test suite reports "All tests passed!" even when some test cases fail.
Bug
In src/signature/ref/lvlx/test/test_signature.c, the test script reports "All tests passed!" even when certain test cases fail.
Solution
We should change the value of res to 0, which prevents the main function from printing "All tests passed!" if any cases fail.
int test_sqisign(int repeat){
int res = 1;
public_key_t pk;
secret_key_t sk;
signature_t sig;
const unsigned char msg[32] = { 0 };
public_key_init(&pk);
secret_key_init(&sk);
printf("\n\nTesting signatures\n");
for (int i = 0; i < repeat; ++i) {
printf("#%d \n", i);
protocols_keygen(&pk, &sk);
protocols_sign(&sig, &pk, &sk, msg, 32);
int check = protocols_verify(&sig, &pk, msg, 32);
if (!check) {
// Here
res = 0;
printf("verif failed ! \n");
}
}
public_key_finalize(&pk);
secret_key_finalize(&sk);
return res;
}
Additional question
I've been trying to quickly check the correctness of my Level 1 code. I've tried running make test SQIsign_lvl1_SELFTEST, but this seems to take an amount of time. I also attempted to run the test_signature.c file directly, but it seems to not guarantee full correctness.
Could you please provide some guidance on a faster or more direct method to check the correctness of the Level 1 signature implementation?