diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-10-26 18:12:15 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-10-26 18:24:59 +0200 |
commit | 7003e7c1565c1d391d6b907dc8667083092b9543 (patch) | |
tree | 6218bba2ad3cdaa4a8c0be027587db736a2cc946 /src/crypto/crypto_ops_builder/verify.c | |
parent | Merge pull request #448 (diff) | |
parent | Merge branch 'master' of https://github.com/fluffypony/bitmonero (diff) | |
download | monero-7003e7c1565c1d391d6b907dc8667083092b9543.tar.xz |
Merge pull request #450
cbdf197 renamed folder (Riccardo Spagni)
bb0c161 renamed folder (Riccardo Spagni)
Diffstat (limited to 'src/crypto/crypto_ops_builder/verify.c')
-rwxr-xr-x | src/crypto/crypto_ops_builder/verify.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/crypto/crypto_ops_builder/verify.c b/src/crypto/crypto_ops_builder/verify.c new file mode 100755 index 000000000..a04186b60 --- /dev/null +++ b/src/crypto/crypto_ops_builder/verify.c @@ -0,0 +1,40 @@ +#include "crypto_verify_32.h" + +int crypto_verify_32(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) + F(16) + F(17) + F(18) + F(19) + F(20) + F(21) + F(22) + F(23) + F(24) + F(25) + F(26) + F(27) + F(28) + F(29) + F(30) + F(31) + return (1 & ((differentbits - 1) >> 8)) - 1; +} |