Add a test for crypto_sign() with overlapping buffers.
This commit is contained in:
parent
ad5a165f94
commit
5558885953
@ -1115,6 +1115,18 @@ int main(void)
|
||||
printf("%u tests\n", i);
|
||||
|
||||
i--;
|
||||
|
||||
memcpy(sm, test_data[i].m, i);
|
||||
if (crypto_sign(sm, &smlen, sm, i, skpk) != 0) {
|
||||
printf("crypto_sign() with overlap failed\n");
|
||||
}
|
||||
if (crypto_sign_open(sm, &mlen, sm, smlen, test_data[i].pk) != 0) {
|
||||
printf("crypto_sign_open() with overlap failed\n");
|
||||
}
|
||||
if (memcmp(test_data[i].m, sm, (size_t)mlen) != 0) {
|
||||
printf("crypto_sign_open() with overlap failed (content)\n");
|
||||
}
|
||||
|
||||
for (j = 1U; j < 8U; j++) {
|
||||
sig[63] ^= (j << 5);
|
||||
if (crypto_sign_verify_detached(sig,
|
||||
|
Loading…
Reference in New Issue
Block a user