mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
More test + lcov exclusions
This commit is contained in:
@@ -1057,6 +1057,7 @@ int main(void)
|
||||
unsigned long long smlen;
|
||||
unsigned long long mlen;
|
||||
unsigned int i;
|
||||
unsigned int j;
|
||||
|
||||
for (i = 0U; i < (sizeof test_data) / (sizeof test_data[0]); i++) {
|
||||
memcpy(skpk, test_data[i].sk, crypto_sign_SEEDBYTES);
|
||||
@@ -1113,6 +1114,25 @@ int main(void)
|
||||
}
|
||||
printf("%u tests\n", i);
|
||||
|
||||
i--;
|
||||
for (j = 1U; j < 8U; j++) {
|
||||
sig[63] ^= (j << 5);
|
||||
if (crypto_sign_verify_detached(sig,
|
||||
(const unsigned char *)test_data[i].m,
|
||||
i, test_data[i].pk) != -1) {
|
||||
printf("detached signature verification should have failed\n");
|
||||
continue;
|
||||
}
|
||||
sig[63] ^= (j << 5);
|
||||
}
|
||||
|
||||
memset(pk, 0, sizeof pk);
|
||||
if (crypto_sign_verify_detached(sig,
|
||||
(const unsigned char *)test_data[i].m,
|
||||
i, pk) != -1) {
|
||||
printf("detached signature verification should have failed\n");
|
||||
}
|
||||
|
||||
if (crypto_sign_keypair(pk, sk) != 0) {
|
||||
printf("crypto_sign_keypair() failure\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user