Commit 8c1f9c56 authored by Andy Polyakov's avatar Andy Polyakov
Browse files

crypto/bn/bn_exp.c: SPARC portability fix.

(cherry picked from commit b69437e1)
parent 75063c15
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@
# endif
#endif

#if defined(OPENSSL_BN_ASM_MONT) && defined(__sparc__)
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
# include "sparc_arch.h"
extern unsigned int OPENSSL_sparcv9cap_P[];
#endif
@@ -592,7 +592,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
	int powerbufLen = 0;
	unsigned char *powerbuf=NULL;
	BIGNUM tmp, am;
#if defined(OPENSSL_BN_ASM_MONT) && defined(__sparc__)
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
	unsigned int t4=0;
#endif

@@ -629,7 +629,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,

	/* Get the window size to use with size of p. */
	window = BN_window_bits_for_ctime_exponent_size(bits);
#if defined(OPENSSL_BN_ASM_MONT) && defined(__sparc__)
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
	if (window>=5 && (top&15)==0 && top<=64 &&
	    (OPENSSL_sparcv9cap_P[1]&(CFR_MONTMUL|CFR_MONTSQR))==
	    			     (CFR_MONTMUL|CFR_MONTSQR) &&
@@ -690,7 +690,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
		}
	else	if (!BN_to_montgomery(&am,a,mont,ctx))		goto err;

#if defined(OPENSSL_BN_ASM_MONT) && defined(__sparc__)
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
    if (t4)
	{
	typedef int (*bn_pwr5_mont_f)(BN_ULONG *tp,const BN_ULONG *np,