WIP
Change-Id: Ib523d7e7b175b222b2bdb2c16d8f395bcb5a2fc5
This commit is contained in:
parent
a2e5d797b3
commit
05882a756c
8
third_party/sike/fpx.c
vendored
8
third_party/sike/fpx.c
vendored
@ -133,7 +133,7 @@ static void fpinv_mont(felm_t a)
|
||||
}
|
||||
|
||||
// Multiprecision addition, c = a+b, where lng(a) = lng(b) = nwords. Returns the carry bit.
|
||||
#if defined(OPENSSL_NO_ASM)
|
||||
#if defined(OPENSSL_NO_ASM) || (!defined(OPENSSL_X86_64) && !defined(OPENSSL_AARCH64))
|
||||
inline static unsigned int mp_add(const felm_t a, const felm_t b, felm_t c, const unsigned int nwords) {
|
||||
uint8_t carry = 0;
|
||||
for (size_t i = 0; i < nwords; i++) {
|
||||
@ -155,7 +155,7 @@ inline static unsigned int mp_sub(const felm_t a, const felm_t b, felm_t c, cons
|
||||
// Multiprecision addition, c = a+b.
|
||||
inline static void mp_addfast(const felm_t a, const felm_t b, felm_t c)
|
||||
{
|
||||
#if defined(OPENSSL_NO_ASM)
|
||||
#if defined(OPENSSL_NO_ASM) || (!defined(OPENSSL_X86_64) && !defined(OPENSSL_AARCH64))
|
||||
mp_add(a, b, c, NWORDS_FIELD);
|
||||
#else
|
||||
sike_mpadd_asm(a, b, c);
|
||||
@ -165,7 +165,7 @@ inline static void mp_addfast(const felm_t a, const felm_t b, felm_t c)
|
||||
// Multiprecision subtraction, c = a-b, where lng(a) = lng(b) = 2*NWORDS_FIELD.
|
||||
// If c < 0 then returns mask = 0xFF..F, else mask = 0x00..0
|
||||
inline static crypto_word_t mp_subfast(const dfelm_t a, const dfelm_t b, dfelm_t c) {
|
||||
#if defined(OPENSSL_NO_ASM)
|
||||
#if defined(OPENSSL_NO_ASM) || (!defined(OPENSSL_X86_64) && !defined(OPENSSL_AARCH64))
|
||||
return (0 - (crypto_word_t)mp_sub((felm_t)a, (felm_t)b, (felm_t)c, 2*NWORDS_FIELD));
|
||||
#else
|
||||
return sike_mpsubx2_asm(a, b, c);
|
||||
@ -175,7 +175,7 @@ inline static crypto_word_t mp_subfast(const dfelm_t a, const dfelm_t b, dfelm_t
|
||||
// Multiprecision subtraction, c = c-a-b, where lng(a) = lng(b) = 2*NWORDS_FIELD.
|
||||
// Inputs should be s.t. c > a and c > b
|
||||
inline static void mp_dblsubfast(const dfelm_t a, const dfelm_t b, dfelm_t c) {
|
||||
#if defined(OPENSSL_NO_ASM)
|
||||
#if defined(OPENSSL_NO_ASM) || (!defined(OPENSSL_X86_64) && !defined(OPENSSL_AARCH64))
|
||||
mp_sub((felm_t)c, (felm_t)a, (felm_t)c, 2*NWORDS_FIELD);
|
||||
mp_sub((felm_t)c, (felm_t)b, (felm_t)c, 2*NWORDS_FIELD);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user