Commit ed45f3c2 authored by Richard Levitte's avatar Richard Levitte
Browse files

Rearrange rsaz



A small rearrangement so the inclusion of rsaz_exp.h would be
unconditional, but what that header defines becomes conditional.

This solves the weirdness where rsaz_exp.h gets in and out of the
dependency list for bn_exp.c, depending on the present architecture.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent cc3f3fc2
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -126,13 +126,7 @@
# include <alloca.h>
#endif

#undef RSAZ_ENABLED
#if defined(OPENSSL_BN_ASM_MONT) && \
        (defined(__x86_64) || defined(__x86_64__) || \
         defined(_M_AMD64) || defined(_M_X64))
#include "rsaz_exp.h"
# define RSAZ_ENABLED
#endif

#undef SPARC_T4_MONT
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
+10 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@

#include "rsaz_exp.h"

#ifdef RSAZ_ENABLED

/*
 * See crypto/bn/asm/rsaz-avx2.pl for further details.
 */
@@ -334,3 +336,11 @@ void RSAZ_512_mod_exp(BN_ULONG result[8],

    OPENSSL_cleanse(storage, sizeof(storage));
}

#else

# if defined(PEDANTIC) || defined(__DECC) || defined(__clang__)
static void *dummy = &dummy;
# endif

#endif
+10 −1
Original line number Diff line number Diff line
@@ -31,6 +31,12 @@
#ifndef RSAZ_EXP_H
# define RSAZ_EXP_H

# undef RSAZ_ENABLED
# if defined(OPENSSL_BN_ASM_MONT) && \
        (defined(__x86_64) || defined(__x86_64__) || \
         defined(_M_AMD64) || defined(_M_X64))
#  define RSAZ_ENABLED

#  include <openssl/bn.h>

void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16],
@@ -44,4 +50,7 @@ void RSAZ_512_mod_exp(BN_ULONG result[8],
                      const BN_ULONG base_norm[8], const BN_ULONG exponent[8],
                      const BN_ULONG m_norm[8], BN_ULONG k0,
                      const BN_ULONG RR[8]);

# endif

#endif