From 94cc35faeb6248d75841a5f47a41a266086b4d16 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 11 Aug 2014 14:04:41 -0400 Subject: initial import of upstream sources --- src/libsodium/crypto_verify/16/checksum | 1 - src/libsodium/crypto_verify/32/checksum | 1 - src/libsodium/crypto_verify/try.c | 76 --------------------------------- 3 files changed, 78 deletions(-) delete mode 100644 src/libsodium/crypto_verify/16/checksum delete mode 100644 src/libsodium/crypto_verify/32/checksum delete mode 100644 src/libsodium/crypto_verify/try.c (limited to 'src/libsodium/crypto_verify') diff --git a/src/libsodium/crypto_verify/16/checksum b/src/libsodium/crypto_verify/16/checksum deleted file mode 100644 index 573541a..0000000 --- a/src/libsodium/crypto_verify/16/checksum +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libsodium/crypto_verify/32/checksum b/src/libsodium/crypto_verify/32/checksum deleted file mode 100644 index 573541a..0000000 --- a/src/libsodium/crypto_verify/32/checksum +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libsodium/crypto_verify/try.c b/src/libsodium/crypto_verify/try.c deleted file mode 100644 index 06684e7..0000000 --- a/src/libsodium/crypto_verify/try.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * crypto_verify/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_verify.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_verify_IMPLEMENTATION; - -static unsigned char *x; -static unsigned char *y; - -void preallocate(void) -{ -} - -void allocate(void) -{ - x = alignedcalloc(crypto_verify_BYTES); - y = alignedcalloc(crypto_verify_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_verify(x,y); -} - -static const char *check(void) -{ - int r = crypto_verify(x,y); - if (r == 0) { - if (memcmp(x,y,crypto_verify_BYTES)) return "different strings pass verify"; - } else if (r == -1) { - if (!memcmp(x,y,crypto_verify_BYTES)) return "equal strings fail verify"; - } else { - return "weird return value from verify"; - } - return 0; -} - -char checksum[2]; - -const char *checksum_compute(void) -{ - long long tests; - long long i; - long long j; - const char *c; - - for (tests = 0;tests < 100000;++tests) { - for (i = 0;i < crypto_verify_BYTES;++i) x[i] = rand(); - for (i = 0;i < crypto_verify_BYTES;++i) y[i] = rand(); - c = check(); if (c) return c; - for (i = 0;i < crypto_verify_BYTES;++i) y[i] = x[i]; - c = check(); if (c) return c; - y[rand() % crypto_verify_BYTES] = rand(); - c = check(); if (c) return c; - y[rand() % crypto_verify_BYTES] = rand(); - c = check(); if (c) return c; - y[rand() % crypto_verify_BYTES] = rand(); - c = check(); if (c) return c; - } - - checksum[0] = '0'; - checksum[1] = 0; - return 0; -} -- cgit v1.2.3