summaryrefslogtreecommitdiff
path: root/src/libsodium/crypto_verify/16
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2014-08-11 13:49:21 -0400
committerMicah Anderson <micah@riseup.net>2014-08-11 13:49:21 -0400
commit2e59f9740a29439df7c7a56cf0ae83dec3081d31 (patch)
treed5e7c4e74c9a0f1ea999327d2e68b1dd27be00e0 /src/libsodium/crypto_verify/16
initial import of debian version from mentors0.6.1
Diffstat (limited to 'src/libsodium/crypto_verify/16')
-rw-r--r--src/libsodium/crypto_verify/16/checksum1
-rw-r--r--src/libsodium/crypto_verify/16/ref/api.h2
-rw-r--r--src/libsodium/crypto_verify/16/ref/verify_16.c24
-rw-r--r--src/libsodium/crypto_verify/16/verify_16_api.c6
4 files changed, 33 insertions, 0 deletions
diff --git a/src/libsodium/crypto_verify/16/checksum b/src/libsodium/crypto_verify/16/checksum
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/src/libsodium/crypto_verify/16/checksum
@@ -0,0 +1 @@
+0
diff --git a/src/libsodium/crypto_verify/16/ref/api.h b/src/libsodium/crypto_verify/16/ref/api.h
new file mode 100644
index 0000000..8dcaf87
--- /dev/null
+++ b/src/libsodium/crypto_verify/16/ref/api.h
@@ -0,0 +1,2 @@
+
+#include "crypto_verify_16.h"
diff --git a/src/libsodium/crypto_verify/16/ref/verify_16.c b/src/libsodium/crypto_verify/16/ref/verify_16.c
new file mode 100644
index 0000000..f7e33f1
--- /dev/null
+++ b/src/libsodium/crypto_verify/16/ref/verify_16.c
@@ -0,0 +1,24 @@
+#include "api.h"
+
+int crypto_verify_16(const unsigned char *x,const unsigned char *y)
+{
+ unsigned int differentbits = 0;
+#define F(i) differentbits |= x[i] ^ y[i];
+ F(0)
+ F(1)
+ F(2)
+ F(3)
+ F(4)
+ F(5)
+ F(6)
+ F(7)
+ F(8)
+ F(9)
+ F(10)
+ F(11)
+ F(12)
+ F(13)
+ F(14)
+ F(15)
+ return (1 & ((differentbits - 1) >> 8)) - 1;
+}
diff --git a/src/libsodium/crypto_verify/16/verify_16_api.c b/src/libsodium/crypto_verify/16/verify_16_api.c
new file mode 100644
index 0000000..757f9b6
--- /dev/null
+++ b/src/libsodium/crypto_verify/16/verify_16_api.c
@@ -0,0 +1,6 @@
+#include "crypto_verify_16.h"
+
+size_t
+crypto_verify_16_bytes(void) {
+ return crypto_verify_16_BYTES;
+}