Skip to content

Commit

Permalink
riscv: Fix remaining asm checks
Browse files Browse the repository at this point in the history
There are additional asm checks which don't check for OPENSSL_CPUID_OBJ
causing the build to still fail on riscv [1], so fix them in the same
manner as ff27959

[1] https://bugs.gentoo.org/923956
Fixes: #22871

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #23752)
  • Loading branch information
jsmolic authored and t8m committed Mar 22, 2024
1 parent e10aa4b commit daf1f8d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions providers/implementations/ciphers/cipher_aes_gcm_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ static const PROV_GCM_HW aes_gcm = {
# include "cipher_aes_gcm_hw_armv8.inc"
#elif defined(PPC_AES_GCM_CAPABLE) && defined(_ARCH_PPC64)
# include "cipher_aes_gcm_hw_ppc.inc"
#elif defined(__riscv) && __riscv_xlen == 64
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
# include "cipher_aes_gcm_hw_rv64i.inc"
#elif defined(__riscv) && __riscv_xlen == 32
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
# include "cipher_aes_gcm_hw_rv32i.inc"
#else
const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
Expand Down
4 changes: 2 additions & 2 deletions providers/implementations/ciphers/cipher_aes_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_##mode(size_t keybits) \
# include "cipher_aes_hw_t4.inc"
#elif defined(S390X_aes_128_CAPABLE)
# include "cipher_aes_hw_s390x.inc"
#elif defined(__riscv) && __riscv_xlen == 64
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
# include "cipher_aes_hw_rv64i.inc"
#elif defined(__riscv) && __riscv_xlen == 32
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
# include "cipher_aes_hw_rv32i.inc"
#elif defined (ARMv8_HWAES_CAPABLE)
# include "cipher_aes_hw_armv8.inc"
Expand Down
4 changes: 2 additions & 2 deletions providers/implementations/ciphers/cipher_aes_ocb_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static const PROV_CIPHER_HW aes_t4_ocb = { \
if (SPARC_AES_CAPABLE) \
return &aes_t4_ocb;

#elif defined(__riscv) && __riscv_xlen == 64
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64

static int cipher_hw_aes_ocb_rv64i_zknd_zkne_initkey(PROV_CIPHER_CTX *vctx,
const unsigned char *key,
Expand Down Expand Up @@ -152,7 +152,7 @@ static const PROV_CIPHER_HW aes_rv64i_zvkned_ocb = { \
else if (RISCV_HAS_ZKND_AND_ZKNE()) \
return &aes_rv64i_zknd_zkne_ocb;

#elif defined(__riscv) && __riscv_xlen == 32
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32

static int cipher_hw_aes_ocb_rv32i_zknd_zkne_initkey(PROV_CIPHER_CTX *vctx,
const unsigned char *key,
Expand Down
4 changes: 2 additions & 2 deletions providers/implementations/ciphers/cipher_aes_xts_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static const PROV_CIPHER_HW aes_xts_t4 = { \
if (SPARC_AES_CAPABLE) \
return &aes_xts_t4;

#elif defined(__riscv) && __riscv_xlen == 64
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64

static int cipher_hw_aes_xts_rv64i_zknd_zkne_initkey(PROV_CIPHER_CTX *ctx,
const unsigned char *key,
Expand Down Expand Up @@ -245,7 +245,7 @@ if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128) \
else if (RISCV_HAS_ZKND_AND_ZKNE()) \
return &aes_xts_rv64i_zknd_zkne;

#elif defined(__riscv) && __riscv_xlen == 32
#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32

static int cipher_hw_aes_xts_rv32i_zknd_zkne_initkey(PROV_CIPHER_CTX *ctx,
const unsigned char *key,
Expand Down

0 comments on commit daf1f8d

Please sign in to comment.