From 02f014ee2ad4c302f0978b768f2baf012741b662 Mon Sep 17 00:00:00 2001 From: Kris Kwiatkowski Date: Sun, 21 Apr 2019 00:03:06 +0100 Subject: [PATCH] FIX fp_generic.c Change-Id: Ic2498acd3f4f56a4d45c91c1d676a19297e42741 --- crypto/CMakeLists.txt | 1 + third_party/sike/asm/fp-x86_64.pl | 2 ++ third_party/sike/asm/fp_generic.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 1720df7b..6d62276e 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -411,6 +411,7 @@ add_library( ../third_party/sike/isogeny.c ../third_party/sike/P503.c ../third_party/sike/sike.c + ../third_party/sike/asm/fp_generic.c $ ${CRYPTO_ARCH_SOURCES} diff --git a/third_party/sike/asm/fp-x86_64.pl b/third_party/sike/asm/fp-x86_64.pl index 70c76a0d..b00d3edb 100755 --- a/third_party/sike/asm/fp-x86_64.pl +++ b/third_party/sike/asm/fp-x86_64.pl @@ -97,6 +97,7 @@ ___ } # Compute z = x + y (mod p). +# Operation: c [rdx] = a [rdi] + b [rsi] $code.=<<___; .globl ${PREFIX}_fpadd .type ${PREFIX}_fpadd,\@function,3 @@ -224,6 +225,7 @@ sub cswap_block16() { # Conditionally swaps bits in x and y in constant time. # mask indicates bits to be swapped (set bits are swapped) +# Operation: [rdi] <-> [rsi] if rdx==1 sub cswap { # P[0].X with Q[0].X foreach ( 0.. 3){$BLOCKS.=eval "&cswap_block16($_)";} diff --git a/third_party/sike/asm/fp_generic.c b/third_party/sike/asm/fp_generic.c index 38aae4ec..d5931b7a 100644 --- a/third_party/sike/asm/fp_generic.c +++ b/third_party/sike/asm/fp_generic.c @@ -4,6 +4,8 @@ * Abstract: portable modular arithmetic for P503 *********************************************************************************************/ +#include + #if defined(OPENSSL_NO_ASM) || \ (!defined(OPENSSL_X86_64) && !defined(OPENSSL_AARCH64))