view NaCl/crypto_verify/16.cs @ 61:2b24666cd759

Fixed errors in Windows USB enumeration and LibUsbDotNet configuration descriptor code
author Ivo Smits <Ivo@UCIS.nl>
date Sun, 13 Oct 2013 00:48:28 +0200
parents c873e3dd73fe
children b5e27116bd2a
line wrap: on
line source

???using System;

namespace UCIS.NaCl.crypto_verify {
	unsafe static class _16 {
		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];
			return (1 & ((differentbits - 1) >> 8)) - 1;
		}
	}
}