annotate NaCl/crypto_verify/32.cs @ 73:6aca18ee4ec6
NaCl: improved ed25519 implementation, added simple API for ed25519 and sha512
author |
Ivo Smits <Ivo@UCIS.nl> |
date |
Sat, 02 Nov 2013 16:01:09 +0100 |
parents |
c873e3dd73fe |
children |
b5e27116bd2a |
rev |
line source |
20
|
1 ???using System; |
|
2 |
|
3 namespace UCIS.NaCl.crypto_verify { |
|
4 unsafe static class _32 { |
|
5 const int BYTES = 32; |
|
6 public static int crypto_verify(Byte* x, Byte* y) { |
|
7 Int32 differentbits = 0; |
|
8 for (int i = 0; i < 31; i++) differentbits |= x[i] ^ y[i]; |
|
9 return (1 & ((differentbits - 1) >> 8)) - 1; |
|
10 } |
|
11 } |
|
12 } |