source: trunk/src-ed25519/supercop-ref/verify.c

Last change on this file was 9598517, checked in by Brian Warner <warner@…>, at 2012-02-12T15:05:37Z

Add Ed25519 signatures, in pycryptopp.publickey.ed25519 . Closes #75.

This copies in version 1.0 of python-ed25519, from
https://github.com/warner/python-ed25519 (or pypi), with minor source-code
rearrangement to match pycryptopp's build process. It includes unit tests,
power-on self-tests, and full known-answer tests. The standard 'setup.py
test' target only exercises 10% of the test vectors, to let the suite run in
about 1.0s on my laptop. The API documentation is in README.ed25519 .

Tests have been run successfully on Linux, OS-X and windows.

  • Property mode set to 100644
File size: 473 bytes
Line 
1#include "crypto_verify_32.h"
2
3int crypto_verify_32(const unsigned char *x,const unsigned char *y)
4{
5  unsigned int differentbits = 0;
6#define F(i) differentbits |= x[i] ^ y[i];
7  F(0)
8  F(1)
9  F(2)
10  F(3)
11  F(4)
12  F(5)
13  F(6)
14  F(7)
15  F(8)
16  F(9)
17  F(10)
18  F(11)
19  F(12)
20  F(13)
21  F(14)
22  F(15)
23  F(16)
24  F(17)
25  F(18)
26  F(19)
27  F(20)
28  F(21)
29  F(22)
30  F(23)
31  F(24)
32  F(25)
33  F(26)
34  F(27)
35  F(28)
36  F(29)
37  F(30)
38  F(31)
39  return (1 & ((differentbits - 1) >> 8)) - 1;
40}
Note: See TracBrowser for help on using the repository browser.