diff --git a/ed25519.dll b/ed25519.dll index 2dd29d5..33f9938 100644 Binary files a/ed25519.dll and b/ed25519.dll differ diff --git a/readme.md b/readme.md index 3ba1314..7a7a602 100644 --- a/readme.md +++ b/readme.md @@ -20,14 +20,15 @@ Performance On a Windows machine with an Intel Pentium B970 @ 2.3GHz I got the following speeds (running on only one a single core): - Seed + key generation: 489us - Message signing (short message): 251us - Message verifying (short message): 772us - Scalar addition: 358us - Key exchange: 724us + Seed + key generation: 144us + Message signing (short message): 87us + Message verifying (short message): 228us + Scalar addition: 100us + Key exchange: 220us The speeds on other machines may vary. Sign/verify times will be higher with -longer messages. +longer messages. The implementation significantly benefits from 64 bit +architectures, if possible compile as 64 bit. Usage diff --git a/src/add_scalar.c b/src/add_scalar.c index 74dc801..91b64d3 100644 --- a/src/add_scalar.c +++ b/src/add_scalar.c @@ -10,7 +10,7 @@ void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, c unsigned char n[32]; ge_p3 nB; ge_p1p1 A_p1p1; - ge_p3 A; + ge_p2 A; ge_p3 public_key_unpacked; ge_cached T; @@ -39,9 +39,9 @@ void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, c /* A = n*B + T */ ge_add(&A_p1p1, &nB, &T); - ge_p1p1_to_p3(&A, &A_p1p1); + ge_p1p1_to_p2(&A, &A_p1p1); /* pack public key */ - ge_p3_tobytes(public_key, &A); + ge_tobytes(public_key, &A); } } diff --git a/test.c b/test.c index ec1eeef..264832f 100644 --- a/test.c +++ b/test.c @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) { } end = clock(); - printf("%fus per signature\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + printf("%fus per keypair\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); printf("testing key exchange performance: "); start = clock(); @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) { } end = clock(); - printf("%fus per signature\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + printf("%fus per shared secret\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); return 0; }