From d4fe483efd3e0062f12430efe9deb66d43d914d7 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 13 Jul 2013 10:09:38 -0400 Subject: NaCl moved to other repo. --- nacl/tests/auth6.cpp | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 nacl/tests/auth6.cpp (limited to 'nacl/tests/auth6.cpp') diff --git a/nacl/tests/auth6.cpp b/nacl/tests/auth6.cpp deleted file mode 100644 index dffb6388..00000000 --- a/nacl/tests/auth6.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include -using std::string; -#include -#include -#include "crypto_auth_hmacsha512256.h" -#include "randombytes.h" - -main() -{ - int clen; - int i; - for (clen = 0;clen < 10000;++clen) { - unsigned char key_bytes[32]; - randombytes(key_bytes,sizeof key_bytes); - string key((char *) key_bytes,sizeof key_bytes); - unsigned char c_bytes[clen]; - randombytes(c_bytes,sizeof c_bytes); - string c((char *) c_bytes,sizeof c_bytes); - string a = crypto_auth_hmacsha512256(c,key); - try { - crypto_auth_hmacsha512256_verify(a,c,key); - } catch(const char *s) { - printf("fail %d %s\n",clen,s); - return 100; - } - if (clen > 0) { - size_t pos = random() % clen; - c.replace(pos,1,1,c[pos] + 1 + (random() % 255)); - try { - crypto_auth_hmacsha512256_verify(a,c,key); - printf("forgery %d\n",clen); - } catch(const char *s) { - ; - } - pos = random() % a.size(); - a.replace(pos,1,1,a[pos] + 1 + (random() % 255)); - try { - crypto_auth_hmacsha512256_verify(a,c,key); - printf("forgery %d\n",clen); - } catch(const char *s) { - ; - } - } - } - return 0; -} -- cgit v1.2.3