diff options
author | Damien Miller <djm@mindrot.org> | 2013-12-07 11:24:01 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2013-12-07 11:24:01 +1100 |
commit | 5be9d9e3cbd9c66f24745d25bf2e809c1d158ee0 (patch) | |
tree | d2086d37436014ea44f0f024396a1a8638640b00 /verify.c | |
parent | bcd00abd8451f36142ae2ee10cc657202149201e (diff) |
- markus@cvs.openbsd.org 2013/12/06 13:39:49
[authfd.c authfile.c key.c key.h myproposal.h pathnames.h readconf.c]
[servconf.c ssh-agent.c ssh-keygen.c ssh-keyscan.1 ssh-keyscan.c]
[ssh-keysign.c ssh.c ssh_config.5 sshd.8 sshd.c verify.c ssh-ed25519.c]
[sc25519.h sc25519.c hash.c ge25519_base.data ge25519.h ge25519.c]
[fe25519.h fe25519.c ed25519.c crypto_api.h blocks.c]
support ed25519 keys (hostkeys and user identities) using the public
domain ed25519 reference code from SUPERCOP, see
http://ed25519.cr.yp.to/software.html
feedback, help & ok djm@
Diffstat (limited to 'verify.c')
-rw-r--r-- | verify.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/verify.c b/verify.c new file mode 100644 index 000000000..943e606b5 --- /dev/null +++ b/verify.c | |||
@@ -0,0 +1,44 @@ | |||
1 | /* $OpenBSD: */ | ||
2 | |||
3 | /* Public Domain, from supercop-20130419/crypto_verify/32/ref/verify.c */ | ||
4 | |||
5 | #include "crypto_api.h" | ||
6 | |||
7 | int crypto_verify_32(const unsigned char *x,const unsigned char *y) | ||
8 | { | ||
9 | unsigned int differentbits = 0; | ||
10 | #define F(i) differentbits |= x[i] ^ y[i]; | ||
11 | F(0) | ||
12 | F(1) | ||
13 | F(2) | ||
14 | F(3) | ||
15 | F(4) | ||
16 | F(5) | ||
17 | F(6) | ||
18 | F(7) | ||
19 | F(8) | ||
20 | F(9) | ||
21 | F(10) | ||
22 | F(11) | ||
23 | F(12) | ||
24 | F(13) | ||
25 | F(14) | ||
26 | F(15) | ||
27 | F(16) | ||
28 | F(17) | ||
29 | F(18) | ||
30 | F(19) | ||
31 | F(20) | ||
32 | F(21) | ||
33 | F(22) | ||
34 | F(23) | ||
35 | F(24) | ||
36 | F(25) | ||
37 | F(26) | ||
38 | F(27) | ||
39 | F(28) | ||
40 | F(29) | ||
41 | F(30) | ||
42 | F(31) | ||
43 | return (1 & ((differentbits - 1) >> 8)) - 1; | ||
44 | } | ||