[BACK]Return to verify.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/verify.c, Revision 1.3

1.3     ! markus      1: /* $OpenBSD: verify.c,v 1.2 2013/12/07 00:26:37 djm Exp $ */
1.1       markus      2:
1.3     ! markus      3: /*
        !             4:  * Public Domain, Author: Daniel J. Bernstein
        !             5:  * Copied from nacl-20110221/crypto_verify/32/ref/verify.c
        !             6:  */
1.1       markus      7:
                      8: #include "crypto_api.h"
                      9:
                     10: int crypto_verify_32(const unsigned char *x,const unsigned char *y)
                     11: {
                     12:   unsigned int differentbits = 0;
                     13: #define F(i) differentbits |= x[i] ^ y[i];
                     14:   F(0)
                     15:   F(1)
                     16:   F(2)
                     17:   F(3)
                     18:   F(4)
                     19:   F(5)
                     20:   F(6)
                     21:   F(7)
                     22:   F(8)
                     23:   F(9)
                     24:   F(10)
                     25:   F(11)
                     26:   F(12)
                     27:   F(13)
                     28:   F(14)
                     29:   F(15)
                     30:   F(16)
                     31:   F(17)
                     32:   F(18)
                     33:   F(19)
                     34:   F(20)
                     35:   F(21)
                     36:   F(22)
                     37:   F(23)
                     38:   F(24)
                     39:   F(25)
                     40:   F(26)
                     41:   F(27)
                     42:   F(28)
                     43:   F(29)
                     44:   F(30)
                     45:   F(31)
                     46:   return (1 & ((differentbits - 1) >> 8)) - 1;
                     47: }