From 2800307b05b13b501c0d950bc6f946a4305828a0 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 2 May 2020 17:54:02 +0200 Subject: [PATCH] Nits --- .../crypto_core/ed25519/ref10/fe_25_5/fe.h | 2 +- .../crypto_core/ed25519/ref10/fe_51/fe.h | 2 +- .../sodium/private/ed25519_ref10_fe_25_5.h | 22 +------------------ .../sodium/private/ed25519_ref10_fe_51.h | 12 +--------- 4 files changed, 4 insertions(+), 34 deletions(-) diff --git a/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h b/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h index f216669e..9e11afd1 100644 --- a/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h +++ b/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h @@ -1,5 +1,5 @@ /* - Ignores top bit of h. + Ignores top bit of s. */ void diff --git a/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h b/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h index de876264..be7d1812 100644 --- a/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h +++ b/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h @@ -1,5 +1,5 @@ /* - Ignores top bit of h. + Ignores top bit of s. */ void diff --git a/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h b/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h index f2782d9d..9d773262 100644 --- a/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h +++ b/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h @@ -273,27 +273,7 @@ fe25519_cswap(fe25519 f, fe25519 g, unsigned int b) static inline void fe25519_copy(fe25519 h, const fe25519 f) { - int32_t f0 = f[0]; - int32_t f1 = f[1]; - int32_t f2 = f[2]; - int32_t f3 = f[3]; - int32_t f4 = f[4]; - int32_t f5 = f[5]; - int32_t f6 = f[6]; - int32_t f7 = f[7]; - int32_t f8 = f[8]; - int32_t f9 = f[9]; - - h[0] = f0; - h[1] = f1; - h[2] = f2; - h[3] = f3; - h[4] = f4; - h[5] = f5; - h[6] = f6; - h[7] = f7; - h[8] = f8; - h[9] = f9; + memcpy(h, f, 10 * 4); } /* diff --git a/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h b/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h index 6c0d775b..67a86152 100644 --- a/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h +++ b/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h @@ -191,17 +191,7 @@ fe25519_cswap(fe25519 f, fe25519 g, unsigned int b) static inline void fe25519_copy(fe25519 h, const fe25519 f) { - uint64_t f0 = f[0]; - uint64_t f1 = f[1]; - uint64_t f2 = f[2]; - uint64_t f3 = f[3]; - uint64_t f4 = f[4]; - - h[0] = f0; - h[1] = f1; - h[2] = f2; - h[3] = f3; - h[4] = f4; + memcpy(h, f, 5 * 8); } /*