Use the header file internal/cryptlib.h instead.
Remove checks for OPENSSL_NO_ASM and I386_ONLY
in cryptlib.c, to match the checks in other
places where OPENSSL_ia32cap_P is used and
assumed to be initialized.
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/9688)
extern unsigned int OPENSSL_ia32cap_P[4];
-# if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
+# if defined(OPENSSL_CPUID_OBJ)
/*
* Purpose of these minimalistic and character-type-agnostic subroutines
#include <stdio.h>
#include <string.h>
#include "internal/engine.h"
+#include "internal/cryptlib.h"
#include <openssl/rand.h>
#include <openssl/err.h>
#include <openssl/crypto.h>
void engine_load_rdrand_int(void)
{
- extern unsigned int OPENSSL_ia32cap_P[];
-
if (OPENSSL_ia32cap_P[1] & (1 << (62 - 32))) {
ENGINE *toadd = ENGINE_rdrand();
if (!toadd)
#include <openssl/aes.h>
#include <openssl/sha.h>
#include <openssl/rand.h>
+#include "internal/cryptlib.h"
#include "internal/modes_int.h"
#include "internal/evp_int.h"
#include "internal/constant_time_locl.h"
defined(__x86_64) || defined(__x86_64__) || \
defined(_M_AMD64) || defined(_M_X64) )
-extern unsigned int OPENSSL_ia32cap_P[];
# define AESNI_CAPABLE (1<<(57-32))
int aesni_set_encrypt_key(const unsigned char *userKey, int bits,
#include <openssl/aes.h>
#include <openssl/sha.h>
#include <openssl/rand.h>
+#include "internal/cryptlib.h"
#include "internal/modes_int.h"
#include "internal/constant_time_locl.h"
#include "internal/evp_int.h"
defined(__x86_64) || defined(__x86_64__) || \
defined(_M_AMD64) || defined(_M_X64) )
-extern unsigned int OPENSSL_ia32cap_P[];
# define AESNI_CAPABLE (1<<(57-32))
int aesni_set_encrypt_key(const unsigned char *userKey, int bits,
* rc4_md5-x86_64.pl */
md5_off = MD5_CBLOCK - key->md.num, blocks;
unsigned int l;
- extern unsigned int OPENSSL_ia32cap_P[];
# endif
size_t plen = key->payload_length;
defined(_M_AMD64) || defined(_M_X64) )
/* AES-NI section */
-extern unsigned int OPENSSL_ia32cap_P[];
# define AESNI_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
# ifdef VPAES_ASM
#include <string.h>
#include <openssl/crypto.h>
+#include "internal/cryptlib.h"
#include "internal/modes_int.h"
#if defined(BSWAP4) && defined(STRICT_ALIGNMENT)
defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
# define GHASH_ASM_X86_OR_64
# define GCM_FUNCREF_4BIT
-extern unsigned int OPENSSL_ia32cap_P[];
void gcm_init_clmul(u128 Htable[16], const u64 Xi[2]);
void gcm_gmult_clmul(u64 Xi[2], const u128 Htable[16]);
size_t OPENSSL_ia32_rdseed_bytes(unsigned char *buf, size_t len);
size_t OPENSSL_ia32_rdrand_bytes(unsigned char *buf, size_t len);
-extern unsigned int OPENSSL_ia32cap_P[];
-
/*
* Acquire entropy using Intel-specific cpu instructions
*
*
*/
+#include "internal/cryptlib.h"
#include "wp_locl.h"
#include <string.h>
# define OPENSSL_SMALL_FOOTPRINT
# endif
# define GO_FOR_MMX(ctx,inp,num) do { \
- extern unsigned long OPENSSL_ia32cap_P[]; \
void whirlpool_block_mmx(void *,const void *,size_t); \
if (!(OPENSSL_ia32cap_P[0] & (1<<23))) break; \
whirlpool_block_mmx(ctx->H.c,inp,num); return; \
# define HEX_SIZE(type) (sizeof(type)*2)
void OPENSSL_cpuid_setup(void);
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
+ defined(__x86_64) || defined(__x86_64__) || \
+ defined(_M_AMD64) || defined(_M_X64)
extern unsigned int OPENSSL_ia32cap_P[];
+#endif
void OPENSSL_showfatal(const char *fmta, ...);
int do_ex_data_init(OPENSSL_CTX *ctx);
void crypto_cleanup_all_ex_data_int(OPENSSL_CTX *ctx);
#include <stdlib.h>
#include <string.h>
#include "testutil.h"
-#include <openssl/opensslconf.h>
+#include "internal/cryptlib.h"
#if (defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64) || defined(__x86_64__) || \
size_t OPENSSL_ia32_rdrand_bytes(unsigned char *buf, size_t len);
size_t OPENSSL_ia32_rdseed_bytes(unsigned char *buf, size_t len);
-void OPENSSL_cpuid_setup(void);
-
-extern unsigned int OPENSSL_ia32cap_P[4];
-
static int sanity_check_bytes(size_t (*rng)(unsigned char *, size_t),
int rounds, int min_failures, int max_retries, int max_zero_words)
{