diff options
author | Samuel Neves <sneves@dei.uc.pt> | 2018-08-18 04:14:18 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-08-28 23:20:13 -0600 |
commit | 4e1e81681a5369fe5659401ea1deb3072f6df098 (patch) | |
tree | 584b387b98fa4ffc6935ded683014e1e1415ab00 /src | |
parent | 3983ac3ec246ed537bb049aa44c6db8dd4e6586a (diff) |
curve25519-x86_64: let the compiler decide when/how to load constants
Signed-off-by: Samuel Neves <sneves@dei.uc.pt>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/crypto/curve25519-x86_64.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/crypto/curve25519-x86_64.h b/src/crypto/curve25519-x86_64.h index 7324cee..ac3fbfd 100644 --- a/src/crypto/curve25519-x86_64.h +++ b/src/crypto/curve25519-x86_64.h @@ -1606,11 +1606,8 @@ static void inv_eltfp25519_1w_bmi2(u64 *const c, const u64 *const a) */ static __always_inline void fred_eltfp25519_1w(u64 *const c) { - u64 tmp0, tmp1; + u64 tmp0 = 38, tmp1 = 19; asm volatile( - "movl $19, %k5 ;" - "movl $38, %k4 ;" - "btrq $63, %3 ;" /* Put bit 255 in carry flag and clear */ "cmovncl %k5, %k4 ;" /* c[255] ? 38 : 19 */ @@ -1631,7 +1628,7 @@ static __always_inline void fred_eltfp25519_1w(u64 *const c) "sbbq $0, %2 ;" "sbbq $0, %3 ;" - : "+r"(c[0]), "+r"(c[1]), "+r"(c[2]), "+r"(c[3]), "=r"(tmp0), "=r"(tmp1) + : "+r"(c[0]), "+r"(c[1]), "+r"(c[2]), "+r"(c[3]), "+r"(tmp0), "+r"(tmp1) : : "memory", "cc"); } |