aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/curve25519/curve25519-donna.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-06 17:15:08 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-06 17:15:08 +0000
commit5773d9e998e626328bf49a655d49df4810e6f980 (patch)
tree963502b686aeb0d5a250dcbc146e23fb15c0c59c /src/libcryptobox/curve25519/curve25519-donna.c
parente8b71e4179c343e3707fb5a1b94dae6cc8b90681 (diff)
downloadrspamd-5773d9e998e626328bf49a655d49df4810e6f980.tar.gz
rspamd-5773d9e998e626328bf49a655d49df4810e6f980.zip
Set curve25519 bits on keypair generation.
Diffstat (limited to 'src/libcryptobox/curve25519/curve25519-donna.c')
-rw-r--r--src/libcryptobox/curve25519/curve25519-donna.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/libcryptobox/curve25519/curve25519-donna.c b/src/libcryptobox/curve25519/curve25519-donna.c
index f9f19a632..e6a50b87f 100644
--- a/src/libcryptobox/curve25519/curve25519-donna.c
+++ b/src/libcryptobox/curve25519/curve25519-donna.c
@@ -894,17 +894,10 @@ static void crecip (limb *out, const limb *z)
int curve25519 (u8 *mypublic, const u8 *secret, const u8 *basepoint)
{
limb bp[10], x[10], z[11], zmone[10];
- uint8_t e[32];
int i;
- for (i = 0; i < 32; ++i)
- e[i] = secret[i];
- e[0] &= 248;
- e[31] &= 127;
- e[31] |= 64;
-
fexpand (bp, basepoint);
- cmult (x, z, e, bp);
+ cmult (x, z, secret, bp);
crecip (zmone, z);
fmul (z, x, zmone);
fcontract (mypublic, z);