Mercurial > hg > ucis.core
annotate NaCl/crypto_verify/16.cs @ 78:1a10ca0f662e
FBGUI updates
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Sun, 16 Feb 2014 14:59:52 +0100 |
parents | b5e27116bd2a |
children |
rev | line source |
---|---|
20 | 1 ???using System; |
2 | |
3 namespace UCIS.NaCl.crypto_verify { | |
4 unsafe static class _16 { | |
5 const int BYTES = 16; | |
6 public static int crypto_verify(Byte* x, Byte* y) { | |
7 Int32 differentbits = 0; | |
77
b5e27116bd2a
NaCl: fixed MAC/hash verification code
Ivo Smits <Ivo@UCIS.nl>
parents:
20
diff
changeset
|
8 for (int i = 0; i < 16; i++) differentbits |= x[i] ^ y[i]; |
20 | 9 return (1 & ((differentbits - 1) >> 8)) - 1; |
10 } | |
11 } | |
12 } |