diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-08 20:31:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-08 20:31:57 -0400 |
commit | 34e4122025791d1a607426e5e543d6312872b9dd (patch) | |
tree | 975c1dc949d81ed7a76f50726a49d4aa8e67533e /src/ext | |
parent | 649104fdb950057288a5e7b48f402d563546b83b (diff) | |
parent | 2f17743d6f7222cf96250890dd91d6689b2d55c6 (diff) | |
download | tor-34e4122025791d1a607426e5e543d6312872b9dd.tar.gz tor-34e4122025791d1a607426e5e543d6312872b9dd.zip |
Merge branch 'ticket20657_nickm_bugfixes_squashed'
Diffstat (limited to 'src/ext')
-rw-r--r-- | src/ext/ed25519/donna/ed25519_tor.c | 8 | ||||
-rw-r--r-- | src/ext/ed25519/ref10/blinding.c | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/ext/ed25519/donna/ed25519_tor.c b/src/ext/ed25519/donna/ed25519_tor.c index 6bc22675ae..44ec562f02 100644 --- a/src/ext/ed25519/donna/ed25519_tor.c +++ b/src/ext/ed25519/donna/ed25519_tor.c @@ -245,13 +245,7 @@ ed25519_donna_sign(unsigned char *sig, const unsigned char *m, size_t mlen, static void ed25519_donna_gettweak(unsigned char *out, const unsigned char *param) { - static const char str[] = "Derive temporary signing key"; - ed25519_hash_context ctx; - - ed25519_hash_init(&ctx); - ed25519_hash_update(&ctx, (const unsigned char*)str, strlen(str)); - ed25519_hash_update(&ctx, param, 32); - ed25519_hash_final(&ctx, out); + memcpy(out, param, 32); out[0] &= 248; /* Is this necessary ? */ out[31] &= 63; diff --git a/src/ext/ed25519/ref10/blinding.c b/src/ext/ed25519/ref10/blinding.c index 31332a2719..a3b32fa80c 100644 --- a/src/ext/ed25519/ref10/blinding.c +++ b/src/ext/ed25519/ref10/blinding.c @@ -12,8 +12,8 @@ static void ed25519_ref10_gettweak(unsigned char *out, const unsigned char *param) { - const char str[] = "Derive temporary signing key"; - crypto_hash_sha512_2(out, (const unsigned char*)str, strlen(str), param, 32); + memcpy(out, param, 32); + out[0] &= 248; /* Is this necessary necessary ? */ out[31] &= 63; out[31] |= 64; |