3 #include "windows/windows-quirks.h"
5 #define TEST_NAME "onetimeauth7"
9 unsigned char c
[10000];
15 for (clen
= 0;clen
< 10000;++clen
) {
16 randombytes(key
,sizeof key
);
18 crypto_onetimeauth_poly1305(a
,c
,clen
,key
);
19 if (crypto_onetimeauth_poly1305_verify(a
,c
,clen
,key
) != 0) {
20 printf("fail %d\n",clen
);
24 c
[rand() % clen
] += 1 + (rand() % 255);
25 if (crypto_onetimeauth_poly1305_verify(a
,c
,clen
,key
) == 0) {
26 printf("forgery %d\n",clen
);
29 a
[rand() % sizeof a
] += 1 + (rand() % 255);
30 if (crypto_onetimeauth_poly1305_verify(a
,c
,clen
,key
) == 0) {
31 printf("forgery %d\n",clen
);