changeset 77:b5e27116bd2a

NaCl: fixed MAC/hash verification code
author Ivo Smits <Ivo@UCIS.nl>
date Tue, 11 Feb 2014 17:45:33 +0100
parents b05350c24596
children 1a10ca0f662e
files NaCl/crypto_verify/16.cs NaCl/crypto_verify/32.cs
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NaCl/crypto_verify/16.cs	Mon Feb 03 22:53:58 2014 +0100
+++ b/NaCl/crypto_verify/16.cs	Tue Feb 11 17:45:33 2014 +0100
@@ -5,7 +5,7 @@
 		const int BYTES = 16;
 		public static int crypto_verify(Byte* x, Byte* y) {
 			Int32 differentbits = 0;
-			for (int i = 0; i < 15; i++) differentbits |= x[i] ^ y[i];
+			for (int i = 0; i < 16; i++) differentbits |= x[i] ^ y[i];
 			return (1 & ((differentbits - 1) >> 8)) - 1;
 		}
 	}
--- a/NaCl/crypto_verify/32.cs	Mon Feb 03 22:53:58 2014 +0100
+++ b/NaCl/crypto_verify/32.cs	Tue Feb 11 17:45:33 2014 +0100
@@ -5,7 +5,7 @@
 		const int BYTES = 32;
 		public static int crypto_verify(Byte* x, Byte* y) {
 			Int32 differentbits = 0;
-			for (int i = 0; i < 31; i++) differentbits |= x[i] ^ y[i];
+			for (int i = 0; i < 32; i++) differentbits |= x[i] ^ y[i];
 			return (1 & ((differentbits - 1) >> 8)) - 1;
 		}
 	}