1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

from_hash: clear the high bit

This commit is contained in:
Frank Denis 2019-05-03 18:40:48 +02:00
parent 10b991d518
commit 8a1ac8e11f
2 changed files with 1 additions and 2 deletions

View File

@ -2623,7 +2623,6 @@ ge25519_from_hash(unsigned char s[32], const unsigned char h[64])
fe25519_frombytes(fe_f, fl); fe25519_frombytes(fe_f, fl);
fe25519_frombytes(fe_g, gl); fe25519_frombytes(fe_g, gl);
fe_f[0] += (h[0 + 31] >> 7) * 19; fe_f[0] += (h[0 + 31] >> 7) * 19;
fe_g[0] += (h[32 + 31] >> 7) * 19;
for (i = 0; i < sizeof (fe25519) / sizeof fe_f[0]; i++) { for (i = 0; i < sizeof (fe25519) / sizeof fe_f[0]; i++) {
fe_f[i] += 38 * fe_g[i]; fe_f[i] += 38 * fe_g[i];
} }

View File

@ -152,7 +152,7 @@ sodium_hrtime(void)
static uint64_t static uint64_t
sodium_hrtime(void) sodium_hrtime(void)
{ {
struct timeval tv; struct timeval tv;
if (gettimeofday(&tv, NULL) != 0) { if (gettimeofday(&tv, NULL) != 0) {
sodium_misuse(); /* LCOV_EXCL_LINE */ sodium_misuse(); /* LCOV_EXCL_LINE */