Remove uses of OPENSSL_INLINE and OPENSSL_UNUSED except for public headers

Except for our public headers, our files no longer need to be consumed
by C. That means inline can just be inline, and with C++17,
OPENSSL_UNUSED can be [[maybe_unused]].

Bug: 42290600
Change-Id: Ibdb309bc413660e10d075fbb71d4d1dd87101c6d
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/74489
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/chacha/internal.h b/crypto/chacha/internal.h
index c2dc75d..c30429c 100644
--- a/crypto/chacha/internal.h
+++ b/crypto/chacha/internal.h
@@ -34,7 +34,7 @@
 #define CHACHA20_ASM_NOHW
 
 #define CHACHA20_ASM_SSSE3
-OPENSSL_INLINE int ChaCha20_ctr32_ssse3_capable(size_t len) {
+inline int ChaCha20_ctr32_ssse3_capable(size_t len) {
   // Unlike the x86_64 version, the x86 SSSE3 routine runs for all non-zero
   // lengths.
   return len > 0 && CRYPTO_is_SSSE3_capable() && CRYPTO_is_FXSR_capable();
@@ -48,7 +48,7 @@
 #define CHACHA20_ASM_NOHW
 
 #define CHACHA20_ASM_NEON
-OPENSSL_INLINE int ChaCha20_ctr32_neon_capable(size_t len) {
+inline int ChaCha20_ctr32_neon_capable(size_t len) {
   return len >= 192 && CRYPTO_is_NEON_capable();
 }
 void ChaCha20_ctr32_neon(uint8_t *out, const uint8_t *in, size_t in_len,
@@ -57,14 +57,14 @@
 #define CHACHA20_ASM_NOHW
 
 #define CHACHA20_ASM_AVX2
-OPENSSL_INLINE int ChaCha20_ctr32_avx2_capable(size_t len) {
+inline int ChaCha20_ctr32_avx2_capable(size_t len) {
   return len > 128 && CRYPTO_is_AVX2_capable();
 }
 void ChaCha20_ctr32_avx2(uint8_t *out, const uint8_t *in, size_t in_len,
                          const uint32_t key[8], const uint32_t counter[4]);
 
 #define CHACHA20_ASM_SSSE3_4X
-OPENSSL_INLINE int ChaCha20_ctr32_ssse3_4x_capable(size_t len) {
+inline int ChaCha20_ctr32_ssse3_4x_capable(size_t len) {
   int capable = len > 128 && CRYPTO_is_SSSE3_capable();
   int faster = len > 192 || !CRYPTO_cpu_perf_is_like_silvermont();
   return capable && faster;
@@ -73,7 +73,7 @@
                              const uint32_t key[8], const uint32_t counter[4]);
 
 #define CHACHA20_ASM_SSSE3
-OPENSSL_INLINE int ChaCha20_ctr32_ssse3_capable(size_t len) {
+inline int ChaCha20_ctr32_ssse3_capable(size_t len) {
   return len > 128 && CRYPTO_is_SSSE3_capable();
 }
 void ChaCha20_ctr32_ssse3(uint8_t *out, const uint8_t *in, size_t in_len,
diff --git a/crypto/cipher_extra/internal.h b/crypto/cipher_extra/internal.h
index 32c0353..bbe6671 100644
--- a/crypto/cipher_extra/internal.h
+++ b/crypto/cipher_extra/internal.h
@@ -179,7 +179,7 @@
 static_assert(sizeof(union chacha20_poly1305_seal_data) == 48 + 8 + 8,
               "wrong chacha20_poly1305_seal_data size");
 
-OPENSSL_INLINE int chacha20_poly1305_asm_capable(void) {
+inline int chacha20_poly1305_asm_capable(void) {
 #if defined(OPENSSL_X86_64)
   return CRYPTO_is_SSE4_1_capable();
 #elif defined(OPENSSL_AARCH64)
@@ -199,7 +199,7 @@
 extern void chacha20_poly1305_open_avx2(
     uint8_t *out_plaintext, const uint8_t *ciphertext, size_t plaintext_len,
     const uint8_t *ad, size_t ad_len, union chacha20_poly1305_open_data *data);
-OPENSSL_INLINE void chacha20_poly1305_open(uint8_t *out_plaintext,
+inline void chacha20_poly1305_open(uint8_t *out_plaintext,
                                    const uint8_t *ciphertext,
                                    size_t plaintext_len, const uint8_t *ad,
                                    size_t ad_len,
@@ -232,9 +232,11 @@
 extern void chacha20_poly1305_seal_avx2(
     uint8_t *out_ciphertext, const uint8_t *plaintext, size_t plaintext_len,
     const uint8_t *ad, size_t ad_len, union chacha20_poly1305_seal_data *data);
-OPENSSL_INLINE void chacha20_poly1305_seal(
-    uint8_t *out_ciphertext, const uint8_t *plaintext, size_t plaintext_len,
-    const uint8_t *ad, size_t ad_len, union chacha20_poly1305_seal_data *data) {
+inline void chacha20_poly1305_seal(uint8_t *out_ciphertext,
+                                   const uint8_t *plaintext,
+                                   size_t plaintext_len, const uint8_t *ad,
+                                   size_t ad_len,
+                                   union chacha20_poly1305_seal_data *data) {
   if (CRYPTO_is_AVX2_capable() && CRYPTO_is_BMI2_capable()) {
     chacha20_poly1305_seal_avx2(out_ciphertext, plaintext, plaintext_len, ad,
                                 ad_len, data);
@@ -253,9 +255,9 @@
 
 #else
 
-OPENSSL_INLINE int chacha20_poly1305_asm_capable(void) { return 0; }
+inline int chacha20_poly1305_asm_capable(void) { return 0; }
 
-OPENSSL_INLINE void chacha20_poly1305_open(uint8_t *out_plaintext,
+inline void chacha20_poly1305_open(uint8_t *out_plaintext,
                                    const uint8_t *ciphertext,
                                    size_t plaintext_len, const uint8_t *ad,
                                    size_t ad_len,
@@ -263,7 +265,7 @@
   abort();
 }
 
-OPENSSL_INLINE void chacha20_poly1305_seal(uint8_t *out_ciphertext,
+inline void chacha20_poly1305_seal(uint8_t *out_ciphertext,
                                    const uint8_t *plaintext,
                                    size_t plaintext_len, const uint8_t *ad,
                                    size_t ad_len,
diff --git a/crypto/ec_extra/hash_to_curve.cc b/crypto/ec_extra/hash_to_curve.cc
index 5058040..ca70049 100644
--- a/crypto/ec_extra/hash_to_curve.cc
+++ b/crypto/ec_extra/hash_to_curve.cc
@@ -228,7 +228,7 @@
   return buf[len - 1] & 1;
 }
 
-OPENSSL_UNUSED static int is_3mod4(const EC_GROUP *group) {
+[[maybe_unused]] static int is_3mod4(const EC_GROUP *group) {
   return group->field.N.width > 0 && (group->field.N.d[0] & 3) == 3;
 }
 
diff --git a/crypto/fipsmodule/aes/internal.h b/crypto/fipsmodule/aes/internal.h
index fa5ba87..6d56b11 100644
--- a/crypto/fipsmodule/aes/internal.h
+++ b/crypto/fipsmodule/aes/internal.h
@@ -58,28 +58,28 @@
 #define HWAES
 #define HWAES_ECB
 
-OPENSSL_INLINE int hwaes_capable(void) { return CRYPTO_is_AESNI_capable(); }
+inline int hwaes_capable(void) { return CRYPTO_is_AESNI_capable(); }
 
 #define VPAES
 #define VPAES_CBC
-OPENSSL_INLINE int vpaes_capable(void) { return CRYPTO_is_SSSE3_capable(); }
+inline int vpaes_capable(void) { return CRYPTO_is_SSSE3_capable(); }
 
 #elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)
 #define HWAES
 
-OPENSSL_INLINE int hwaes_capable(void) { return CRYPTO_is_ARMv8_AES_capable(); }
+inline int hwaes_capable(void) { return CRYPTO_is_ARMv8_AES_capable(); }
 
 #if defined(OPENSSL_ARM)
 #define BSAES
 #define VPAES
-OPENSSL_INLINE int bsaes_capable(void) { return CRYPTO_is_NEON_capable(); }
-OPENSSL_INLINE int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); }
+inline int bsaes_capable(void) { return CRYPTO_is_NEON_capable(); }
+inline int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); }
 #endif
 
 #if defined(OPENSSL_AARCH64)
 #define VPAES
 #define VPAES_CBC
-OPENSSL_INLINE int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); }
+inline int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); }
 #endif
 
 #endif
@@ -113,10 +113,10 @@
 // worthwhile. However, the aesenclast version requires SSSE3. SSSE3 long
 // predates AES-NI, but it's not clear if AES-NI implies SSSE3. In OpenSSL, the
 // CCM AES-NI assembly seems to assume it does.
-OPENSSL_INLINE int aes_hw_set_encrypt_key_alt_capable(void) {
+inline int aes_hw_set_encrypt_key_alt_capable(void) {
   return hwaes_capable() && CRYPTO_is_SSSE3_capable();
 }
-OPENSSL_INLINE int aes_hw_set_encrypt_key_alt_preferred(void) {
+inline int aes_hw_set_encrypt_key_alt_preferred(void) {
   return hwaes_capable() && CRYPTO_is_AVX_capable();
 }
 int aes_hw_set_encrypt_key_base(const uint8_t *user_key, int bits,
@@ -128,37 +128,36 @@
 
 // If HWAES isn't defined then we provide dummy functions for each of the hwaes
 // functions.
-OPENSSL_INLINE int hwaes_capable(void) { return 0; }
+inline int hwaes_capable(void) { return 0; }
 
-OPENSSL_INLINE int aes_hw_set_encrypt_key(const uint8_t *user_key, int bits,
-                                          AES_KEY *key) {
+inline int aes_hw_set_encrypt_key(const uint8_t *user_key, int bits,
+                                  AES_KEY *key) {
   abort();
 }
 
-OPENSSL_INLINE int aes_hw_set_decrypt_key(const uint8_t *user_key, int bits,
-                                          AES_KEY *key) {
+inline int aes_hw_set_decrypt_key(const uint8_t *user_key, int bits,
+                                  AES_KEY *key) {
   abort();
 }
 
-OPENSSL_INLINE void aes_hw_encrypt(const uint8_t *in, uint8_t *out,
-                                   const AES_KEY *key) {
+inline void aes_hw_encrypt(const uint8_t *in, uint8_t *out,
+                           const AES_KEY *key) {
   abort();
 }
 
-OPENSSL_INLINE void aes_hw_decrypt(const uint8_t *in, uint8_t *out,
-                                   const AES_KEY *key) {
+inline void aes_hw_decrypt(const uint8_t *in, uint8_t *out,
+                           const AES_KEY *key) {
   abort();
 }
 
-OPENSSL_INLINE void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out,
-                                       size_t length, const AES_KEY *key,
-                                       uint8_t *ivec, int enc) {
+inline void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length,
+                               const AES_KEY *key, uint8_t *ivec, int enc) {
   abort();
 }
 
-OPENSSL_INLINE void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
-                                                size_t len, const AES_KEY *key,
-                                                const uint8_t ivec[16]) {
+inline void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
+                                        size_t len, const AES_KEY *key,
+                                        const uint8_t ivec[16]) {
   abort();
 }
 
@@ -184,29 +183,28 @@
                                            size_t blocks, const AES_KEY *key,
                                            const uint8_t ivec[16]);
 #else
-OPENSSL_INLINE char bsaes_capable(void) { return 0; }
+inline int bsaes_capable(void) { return 0; }
 
 // On other platforms, bsaes_capable() will always return false and so the
 // following will never be called.
-OPENSSL_INLINE void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out,
-                                      size_t length, const AES_KEY *key,
-                                      uint8_t ivec[16], int enc) {
+inline void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length,
+                              const AES_KEY *key, uint8_t ivec[16], int enc) {
   abort();
 }
 
-OPENSSL_INLINE void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
-                                               size_t len, const AES_KEY *key,
-                                               const uint8_t ivec[16]) {
+inline void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
+                                       size_t len, const AES_KEY *key,
+                                       const uint8_t ivec[16]) {
   abort();
 }
 
-OPENSSL_INLINE void vpaes_encrypt_key_to_bsaes(AES_KEY *out_bsaes,
-                                               const AES_KEY *vpaes) {
+inline void vpaes_encrypt_key_to_bsaes(AES_KEY *out_bsaes,
+                                       const AES_KEY *vpaes) {
   abort();
 }
 
-OPENSSL_INLINE void vpaes_decrypt_key_to_bsaes(AES_KEY *out_bsaes,
-                                               const AES_KEY *vpaes) {
+inline void vpaes_decrypt_key_to_bsaes(AES_KEY *out_bsaes,
+                                       const AES_KEY *vpaes) {
   abort();
 }
 #endif  // !BSAES
@@ -228,34 +226,31 @@
 void vpaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len,
                                 const AES_KEY *key, const uint8_t ivec[16]);
 #else
-OPENSSL_INLINE char vpaes_capable(void) { return 0; }
+inline int vpaes_capable(void) { return 0; }
 
 // On other platforms, vpaes_capable() will always return false and so the
 // following will never be called.
-OPENSSL_INLINE int vpaes_set_encrypt_key(const uint8_t *userKey, int bits,
-                                         AES_KEY *key) {
+inline int vpaes_set_encrypt_key(const uint8_t *userKey, int bits,
+                                 AES_KEY *key) {
   abort();
 }
-OPENSSL_INLINE int vpaes_set_decrypt_key(const uint8_t *userKey, int bits,
-                                         AES_KEY *key) {
+inline int vpaes_set_decrypt_key(const uint8_t *userKey, int bits,
+                                 AES_KEY *key) {
   abort();
 }
-OPENSSL_INLINE void vpaes_encrypt(const uint8_t *in, uint8_t *out,
-                                  const AES_KEY *key) {
+inline void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) {
   abort();
 }
-OPENSSL_INLINE void vpaes_decrypt(const uint8_t *in, uint8_t *out,
-                                  const AES_KEY *key) {
+inline void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) {
   abort();
 }
-OPENSSL_INLINE void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out,
-                                      size_t length, const AES_KEY *key,
-                                      uint8_t *ivec, int enc) {
+inline void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length,
+                              const AES_KEY *key, uint8_t *ivec, int enc) {
   abort();
 }
-OPENSSL_INLINE void vpaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
-                                               size_t len, const AES_KEY *key,
-                                               const uint8_t ivec[16]) {
+inline void vpaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
+                                       size_t len, const AES_KEY *key,
+                                       const uint8_t ivec[16]) {
   abort();
 }
 #endif  // !VPAES
diff --git a/crypto/fipsmodule/bcm_interface.h b/crypto/fipsmodule/bcm_interface.h
index 840afe9..544135b 100644
--- a/crypto/fipsmodule/bcm_interface.h
+++ b/crypto/fipsmodule/bcm_interface.h
@@ -47,11 +47,11 @@
 typedef enum bcm_status_t bcm_status;
 typedef enum bcm_infallible_t bcm_infallible;
 
-OPENSSL_INLINE int bcm_success(bcm_status status) {
+inline int bcm_success(bcm_status status) {
   return status == bcm_status::approved || status == bcm_status::not_approved;
 }
 
-OPENSSL_INLINE bcm_status_t bcm_as_approved_status(int result) {
+inline bcm_status_t bcm_as_approved_status(int result) {
   return result ? bcm_status::approved : bcm_status::failure;
 }
 
diff --git a/crypto/fipsmodule/bn/internal.h b/crypto/fipsmodule/bn/internal.h
index 679e249..fbff65d 100644
--- a/crypto/fipsmodule/bn/internal.h
+++ b/crypto/fipsmodule/bn/internal.h
@@ -273,13 +273,13 @@
 
 // bn_secret marks |bn|'s contents, but not its width or sign, as secret. See
 // |CONSTTIME_SECRET| for details.
-OPENSSL_INLINE void bn_secret(BIGNUM *bn) {
+inline void bn_secret(BIGNUM *bn) {
   CONSTTIME_SECRET(bn->d, bn->width * sizeof(BN_ULONG));
 }
 
 // bn_declassify marks |bn|'s value as public. See |CONSTTIME_DECLASSIFY| for
 // details.
-OPENSSL_INLINE void bn_declassify(BIGNUM *bn) {
+inline void bn_declassify(BIGNUM *bn) {
   CONSTTIME_DECLASSIFY(bn->d, bn->width * sizeof(BN_ULONG));
 }
 
@@ -402,29 +402,29 @@
                 const BN_ULONG *np, const BN_ULONG *n0, size_t num);
 
 #if defined(OPENSSL_X86_64)
-OPENSSL_INLINE int bn_mulx_adx_capable(void) {
+inline int bn_mulx_adx_capable(void) {
   // MULX is in BMI2.
   return CRYPTO_is_BMI2_capable() && CRYPTO_is_ADX_capable();
 }
 int bn_mul_mont_nohw(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
                      const BN_ULONG *np, const BN_ULONG *n0, size_t num);
-OPENSSL_INLINE int bn_mul4x_mont_capable(size_t num) {
+inline int bn_mul4x_mont_capable(size_t num) {
   return num >= 8 && (num & 3) == 0;
 }
 int bn_mul4x_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
                   const BN_ULONG *np, const BN_ULONG *n0, size_t num);
-OPENSSL_INLINE int bn_mulx4x_mont_capable(size_t num) {
+inline int bn_mulx4x_mont_capable(size_t num) {
   return bn_mul4x_mont_capable(num) && bn_mulx_adx_capable();
 }
 int bn_mulx4x_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
                    const BN_ULONG *np, const BN_ULONG *n0, size_t num);
-OPENSSL_INLINE int bn_sqr8x_mont_capable(size_t num) {
+inline int bn_sqr8x_mont_capable(size_t num) {
   return num >= 8 && (num & 7) == 0;
 }
 int bn_sqr8x_mont(BN_ULONG *rp, const BN_ULONG *ap, BN_ULONG mulx_adx_capable,
                   const BN_ULONG *np, const BN_ULONG *n0, size_t num);
 #elif defined(OPENSSL_ARM)
-OPENSSL_INLINE int bn_mul8x_mont_neon_capable(size_t num) {
+inline int bn_mul8x_mont_neon_capable(size_t num) {
   return (num & 7) == 0 && CRYPTO_is_NEON_capable();
 }
 int bn_mul8x_mont_neon(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
@@ -440,14 +440,12 @@
 
 // The following functions implement |bn_mul_mont_gather5|. See
 // |bn_mul_mont_gather5| for details.
-OPENSSL_INLINE int bn_mul4x_mont_gather5_capable(int num) {
-  return (num & 7) == 0;
-}
+inline int bn_mul4x_mont_gather5_capable(int num) { return (num & 7) == 0; }
 void bn_mul4x_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap,
                            const BN_ULONG *table, const BN_ULONG *np,
                            const BN_ULONG *n0, int num, int power);
 
-OPENSSL_INLINE int bn_mulx4x_mont_gather5_capable(int num) {
+inline int bn_mulx4x_mont_gather5_capable(int num) {
   return bn_mul4x_mont_gather5_capable(num) && CRYPTO_is_ADX_capable() &&
          CRYPTO_is_BMI1_capable() && CRYPTO_is_BMI2_capable();
 }
@@ -475,9 +473,9 @@
 void bn_power5_nohw(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *table,
                     const BN_ULONG *np, const BN_ULONG *n0, int num, int power);
 
-OPENSSL_INLINE int bn_power5_capable(int num) { return (num & 7) == 0; }
+inline int bn_power5_capable(int num) { return (num & 7) == 0; }
 
-OPENSSL_INLINE int bn_powerx5_capable(int num) {
+inline int bn_powerx5_capable(int num) {
   return bn_power5_capable(num) && CRYPTO_is_ADX_capable() &&
          CRYPTO_is_BMI1_capable() && CRYPTO_is_BMI2_capable();
 }
diff --git a/crypto/fipsmodule/bn/rsaz_exp.h b/crypto/fipsmodule/bn/rsaz_exp.h
index 22ca3ec..8028b16 100644
--- a/crypto/fipsmodule/bn/rsaz_exp.h
+++ b/crypto/fipsmodule/bn/rsaz_exp.h
@@ -39,11 +39,9 @@
                             BN_ULONG k0,
                             BN_ULONG storage_words[MOD_EXP_CTIME_STORAGE_LEN]);
 
-OPENSSL_INLINE int rsaz_avx2_capable(void) {
-  return CRYPTO_is_AVX2_capable();
-}
+inline int rsaz_avx2_capable(void) { return CRYPTO_is_AVX2_capable(); }
 
-OPENSSL_INLINE int rsaz_avx2_preferred(void) {
+inline int rsaz_avx2_preferred(void) {
   if (CRYPTO_is_BMI1_capable() && CRYPTO_is_BMI2_capable() &&
       CRYPTO_is_ADX_capable()) {
     // If BMI1, BMI2, and ADX are available, x86_64-mont5.pl is faster. See the
diff --git a/crypto/fipsmodule/ec/builtin_curves.h b/crypto/fipsmodule/ec/builtin_curves.h
index 61fd4f9..b5fdabc 100644
--- a/crypto/fipsmodule/ec/builtin_curves.h
+++ b/crypto/fipsmodule/ec/builtin_curves.h
@@ -15,74 +15,74 @@
 // This file is generated by make_tables.go.
 
 // P-224
-OPENSSL_UNUSED static const uint64_t kP224FieldN0 = 0xffffffffffffffff;
-OPENSSL_UNUSED static const uint64_t kP224OrderN0 = 0xd6e242706a1fc2eb;
+[[maybe_unused]] static const uint64_t kP224FieldN0 = 0xffffffffffffffff;
+[[maybe_unused]] static const uint64_t kP224OrderN0 = 0xd6e242706a1fc2eb;
 #if defined(OPENSSL_64_BIT)
-OPENSSL_UNUSED static const uint64_t kP224Field[] = {
+[[maybe_unused]] static const uint64_t kP224Field[] = {
     0x0000000000000001, 0xffffffff00000000, 0xffffffffffffffff,
     0x00000000ffffffff};
-OPENSSL_UNUSED static const uint64_t kP224Order[] = {
+[[maybe_unused]] static const uint64_t kP224Order[] = {
     0x13dd29455c5c2a3d, 0xffff16a2e0b8f03e, 0xffffffffffffffff,
     0x00000000ffffffff};
-OPENSSL_UNUSED static const uint64_t kP224B[] = {
+[[maybe_unused]] static const uint64_t kP224B[] = {
     0x270b39432355ffb4, 0x5044b0b7d7bfd8ba, 0x0c04b3abf5413256,
     0x00000000b4050a85};
-OPENSSL_UNUSED static const uint64_t kP224GX[] = {
+[[maybe_unused]] static const uint64_t kP224GX[] = {
     0x343280d6115c1d21, 0x4a03c1d356c21122, 0x6bb4bf7f321390b9,
     0x00000000b70e0cbd};
-OPENSSL_UNUSED static const uint64_t kP224GY[] = {
+[[maybe_unused]] static const uint64_t kP224GY[] = {
     0x44d5819985007e34, 0xcd4375a05a074764, 0xb5f723fb4c22dfe6,
     0x00000000bd376388};
-OPENSSL_UNUSED static const uint64_t kP224FieldR[] = {
+[[maybe_unused]] static const uint64_t kP224FieldR[] = {
     0xffffffff00000000, 0xffffffffffffffff, 0x0000000000000000,
     0x0000000000000000};
-OPENSSL_UNUSED static const uint64_t kP224FieldRR[] = {
+[[maybe_unused]] static const uint64_t kP224FieldRR[] = {
     0xffffffff00000001, 0xffffffff00000000, 0xfffffffe00000000,
     0x00000000ffffffff};
-OPENSSL_UNUSED static const uint64_t kP224OrderRR[] = {
+[[maybe_unused]] static const uint64_t kP224OrderRR[] = {
     0x29947a695f517d15, 0xabc8ff5931d63f4b, 0x6ad15f7cd9714856,
     0x00000000b1e97961};
-OPENSSL_UNUSED static const uint64_t kP224MontB[] = {
+[[maybe_unused]] static const uint64_t kP224MontB[] = {
     0xe768cdf663c059cd, 0x107ac2f3ccf01310, 0x3dceba98c8528151,
     0x000000007fc02f93};
-OPENSSL_UNUSED static const uint64_t kP224MontGX[] = {
+[[maybe_unused]] static const uint64_t kP224MontGX[] = {
     0xbc9052266d0a4aea, 0x852597366018bfaa, 0x6dd3af9bf96bec05,
     0x00000000a21b5e60};
-OPENSSL_UNUSED static const uint64_t kP224MontGY[] = {
+[[maybe_unused]] static const uint64_t kP224MontGY[] = {
     0x2edca1e5eff3ede8, 0xf8cd672b05335a6b, 0xaea9c5ae03dfe878,
     0x00000000614786f1};
 #elif defined(OPENSSL_32_BIT)
-OPENSSL_UNUSED static const uint32_t kP224Field[] = {
+[[maybe_unused]] static const uint32_t kP224Field[] = {
     0x00000001, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
     0xffffffff};
-OPENSSL_UNUSED static const uint32_t kP224Order[] = {
+[[maybe_unused]] static const uint32_t kP224Order[] = {
     0x5c5c2a3d, 0x13dd2945, 0xe0b8f03e, 0xffff16a2, 0xffffffff, 0xffffffff,
     0xffffffff};
-OPENSSL_UNUSED static const uint32_t kP224B[] = {
+[[maybe_unused]] static const uint32_t kP224B[] = {
     0x2355ffb4, 0x270b3943, 0xd7bfd8ba, 0x5044b0b7, 0xf5413256, 0x0c04b3ab,
     0xb4050a85};
-OPENSSL_UNUSED static const uint32_t kP224GX[] = {
+[[maybe_unused]] static const uint32_t kP224GX[] = {
     0x115c1d21, 0x343280d6, 0x56c21122, 0x4a03c1d3, 0x321390b9, 0x6bb4bf7f,
     0xb70e0cbd};
-OPENSSL_UNUSED static const uint32_t kP224GY[] = {
+[[maybe_unused]] static const uint32_t kP224GY[] = {
     0x85007e34, 0x44d58199, 0x5a074764, 0xcd4375a0, 0x4c22dfe6, 0xb5f723fb,
     0xbd376388};
-OPENSSL_UNUSED static const uint32_t kP224FieldR[] = {
+[[maybe_unused]] static const uint32_t kP224FieldR[] = {
     0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
     0x00000000};
-OPENSSL_UNUSED static const uint32_t kP224FieldRR[] = {
+[[maybe_unused]] static const uint32_t kP224FieldRR[] = {
     0x00000001, 0x00000000, 0x00000000, 0xfffffffe, 0xffffffff, 0xffffffff,
     0x00000000};
-OPENSSL_UNUSED static const uint32_t kP224OrderRR[] = {
+[[maybe_unused]] static const uint32_t kP224OrderRR[] = {
     0x3ad01289, 0x6bdaae6c, 0x97a54552, 0x6ad09d91, 0xb1e97961, 0x1822bc47,
     0xd4baa4cf};
-OPENSSL_UNUSED static const uint32_t kP224MontB[] = {
+[[maybe_unused]] static const uint32_t kP224MontB[] = {
     0xe768cdf7, 0xccf01310, 0x743b1cc0, 0xc8528150, 0x3dceba98, 0x7fc02f93,
     0x9c3fa633};
-OPENSSL_UNUSED static const uint32_t kP224MontGX[] = {
+[[maybe_unused]] static const uint32_t kP224MontGX[] = {
     0xbc905227, 0x6018bfaa, 0xf22fe220, 0xf96bec04, 0x6dd3af9b, 0xa21b5e60,
     0x92f5b516};
-OPENSSL_UNUSED static const uint32_t kP224MontGY[] = {
+[[maybe_unused]] static const uint32_t kP224MontGY[] = {
     0x2edca1e6, 0x05335a6b, 0xe8c15513, 0x03dfe878, 0xaea9c5ae, 0x614786f1,
     0x100c1218};
 #else
@@ -90,56 +90,56 @@
 #endif
 
 // P-256
-OPENSSL_UNUSED static const uint64_t kP256FieldN0 = 0x0000000000000001;
-OPENSSL_UNUSED static const uint64_t kP256OrderN0 = 0xccd1c8aaee00bc4f;
+[[maybe_unused]] static const uint64_t kP256FieldN0 = 0x0000000000000001;
+[[maybe_unused]] static const uint64_t kP256OrderN0 = 0xccd1c8aaee00bc4f;
 #if defined(OPENSSL_64_BIT)
-OPENSSL_UNUSED static const uint64_t kP256Field[] = {
+[[maybe_unused]] static const uint64_t kP256Field[] = {
     0xffffffffffffffff, 0x00000000ffffffff, 0x0000000000000000,
     0xffffffff00000001};
-OPENSSL_UNUSED static const uint64_t kP256Order[] = {
+[[maybe_unused]] static const uint64_t kP256Order[] = {
     0xf3b9cac2fc632551, 0xbce6faada7179e84, 0xffffffffffffffff,
     0xffffffff00000000};
-OPENSSL_UNUSED static const uint64_t kP256FieldR[] = {
+[[maybe_unused]] static const uint64_t kP256FieldR[] = {
     0x0000000000000001, 0xffffffff00000000, 0xffffffffffffffff,
     0x00000000fffffffe};
-OPENSSL_UNUSED static const uint64_t kP256FieldRR[] = {
+[[maybe_unused]] static const uint64_t kP256FieldRR[] = {
     0x0000000000000003, 0xfffffffbffffffff, 0xfffffffffffffffe,
     0x00000004fffffffd};
-OPENSSL_UNUSED static const uint64_t kP256OrderRR[] = {
+[[maybe_unused]] static const uint64_t kP256OrderRR[] = {
     0x83244c95be79eea2, 0x4699799c49bd6fa6, 0x2845b2392b6bec59,
     0x66e12d94f3d95620};
-OPENSSL_UNUSED static const uint64_t kP256MontB[] = {
+[[maybe_unused]] static const uint64_t kP256MontB[] = {
     0xd89cdf6229c4bddf, 0xacf005cd78843090, 0xe5a220abf7212ed6,
     0xdc30061d04874834};
-OPENSSL_UNUSED static const uint64_t kP256MontGX[] = {
+[[maybe_unused]] static const uint64_t kP256MontGX[] = {
     0x79e730d418a9143c, 0x75ba95fc5fedb601, 0x79fb732b77622510,
     0x18905f76a53755c6};
-OPENSSL_UNUSED static const uint64_t kP256MontGY[] = {
+[[maybe_unused]] static const uint64_t kP256MontGY[] = {
     0xddf25357ce95560a, 0x8b4ab8e4ba19e45c, 0xd2e88688dd21f325,
     0x8571ff1825885d85};
 #elif defined(OPENSSL_32_BIT)
-OPENSSL_UNUSED static const uint32_t kP256Field[] = {
+[[maybe_unused]] static const uint32_t kP256Field[] = {
     0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
     0x00000001, 0xffffffff};
-OPENSSL_UNUSED static const uint32_t kP256Order[] = {
+[[maybe_unused]] static const uint32_t kP256Order[] = {
     0xfc632551, 0xf3b9cac2, 0xa7179e84, 0xbce6faad, 0xffffffff, 0xffffffff,
     0x00000000, 0xffffffff};
-OPENSSL_UNUSED static const uint32_t kP256FieldR[] = {
+[[maybe_unused]] static const uint32_t kP256FieldR[] = {
     0x00000001, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
     0xfffffffe, 0x00000000};
-OPENSSL_UNUSED static const uint32_t kP256FieldRR[] = {
+[[maybe_unused]] static const uint32_t kP256FieldRR[] = {
     0x00000003, 0x00000000, 0xffffffff, 0xfffffffb, 0xfffffffe, 0xffffffff,
     0xfffffffd, 0x00000004};
-OPENSSL_UNUSED static const uint32_t kP256OrderRR[] = {
+[[maybe_unused]] static const uint32_t kP256OrderRR[] = {
     0xbe79eea2, 0x83244c95, 0x49bd6fa6, 0x4699799c, 0x2b6bec59, 0x2845b239,
     0xf3d95620, 0x66e12d94};
-OPENSSL_UNUSED static const uint32_t kP256MontB[] = {
+[[maybe_unused]] static const uint32_t kP256MontB[] = {
     0x29c4bddf, 0xd89cdf62, 0x78843090, 0xacf005cd, 0xf7212ed6, 0xe5a220ab,
     0x04874834, 0xdc30061d};
-OPENSSL_UNUSED static const uint32_t kP256MontGX[] = {
+[[maybe_unused]] static const uint32_t kP256MontGX[] = {
     0x18a9143c, 0x79e730d4, 0x5fedb601, 0x75ba95fc, 0x77622510, 0x79fb732b,
     0xa53755c6, 0x18905f76};
-OPENSSL_UNUSED static const uint32_t kP256MontGY[] = {
+[[maybe_unused]] static const uint32_t kP256MontGY[] = {
     0xce95560a, 0xddf25357, 0xba19e45c, 0x8b4ab8e4, 0xdd21f325, 0xd2e88688,
     0x25885d85, 0x8571ff18};
 #else
@@ -147,56 +147,56 @@
 #endif
 
 // P-384
-OPENSSL_UNUSED static const uint64_t kP384FieldN0 = 0x0000000100000001;
-OPENSSL_UNUSED static const uint64_t kP384OrderN0 = 0x6ed46089e88fdc45;
+[[maybe_unused]] static const uint64_t kP384FieldN0 = 0x0000000100000001;
+[[maybe_unused]] static const uint64_t kP384OrderN0 = 0x6ed46089e88fdc45;
 #if defined(OPENSSL_64_BIT)
-OPENSSL_UNUSED static const uint64_t kP384Field[] = {
+[[maybe_unused]] static const uint64_t kP384Field[] = {
     0x00000000ffffffff, 0xffffffff00000000, 0xfffffffffffffffe,
     0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};
-OPENSSL_UNUSED static const uint64_t kP384Order[] = {
+[[maybe_unused]] static const uint64_t kP384Order[] = {
     0xecec196accc52973, 0x581a0db248b0a77a, 0xc7634d81f4372ddf,
     0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};
-OPENSSL_UNUSED static const uint64_t kP384FieldR[] = {
+[[maybe_unused]] static const uint64_t kP384FieldR[] = {
     0xffffffff00000001, 0x00000000ffffffff, 0x0000000000000001,
     0x0000000000000000, 0x0000000000000000, 0x0000000000000000};
-OPENSSL_UNUSED static const uint64_t kP384FieldRR[] = {
+[[maybe_unused]] static const uint64_t kP384FieldRR[] = {
     0xfffffffe00000001, 0x0000000200000000, 0xfffffffe00000000,
     0x0000000200000000, 0x0000000000000001, 0x0000000000000000};
-OPENSSL_UNUSED static const uint64_t kP384OrderRR[] = {
+[[maybe_unused]] static const uint64_t kP384OrderRR[] = {
     0x2d319b2419b409a9, 0xff3d81e5df1aa419, 0xbc3e483afcb82947,
     0xd40d49174aab1cc5, 0x3fb05b7a28266895, 0x0c84ee012b39bf21};
-OPENSSL_UNUSED static const uint64_t kP384MontB[] = {
+[[maybe_unused]] static const uint64_t kP384MontB[] = {
     0x081188719d412dcc, 0xf729add87a4c32ec, 0x77f2209b1920022e,
     0xe3374bee94938ae2, 0xb62b21f41f022094, 0xcd08114b604fbff9};
-OPENSSL_UNUSED static const uint64_t kP384MontGX[] = {
+[[maybe_unused]] static const uint64_t kP384MontGX[] = {
     0x3dd0756649c0b528, 0x20e378e2a0d6ce38, 0x879c3afc541b4d6e,
     0x6454868459a30eff, 0x812ff723614ede2b, 0x4d3aadc2299e1513};
-OPENSSL_UNUSED static const uint64_t kP384MontGY[] = {
+[[maybe_unused]] static const uint64_t kP384MontGY[] = {
     0x23043dad4b03a4fe, 0xa1bfa8bf7bb4a9ac, 0x8bade7562e83b050,
     0xc6c3521968f4ffd9, 0xdd8002263969a840, 0x2b78abc25a15c5e9};
 #elif defined(OPENSSL_32_BIT)
-OPENSSL_UNUSED static const uint32_t kP384Field[] = {
+[[maybe_unused]] static const uint32_t kP384Field[] = {
     0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xfffffffe, 0xffffffff,
     0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
-OPENSSL_UNUSED static const uint32_t kP384Order[] = {
+[[maybe_unused]] static const uint32_t kP384Order[] = {
     0xccc52973, 0xecec196a, 0x48b0a77a, 0x581a0db2, 0xf4372ddf, 0xc7634d81,
     0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
-OPENSSL_UNUSED static const uint32_t kP384FieldR[] = {
+[[maybe_unused]] static const uint32_t kP384FieldR[] = {
     0x00000001, 0xffffffff, 0xffffffff, 0x00000000, 0x00000001, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000};
-OPENSSL_UNUSED static const uint32_t kP384FieldRR[] = {
+[[maybe_unused]] static const uint32_t kP384FieldRR[] = {
     0x00000001, 0xfffffffe, 0x00000000, 0x00000002, 0x00000000, 0xfffffffe,
     0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000000, 0x00000000};
-OPENSSL_UNUSED static const uint32_t kP384OrderRR[] = {
+[[maybe_unused]] static const uint32_t kP384OrderRR[] = {
     0x19b409a9, 0x2d319b24, 0xdf1aa419, 0xff3d81e5, 0xfcb82947, 0xbc3e483a,
     0x4aab1cc5, 0xd40d4917, 0x28266895, 0x3fb05b7a, 0x2b39bf21, 0x0c84ee01};
-OPENSSL_UNUSED static const uint32_t kP384MontB[] = {
+[[maybe_unused]] static const uint32_t kP384MontB[] = {
     0x9d412dcc, 0x08118871, 0x7a4c32ec, 0xf729add8, 0x1920022e, 0x77f2209b,
     0x94938ae2, 0xe3374bee, 0x1f022094, 0xb62b21f4, 0x604fbff9, 0xcd08114b};
-OPENSSL_UNUSED static const uint32_t kP384MontGX[] = {
+[[maybe_unused]] static const uint32_t kP384MontGX[] = {
     0x49c0b528, 0x3dd07566, 0xa0d6ce38, 0x20e378e2, 0x541b4d6e, 0x879c3afc,
     0x59a30eff, 0x64548684, 0x614ede2b, 0x812ff723, 0x299e1513, 0x4d3aadc2};
-OPENSSL_UNUSED static const uint32_t kP384MontGY[] = {
+[[maybe_unused]] static const uint32_t kP384MontGY[] = {
     0x4b03a4fe, 0x23043dad, 0x7bb4a9ac, 0xa1bfa8bf, 0x2e83b050, 0x8bade756,
     0x68f4ffd9, 0xc6c35219, 0x3969a840, 0xdd800226, 0x5a15c5e9, 0x2b78abc2};
 #else
@@ -204,71 +204,71 @@
 #endif
 
 // P-521
-OPENSSL_UNUSED static const uint64_t kP521FieldN0 = 0x0000000000000001;
-OPENSSL_UNUSED static const uint64_t kP521OrderN0 = 0x1d2f5ccd79a995c7;
+[[maybe_unused]] static const uint64_t kP521FieldN0 = 0x0000000000000001;
+[[maybe_unused]] static const uint64_t kP521OrderN0 = 0x1d2f5ccd79a995c7;
 #if defined(OPENSSL_64_BIT)
-OPENSSL_UNUSED static const uint64_t kP521Field[] = {
+[[maybe_unused]] static const uint64_t kP521Field[] = {
     0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
     0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
     0xffffffffffffffff, 0xffffffffffffffff, 0x00000000000001ff};
-OPENSSL_UNUSED static const uint64_t kP521Order[] = {
+[[maybe_unused]] static const uint64_t kP521Order[] = {
     0xbb6fb71e91386409, 0x3bb5c9b8899c47ae, 0x7fcc0148f709a5d0,
     0x51868783bf2f966b, 0xfffffffffffffffa, 0xffffffffffffffff,
     0xffffffffffffffff, 0xffffffffffffffff, 0x00000000000001ff};
-OPENSSL_UNUSED static const uint64_t kP521FieldR[] = {
+[[maybe_unused]] static const uint64_t kP521FieldR[] = {
     0x0080000000000000, 0x0000000000000000, 0x0000000000000000,
     0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
     0x0000000000000000, 0x0000000000000000, 0x0000000000000000};
-OPENSSL_UNUSED static const uint64_t kP521FieldRR[] = {
+[[maybe_unused]] static const uint64_t kP521FieldRR[] = {
     0x0000000000000000, 0x0000400000000000, 0x0000000000000000,
     0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
     0x0000000000000000, 0x0000000000000000, 0x0000000000000000};
-OPENSSL_UNUSED static const uint64_t kP521OrderRR[] = {
+[[maybe_unused]] static const uint64_t kP521OrderRR[] = {
     0x137cd04dcf15dd04, 0xf707badce5547ea3, 0x12a78d38794573ff,
     0xd3721ef557f75e06, 0xdd6e23d82e49c7db, 0xcff3d142b7756e3e,
     0x5bcc6d61a8e567bc, 0x2d8e03d1492d0d45, 0x000000000000003d};
-OPENSSL_UNUSED static const uint64_t kP521MontB[] = {
+[[maybe_unused]] static const uint64_t kP521MontB[] = {
     0x8014654fae586387, 0x78f7a28fea35a81f, 0x839ab9efc41e961a,
     0xbd8b29605e9dd8df, 0xf0ab0c9ca8f63f49, 0xf9dc5a44c8c77884,
     0x77516d392dccd98a, 0x0fc94d10d05b42a0, 0x000000000000004d};
-OPENSSL_UNUSED static const uint64_t kP521MontGX[] = {
+[[maybe_unused]] static const uint64_t kP521MontGX[] = {
     0xb331a16381adc101, 0x4dfcbf3f18e172de, 0x6f19a459e0c2b521,
     0x947f0ee093d17fd4, 0xdd50a5af3bf7f3ac, 0x90fc1457b035a69e,
     0x214e32409c829fda, 0xe6cf1f65b311cada, 0x0000000000000074};
-OPENSSL_UNUSED static const uint64_t kP521MontGY[] = {
+[[maybe_unused]] static const uint64_t kP521MontGY[] = {
     0x28460e4a5a9e268e, 0x20445f4a3b4fe8b3, 0xb09a9e3843513961,
     0x2062a85c809fd683, 0x164bf7394caf7a13, 0x340bd7de8b939f33,
     0xeccc7aa224abcda2, 0x022e452fda163e8d, 0x00000000000001e0};
 #elif defined(OPENSSL_32_BIT)
-OPENSSL_UNUSED static const uint32_t kP521Field[] = {
+[[maybe_unused]] static const uint32_t kP521Field[] = {
     0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x000001ff};
-OPENSSL_UNUSED static const uint32_t kP521Order[] = {
+[[maybe_unused]] static const uint32_t kP521Order[] = {
     0x91386409, 0xbb6fb71e, 0x899c47ae, 0x3bb5c9b8, 0xf709a5d0, 0x7fcc0148,
     0xbf2f966b, 0x51868783, 0xfffffffa, 0xffffffff, 0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x000001ff};
-OPENSSL_UNUSED static const uint32_t kP521FieldR[] = {
+[[maybe_unused]] static const uint32_t kP521FieldR[] = {
     0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000};
-OPENSSL_UNUSED static const uint32_t kP521FieldRR[] = {
+[[maybe_unused]] static const uint32_t kP521FieldRR[] = {
     0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000};
-OPENSSL_UNUSED static const uint32_t kP521OrderRR[] = {
+[[maybe_unused]] static const uint32_t kP521OrderRR[] = {
     0x61c64ca7, 0x1163115a, 0x4374a642, 0x18354a56, 0x0791d9dc, 0x5d4dd6d3,
     0xd3402705, 0x4fb35b72, 0xb7756e3a, 0xcff3d142, 0xa8e567bc, 0x5bcc6d61,
     0x492d0d45, 0x2d8e03d1, 0x8c44383d, 0x5b5a3afe, 0x0000019a};
-OPENSSL_UNUSED static const uint32_t kP521MontB[] = {
+[[maybe_unused]] static const uint32_t kP521MontB[] = {
     0x8014654f, 0xea35a81f, 0x78f7a28f, 0xc41e961a, 0x839ab9ef, 0x5e9dd8df,
     0xbd8b2960, 0xa8f63f49, 0xf0ab0c9c, 0xc8c77884, 0xf9dc5a44, 0x2dccd98a,
     0x77516d39, 0xd05b42a0, 0x0fc94d10, 0xb0c70e4d, 0x0000015c};
-OPENSSL_UNUSED static const uint32_t kP521MontGX[] = {
+[[maybe_unused]] static const uint32_t kP521MontGX[] = {
     0xb331a163, 0x18e172de, 0x4dfcbf3f, 0xe0c2b521, 0x6f19a459, 0x93d17fd4,
     0x947f0ee0, 0x3bf7f3ac, 0xdd50a5af, 0xb035a69e, 0x90fc1457, 0x9c829fda,
     0x214e3240, 0xb311cada, 0xe6cf1f65, 0x5b820274, 0x00000103};
-OPENSSL_UNUSED static const uint32_t kP521MontGY[] = {
+[[maybe_unused]] static const uint32_t kP521MontGY[] = {
     0x28460e4a, 0x3b4fe8b3, 0x20445f4a, 0x43513961, 0xb09a9e38, 0x809fd683,
     0x2062a85c, 0x4caf7a13, 0x164bf739, 0x8b939f33, 0x340bd7de, 0x24abcda2,
     0xeccc7aa2, 0xda163e8d, 0x022e452f, 0x3c4d1de0, 0x000000b5};
diff --git a/crypto/fipsmodule/ec/make_tables.go b/crypto/fipsmodule/ec/make_tables.go
index fc51088..4491664 100644
--- a/crypto/fipsmodule/ec/make_tables.go
+++ b/crypto/fipsmodule/ec/make_tables.go
@@ -132,10 +132,10 @@
 		return nil
 	}
 
-	if _, err := fmt.Fprintf(w, "OPENSSL_UNUSED static const uint64_t k%sFieldN0 = 0x%016x;\n", cName, montgomeryN0(params.P)); err != nil {
+	if _, err := fmt.Fprintf(w, "[[maybe_unused]] static const uint64_t k%sFieldN0 = 0x%016x;\n", cName, montgomeryN0(params.P)); err != nil {
 		return err
 	}
-	if _, err := fmt.Fprintf(w, "OPENSSL_UNUSED static const uint64_t k%sOrderN0 = 0x%016x;\n", cName, montgomeryN0(params.N)); err != nil {
+	if _, err := fmt.Fprintf(w, "[[maybe_unused]] static const uint64_t k%sOrderN0 = 0x%016x;\n", cName, montgomeryN0(params.N)); err != nil {
 		return err
 	}
 
@@ -469,7 +469,7 @@
 }
 
 func writeDecl(w *columnWriter, curve elliptic.Curve, bits int, decl string, n *big.Int) error {
-	if _, err := fmt.Fprintf(w, "OPENSSL_UNUSED static const uint%d_t %s[] = {\n    ", bits, decl); err != nil {
+	if _, err := fmt.Fprintf(w, "[[maybe_unused]] static const uint%d_t %s[] = {\n    ", bits, decl); err != nil {
 		return err
 	}
 	if bits == 32 {
diff --git a/crypto/fipsmodule/modes/internal.h b/crypto/fipsmodule/modes/internal.h
index a77aaea..c7c89dd 100644
--- a/crypto/fipsmodule/modes/internal.h
+++ b/crypto/fipsmodule/modes/internal.h
@@ -65,8 +65,8 @@
 #endif
 
 
-OPENSSL_INLINE void CRYPTO_xor16(uint8_t out[16], const uint8_t a[16],
-                                 const uint8_t b[16]) {
+inline void CRYPTO_xor16(uint8_t out[16], const uint8_t a[16],
+                         const uint8_t b[16]) {
   // TODO(davidben): Ideally we'd leave this to the compiler, which could use
   // vector registers, etc. But the compiler doesn't know that |in| and |out|
   // cannot partially alias. |restrict| is slightly two strict (we allow exact
@@ -273,16 +273,14 @@
 #define GHASH_ASM_ARM
 #define GCM_FUNCREF
 
-OPENSSL_INLINE int gcm_pmull_capable(void) {
-  return CRYPTO_is_ARMv8_PMULL_capable();
-}
+inline int gcm_pmull_capable(void) { return CRYPTO_is_ARMv8_PMULL_capable(); }
 
 void gcm_init_v8(u128 Htable[16], const uint64_t H[2]);
 void gcm_gmult_v8(uint8_t Xi[16], const u128 Htable[16]);
 void gcm_ghash_v8(uint8_t Xi[16], const u128 Htable[16], const uint8_t *inp,
                   size_t len);
 
-OPENSSL_INLINE int gcm_neon_capable(void) { return CRYPTO_is_NEON_capable(); }
+inline int gcm_neon_capable(void) { return CRYPTO_is_NEON_capable(); }
 
 void gcm_init_neon(u128 Htable[16], const uint64_t H[2]);
 void gcm_gmult_neon(uint8_t Xi[16], const u128 Htable[16]);
diff --git a/crypto/fipsmodule/rand/internal.h b/crypto/fipsmodule/rand/internal.h
index 418f5de..ce2f63c 100644
--- a/crypto/fipsmodule/rand/internal.h
+++ b/crypto/fipsmodule/rand/internal.h
@@ -50,14 +50,12 @@
 
 #if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM)
 
-OPENSSL_INLINE int have_rdrand(void) {
-  return CRYPTO_is_RDRAND_capable();
-}
+inline int have_rdrand(void) { return CRYPTO_is_RDRAND_capable(); }
 
 // have_fast_rdrand returns true if RDRAND is supported and it's reasonably
 // fast. Concretely the latter is defined by whether the chip is Intel (fast) or
 // not (assumed slow).
-OPENSSL_INLINE int have_fast_rdrand(void) {
+inline int have_fast_rdrand(void) {
   return CRYPTO_is_RDRAND_capable() && CRYPTO_is_intel_cpu();
 }
 
@@ -72,13 +70,9 @@
 
 #else  // OPENSSL_X86_64 && !OPENSSL_NO_ASM
 
-OPENSSL_INLINE int have_rdrand(void) {
-  return 0;
-}
+inline int have_rdrand(void) { return 0; }
 
-OPENSSL_INLINE int have_fast_rdrand(void) {
-  return 0;
-}
+inline int have_fast_rdrand(void) { return 0; }
 
 #endif  // OPENSSL_X86_64 && !OPENSSL_NO_ASM
 
diff --git a/crypto/fipsmodule/service_indicator/internal.h b/crypto/fipsmodule/service_indicator/internal.h
index 38b4677..b86504b 100644
--- a/crypto/fipsmodule/service_indicator/internal.h
+++ b/crypto/fipsmodule/service_indicator/internal.h
@@ -53,36 +53,36 @@
 
 // Service indicator functions are no-ops in non-FIPS builds.
 
-OPENSSL_INLINE void FIPS_service_indicator_update_state(void) {}
-OPENSSL_INLINE void FIPS_service_indicator_lock_state(void) {}
-OPENSSL_INLINE void FIPS_service_indicator_unlock_state(void) {}
+inline void FIPS_service_indicator_update_state(void) {}
+inline void FIPS_service_indicator_lock_state(void) {}
+inline void FIPS_service_indicator_unlock_state(void) {}
 
-OPENSSL_INLINE void AEAD_GCM_verify_service_indicator(
-    OPENSSL_UNUSED const EVP_AEAD_CTX *ctx) {}
+inline void AEAD_GCM_verify_service_indicator(
+    [[maybe_unused]] const EVP_AEAD_CTX *ctx) {}
 
-OPENSSL_INLINE void AEAD_CCM_verify_service_indicator(
-    OPENSSL_UNUSED const EVP_AEAD_CTX *ctx) {}
+inline void AEAD_CCM_verify_service_indicator(
+    [[maybe_unused]] const EVP_AEAD_CTX *ctx) {}
 
-OPENSSL_INLINE void EC_KEY_keygen_verify_service_indicator(
-    OPENSSL_UNUSED const EC_KEY *eckey) {}
+inline void EC_KEY_keygen_verify_service_indicator(
+    [[maybe_unused]] const EC_KEY *eckey) {}
 
-OPENSSL_INLINE void ECDH_verify_service_indicator(
-    OPENSSL_UNUSED const EC_KEY *ec_key) {}
+inline void ECDH_verify_service_indicator(
+    [[maybe_unused]] const EC_KEY *ec_key) {}
 
-OPENSSL_INLINE void EVP_Cipher_verify_service_indicator(
-    OPENSSL_UNUSED const EVP_CIPHER_CTX *ctx) {}
+inline void EVP_Cipher_verify_service_indicator(
+    [[maybe_unused]] const EVP_CIPHER_CTX *ctx) {}
 
-OPENSSL_INLINE void EVP_DigestSign_verify_service_indicator(
-    OPENSSL_UNUSED const EVP_MD_CTX *ctx) {}
+inline void EVP_DigestSign_verify_service_indicator(
+    [[maybe_unused]] const EVP_MD_CTX *ctx) {}
 
-OPENSSL_INLINE void EVP_DigestVerify_verify_service_indicator(
-    OPENSSL_UNUSED const EVP_MD_CTX *ctx) {}
+inline void EVP_DigestVerify_verify_service_indicator(
+    [[maybe_unused]] const EVP_MD_CTX *ctx) {}
 
-OPENSSL_INLINE void HMAC_verify_service_indicator(
-    OPENSSL_UNUSED const EVP_MD *evp_md) {}
+inline void HMAC_verify_service_indicator(
+    [[maybe_unused]] const EVP_MD *evp_md) {}
 
-OPENSSL_INLINE void TLSKDF_verify_service_indicator(
-    OPENSSL_UNUSED const EVP_MD *dgst) {}
+inline void TLSKDF_verify_service_indicator(
+    [[maybe_unused]] const EVP_MD *dgst) {}
 
 #endif  // BORINGSSL_FIPS
 
diff --git a/crypto/fipsmodule/sha/internal.h b/crypto/fipsmodule/sha/internal.h
index 36e0787..4f82011 100644
--- a/crypto/fipsmodule/sha/internal.h
+++ b/crypto/fipsmodule/sha/internal.h
@@ -33,18 +33,14 @@
 #define SHA512_ASM_NOHW
 
 #define SHA1_ASM_HW
-OPENSSL_INLINE int sha1_hw_capable(void) {
-  return CRYPTO_is_ARMv8_SHA1_capable();
-}
+inline int sha1_hw_capable(void) { return CRYPTO_is_ARMv8_SHA1_capable(); }
 
 #define SHA1_ASM_NEON
 void sha1_block_data_order_neon(uint32_t state[5], const uint8_t *data,
                                 size_t num);
 
 #define SHA256_ASM_HW
-OPENSSL_INLINE int sha256_hw_capable(void) {
-  return CRYPTO_is_ARMv8_SHA256_capable();
-}
+inline int sha256_hw_capable(void) { return CRYPTO_is_ARMv8_SHA256_capable(); }
 
 #define SHA256_ASM_NEON
 void sha256_block_data_order_neon(uint32_t state[8], const uint8_t *data,
@@ -62,19 +58,13 @@
 #define SHA512_ASM_NOHW
 
 #define SHA1_ASM_HW
-OPENSSL_INLINE int sha1_hw_capable(void) {
-  return CRYPTO_is_ARMv8_SHA1_capable();
-}
+inline int sha1_hw_capable(void) { return CRYPTO_is_ARMv8_SHA1_capable(); }
 
 #define SHA256_ASM_HW
-OPENSSL_INLINE int sha256_hw_capable(void) {
-  return CRYPTO_is_ARMv8_SHA256_capable();
-}
+inline int sha256_hw_capable(void) { return CRYPTO_is_ARMv8_SHA256_capable(); }
 
 #define SHA512_ASM_HW
-OPENSSL_INLINE int sha512_hw_capable(void) {
-  return CRYPTO_is_ARMv8_SHA512_capable();
-}
+inline int sha512_hw_capable(void) { return CRYPTO_is_ARMv8_SHA512_capable(); }
 
 #elif !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86)
 
@@ -83,7 +73,7 @@
 #define SHA512_ASM_NOHW
 
 #define SHA1_ASM_SSSE3
-OPENSSL_INLINE int sha1_ssse3_capable(void) {
+inline int sha1_ssse3_capable(void) {
   // TODO(davidben): Do we need to check the FXSR bit? The Intel manual does not
   // say to.
   return CRYPTO_is_SSSE3_capable() && CRYPTO_is_FXSR_capable();
@@ -92,7 +82,7 @@
                                  size_t num);
 
 #define SHA1_ASM_AVX
-OPENSSL_INLINE int sha1_avx_capable(void) {
+inline int sha1_avx_capable(void) {
   // Pre-Zen AMD CPUs had slow SHLD/SHRD; Zen added the SHA extension; see the
   // discussion in sha1-586.pl.
   //
@@ -106,7 +96,7 @@
                                size_t num);
 
 #define SHA256_ASM_SSSE3
-OPENSSL_INLINE int sha256_ssse3_capable(void) {
+inline int sha256_ssse3_capable(void) {
   // TODO(davidben): Do we need to check the FXSR bit? The Intel manual does not
   // say to.
   return CRYPTO_is_SSSE3_capable() && CRYPTO_is_FXSR_capable();
@@ -115,7 +105,7 @@
                                    size_t num);
 
 #define SHA256_ASM_AVX
-OPENSSL_INLINE int sha256_avx_capable(void) {
+inline int sha256_avx_capable(void) {
   // Pre-Zen AMD CPUs had slow SHLD/SHRD; Zen added the SHA extension; see the
   // discussion in sha1-586.pl.
   //
@@ -129,7 +119,7 @@
                                  size_t num);
 
 #define SHA512_ASM_SSSE3
-OPENSSL_INLINE int sha512_ssse3_capable(void) {
+inline int sha512_ssse3_capable(void) {
   // TODO(davidben): Do we need to check the FXSR bit? The Intel manual does not
   // say to.
   return CRYPTO_is_SSSE3_capable() && CRYPTO_is_FXSR_capable();
@@ -144,12 +134,12 @@
 #define SHA512_ASM_NOHW
 
 #define SHA1_ASM_HW
-OPENSSL_INLINE int sha1_hw_capable(void) {
+inline int sha1_hw_capable(void) {
   return CRYPTO_is_x86_SHA_capable() && CRYPTO_is_SSSE3_capable();
 }
 
 #define SHA1_ASM_AVX2
-OPENSSL_INLINE int sha1_avx2_capable(void) {
+inline int sha1_avx2_capable(void) {
   return CRYPTO_is_AVX2_capable() && CRYPTO_is_BMI2_capable() &&
          CRYPTO_is_BMI1_capable();
 }
@@ -157,7 +147,7 @@
                                 size_t num);
 
 #define SHA1_ASM_AVX
-OPENSSL_INLINE int sha1_avx_capable(void) {
+inline int sha1_avx_capable(void) {
   // Pre-Zen AMD CPUs had slow SHLD/SHRD; Zen added the SHA extension; see the
   // discussion in sha1-586.pl.
   return CRYPTO_is_AVX_capable() && CRYPTO_is_intel_cpu();
@@ -166,20 +156,18 @@
                                size_t num);
 
 #define SHA1_ASM_SSSE3
-OPENSSL_INLINE int sha1_ssse3_capable(void) {
-  return CRYPTO_is_SSSE3_capable();
-}
+inline int sha1_ssse3_capable(void) { return CRYPTO_is_SSSE3_capable(); }
 void sha1_block_data_order_ssse3(uint32_t state[5], const uint8_t *data,
                                  size_t num);
 
 #define SHA256_ASM_HW
-OPENSSL_INLINE int sha256_hw_capable(void) {
+inline int sha256_hw_capable(void) {
   // Note that the original assembly did not check SSSE3.
   return CRYPTO_is_x86_SHA_capable() && CRYPTO_is_SSSE3_capable();
 }
 
 #define SHA256_ASM_AVX
-OPENSSL_INLINE int sha256_avx_capable(void) {
+inline int sha256_avx_capable(void) {
   // Pre-Zen AMD CPUs had slow SHLD/SHRD; Zen added the SHA extension; see the
   // discussion in sha1-586.pl.
   return CRYPTO_is_AVX_capable() && CRYPTO_is_intel_cpu();
@@ -188,16 +176,12 @@
                                  size_t num);
 
 #define SHA256_ASM_SSSE3
-OPENSSL_INLINE int sha256_ssse3_capable(void) {
-  return CRYPTO_is_SSSE3_capable();
-}
+inline int sha256_ssse3_capable(void) { return CRYPTO_is_SSSE3_capable(); }
 void sha256_block_data_order_ssse3(uint32_t state[8], const uint8_t *data,
                                    size_t num);
 
 #define SHA512_ASM_AVX
-OPENSSL_INLINE int sha512_avx_capable(void) {
-  return CRYPTO_is_AVX_capable();
-}
+inline int sha512_avx_capable(void) { return CRYPTO_is_AVX_capable(); }
 void sha512_block_data_order_avx(uint64_t state[8], const uint8_t *data,
                                  size_t num);
 
diff --git a/crypto/internal.h b/crypto/internal.h
index 200539c..63a6c68 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -167,7 +167,7 @@
 // needed. This function is idempotent and may be called concurrently.
 void OPENSSL_init_cpuid(void);
 #else
-OPENSSL_INLINE void OPENSSL_init_cpuid(void) {}
+inline void OPENSSL_init_cpuid(void) {}
 #endif
 
 #if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \
@@ -252,9 +252,9 @@
 // re-enables simulated malloc failures.
 OPENSSL_EXPORT void OPENSSL_enable_malloc_failures_for_testing(void);
 #else
-OPENSSL_INLINE void OPENSSL_reset_malloc_counter_for_testing(void) {}
-OPENSSL_INLINE void OPENSSL_disable_malloc_failures_for_testing(void) {}
-OPENSSL_INLINE void OPENSSL_enable_malloc_failures_for_testing(void) {}
+inline void OPENSSL_reset_malloc_counter_for_testing(void) {}
+inline void OPENSSL_disable_malloc_failures_for_testing(void) {}
+inline void OPENSSL_enable_malloc_failures_for_testing(void) {}
 #endif
 
 #if defined(__has_builtin)
@@ -651,12 +651,11 @@
 
 typedef uint32_t CRYPTO_atomic_u32;
 
-OPENSSL_INLINE uint32_t CRYPTO_atomic_load_u32(CRYPTO_atomic_u32 *val) {
-  return *val;
-}
+inline uint32_t CRYPTO_atomic_load_u32(CRYPTO_atomic_u32 *val) { return *val; }
 
-OPENSSL_INLINE int CRYPTO_atomic_compare_exchange_weak_u32(
-    CRYPTO_atomic_u32 *val, uint32_t *expected, uint32_t desired) {
+inline int CRYPTO_atomic_compare_exchange_weak_u32(CRYPTO_atomic_u32 *val,
+                                                   uint32_t *expected,
+                                                   uint32_t desired) {
   if (*val != *expected) {
     *expected = *val;
     return 0;
@@ -665,8 +664,7 @@
   return 1;
 }
 
-OPENSSL_INLINE void CRYPTO_atomic_store_u32(CRYPTO_atomic_u32 *val,
-                                            uint32_t desired) {
+inline void CRYPTO_atomic_store_u32(CRYPTO_atomic_u32 *val, uint32_t desired) {
   *val = desired;
 }
 
@@ -1139,9 +1137,9 @@
 
 // Outside of FIPS mode, the lazy tests are no-ops.
 
-OPENSSL_INLINE void boringssl_ensure_rsa_self_test(void) {}
-OPENSSL_INLINE void boringssl_ensure_ecc_self_test(void) {}
-OPENSSL_INLINE void boringssl_ensure_ffdh_self_test(void) {}
+inline void boringssl_ensure_rsa_self_test(void) {}
+inline void boringssl_ensure_ecc_self_test(void) {}
+inline void boringssl_ensure_ffdh_self_test(void) {}
 
 #endif  // FIPS
 
@@ -1157,16 +1155,16 @@
 #if defined(BORINGSSL_FIPS_COUNTERS)
 void boringssl_fips_inc_counter(enum fips_counter_t counter);
 #else
-OPENSSL_INLINE void boringssl_fips_inc_counter(enum fips_counter_t counter) {}
+inline void boringssl_fips_inc_counter(enum fips_counter_t counter) {}
 #endif
 
 #if defined(BORINGSSL_FIPS_BREAK_TESTS)
-OPENSSL_INLINE int boringssl_fips_break_test(const char *test) {
+inline int boringssl_fips_break_test(const char *test) {
   const char *const value = getenv("BORINGSSL_FIPS_BREAK_TEST");
   return value != NULL && strcmp(value, test) == 0;
 }
 #else
-OPENSSL_INLINE int boringssl_fips_break_test(const char *test) { return 0; }
+inline int boringssl_fips_break_test(const char *test) { return 0; }
 #endif  // BORINGSSL_FIPS_BREAK_TESTS
 
 
@@ -1206,7 +1204,7 @@
 
 // See Intel manual, volume 2A, table 3-11.
 
-OPENSSL_INLINE int CRYPTO_is_FXSR_capable(void) {
+inline int CRYPTO_is_FXSR_capable(void) {
 #if defined(__FXSR__)
   return 1;
 #else
@@ -1214,14 +1212,14 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_intel_cpu(void) {
+inline int CRYPTO_is_intel_cpu(void) {
   // The reserved bit 30 is used to indicate an Intel CPU.
   return (OPENSSL_get_ia32cap(0) & (1u << 30)) != 0;
 }
 
 // See Intel manual, volume 2A, table 3-10.
 
-OPENSSL_INLINE int CRYPTO_is_PCLMUL_capable(void) {
+inline int CRYPTO_is_PCLMUL_capable(void) {
 #if defined(__PCLMUL__)
   return 1;
 #else
@@ -1229,7 +1227,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_SSSE3_capable(void) {
+inline int CRYPTO_is_SSSE3_capable(void) {
 #if defined(__SSSE3__)
   return 1;
 #else
@@ -1237,7 +1235,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_SSE4_1_capable(void) {
+inline int CRYPTO_is_SSE4_1_capable(void) {
 #if defined(__SSE4_1__)
   return 1;
 #else
@@ -1245,7 +1243,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_MOVBE_capable(void) {
+inline int CRYPTO_is_MOVBE_capable(void) {
 #if defined(__MOVBE__)
   return 1;
 #else
@@ -1253,7 +1251,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_AESNI_capable(void) {
+inline int CRYPTO_is_AESNI_capable(void) {
 #if defined(__AES__)
   return 1;
 #else
@@ -1264,7 +1262,7 @@
 // We intentionally avoid defining a |CRYPTO_is_XSAVE_capable| function. See
 // |CRYPTO_cpu_perf_is_like_silvermont|.
 
-OPENSSL_INLINE int CRYPTO_is_AVX_capable(void) {
+inline int CRYPTO_is_AVX_capable(void) {
 #if defined(__AVX__)
   return 1;
 #else
@@ -1272,7 +1270,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_RDRAND_capable(void) {
+inline int CRYPTO_is_RDRAND_capable(void) {
   // We intentionally do not check |__RDRND__| here. On some AMD processors, we
   // will act as if the hardware is RDRAND-incapable, even it actually supports
   // it. See cpu_intel.c.
@@ -1281,7 +1279,7 @@
 
 // See Intel manual, volume 2A, table 3-8.
 
-OPENSSL_INLINE int CRYPTO_is_BMI1_capable(void) {
+inline int CRYPTO_is_BMI1_capable(void) {
 #if defined(__BMI__)
   return 1;
 #else
@@ -1289,7 +1287,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_AVX2_capable(void) {
+inline int CRYPTO_is_AVX2_capable(void) {
 #if defined(__AVX2__)
   return 1;
 #else
@@ -1297,7 +1295,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_BMI2_capable(void) {
+inline int CRYPTO_is_BMI2_capable(void) {
 #if defined(__BMI2__)
   return 1;
 #else
@@ -1305,7 +1303,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_ADX_capable(void) {
+inline int CRYPTO_is_ADX_capable(void) {
 #if defined(__ADX__)
   return 1;
 #else
@@ -1314,7 +1312,7 @@
 }
 
 // SHA-1 and SHA-256 are defined as a single extension.
-OPENSSL_INLINE int CRYPTO_is_x86_SHA_capable(void) {
+inline int CRYPTO_is_x86_SHA_capable(void) {
   // We should check __SHA__ here, but for now we ignore it. We've run into a
   // few places where projects build with -march=goldmont, but need a build that
   // does not require SHA extensions:
@@ -1348,7 +1346,7 @@
 // isn't matched by this. Various sources indicate AMD first implemented MOVBE
 // and XSAVE at the same time in Jaguar, so it seems like AMD chips will not be
 // matched by this. That seems to be the case for other x86(-64) CPUs.
-OPENSSL_INLINE int CRYPTO_cpu_perf_is_like_silvermont(void) {
+inline int CRYPTO_cpu_perf_is_like_silvermont(void) {
   // WARNING: This MUST NOT be used to guard the execution of the XSAVE
   // instruction. This is the "hardware supports XSAVE" bit, not the OSXSAVE bit
   // that indicates whether we can safely execute XSAVE. This bit may be set
@@ -1362,7 +1360,7 @@
   return !hardware_supports_xsave && CRYPTO_is_MOVBE_capable();
 }
 
-OPENSSL_INLINE int CRYPTO_is_AVX512BW_capable(void) {
+inline int CRYPTO_is_AVX512BW_capable(void) {
 #if defined(__AVX512BW__)
   return 1;
 #else
@@ -1370,7 +1368,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_AVX512VL_capable(void) {
+inline int CRYPTO_is_AVX512VL_capable(void) {
 #if defined(__AVX512VL__)
   return 1;
 #else
@@ -1382,11 +1380,11 @@
 // should not be used even if the CPU supports them.
 //
 // Note that this reuses the bit for the removed MPX feature.
-OPENSSL_INLINE int CRYPTO_cpu_avoid_zmm_registers(void) {
+inline int CRYPTO_cpu_avoid_zmm_registers(void) {
   return (OPENSSL_get_ia32cap(2) & (1u << 14)) != 0;
 }
 
-OPENSSL_INLINE int CRYPTO_is_VAES_capable(void) {
+inline int CRYPTO_is_VAES_capable(void) {
 #if defined(__VAES__)
   return 1;
 #else
@@ -1394,7 +1392,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_VPCLMULQDQ_capable(void) {
+inline int CRYPTO_is_VPCLMULQDQ_capable(void) {
 #if defined(__VPCLMULQDQ__)
   return 1;
 #else
@@ -1441,7 +1439,7 @@
 
 // CRYPTO_is_NEON_capable returns true if the current CPU has a NEON unit. If
 // this is known statically, it is a constant inline function.
-OPENSSL_INLINE int CRYPTO_is_NEON_capable(void) {
+inline int CRYPTO_is_NEON_capable(void) {
 #if defined(OPENSSL_STATIC_ARMCAP_NEON) || defined(__ARM_NEON)
   return 1;
 #elif defined(OPENSSL_STATIC_ARMCAP)
@@ -1451,7 +1449,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_ARMv8_AES_capable(void) {
+inline int CRYPTO_is_ARMv8_AES_capable(void) {
 #if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_AES)
   return 1;
 #elif defined(OPENSSL_STATIC_ARMCAP)
@@ -1461,7 +1459,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_ARMv8_PMULL_capable(void) {
+inline int CRYPTO_is_ARMv8_PMULL_capable(void) {
 #if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_AES)
   return 1;
 #elif defined(OPENSSL_STATIC_ARMCAP)
@@ -1471,7 +1469,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_ARMv8_SHA1_capable(void) {
+inline int CRYPTO_is_ARMv8_SHA1_capable(void) {
   // SHA-1 and SHA-2 (only) share |__ARM_FEATURE_SHA2| but otherwise
   // are dealt with independently.
 #if defined(OPENSSL_STATIC_ARMCAP_SHA1) || defined(__ARM_FEATURE_SHA2)
@@ -1483,7 +1481,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_ARMv8_SHA256_capable(void) {
+inline int CRYPTO_is_ARMv8_SHA256_capable(void) {
   // SHA-1 and SHA-2 (only) share |__ARM_FEATURE_SHA2| but otherwise
   // are dealt with independently.
 #if defined(OPENSSL_STATIC_ARMCAP_SHA256) || defined(__ARM_FEATURE_SHA2)
@@ -1495,7 +1493,7 @@
 #endif
 }
 
-OPENSSL_INLINE int CRYPTO_is_ARMv8_SHA512_capable(void) {
+inline int CRYPTO_is_ARMv8_SHA512_capable(void) {
   // There is no |OPENSSL_STATIC_ARMCAP_SHA512|.
 #if defined(__ARM_FEATURE_SHA512)
   return 1;
diff --git a/crypto/lhash/internal.h b/crypto/lhash/internal.h
index 512f06d..5479d64 100644
--- a/crypto/lhash/internal.h
+++ b/crypto/lhash/internal.h
@@ -172,32 +172,32 @@
   typedef int (*lhash_##type##_cmp_func)(const type *, const type *);          \
   typedef uint32_t (*lhash_##type##_hash_func)(const type *);                  \
                                                                                \
-  OPENSSL_INLINE int lh_##type##_call_cmp_func(lhash_cmp_func func,            \
-                                               const void *a, const void *b) { \
+  inline int lh_##type##_call_cmp_func(lhash_cmp_func func, const void *a,     \
+                                       const void *b) {                        \
     return ((lhash_##type##_cmp_func)func)((const type *)a, (const type *)b);  \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE uint32_t lh_##type##_call_hash_func(lhash_hash_func func,     \
-                                                     const void *a) {          \
+  inline uint32_t lh_##type##_call_hash_func(lhash_hash_func func,             \
+                                             const void *a) {                  \
     return ((lhash_##type##_hash_func)func)((const type *)a);                  \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE LHASH_OF(type) *lh_##type##_new(                              \
-      lhash_##type##_hash_func hash, lhash_##type##_cmp_func comp) {           \
+  inline LHASH_OF(type) *lh_##type##_new(lhash_##type##_hash_func hash,        \
+                                         lhash_##type##_cmp_func comp) {       \
     return (LHASH_OF(type) *)OPENSSL_lh_new((lhash_hash_func)hash,             \
                                             (lhash_cmp_func)comp);             \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE void lh_##type##_free(LHASH_OF(type) *lh) {                   \
+  inline void lh_##type##_free(LHASH_OF(type) *lh) {                           \
     OPENSSL_lh_free((_LHASH *)lh);                                             \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE size_t lh_##type##_num_items(const LHASH_OF(type) *lh) {      \
+  inline size_t lh_##type##_num_items(const LHASH_OF(type) *lh) {              \
     return OPENSSL_lh_num_items((const _LHASH *)lh);                           \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE type *lh_##type##_retrieve(const LHASH_OF(type) *lh,          \
-                                            const type *data) {                \
+  inline type *lh_##type##_retrieve(const LHASH_OF(type) *lh,                  \
+                                    const type *data) {                        \
     return (type *)OPENSSL_lh_retrieve((const _LHASH *)lh, data,               \
                                        lh_##type##_call_hash_func,             \
                                        lh_##type##_call_cmp_func);             \
@@ -208,13 +208,12 @@
     const void *key;                                                           \
   } LHASH_CMP_KEY_##type;                                                      \
                                                                                \
-  OPENSSL_INLINE int lh_##type##_call_cmp_key(const void *key,                 \
-                                              const void *value) {             \
+  inline int lh_##type##_call_cmp_key(const void *key, const void *value) {    \
     const LHASH_CMP_KEY_##type *cb = (const LHASH_CMP_KEY_##type *)key;        \
     return cb->cmp_key(cb->key, (const type *)value);                          \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE type *lh_##type##_retrieve_key(                               \
+  inline type *lh_##type##_retrieve_key(                                       \
       const LHASH_OF(type) *lh, const void *key, uint32_t key_hash,            \
       int (*cmp_key)(const void *key, const type *value)) {                    \
     LHASH_CMP_KEY_##type cb = {cmp_key, key};                                  \
@@ -222,8 +221,8 @@
                                            lh_##type##_call_cmp_key);          \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE int lh_##type##_insert(LHASH_OF(type) *lh, type **old_data,   \
-                                        type *data) {                          \
+  inline int lh_##type##_insert(LHASH_OF(type) *lh, type **old_data,           \
+                                type *data) {                                  \
     void *old_data_void = NULL;                                                \
     int ret = OPENSSL_lh_insert((_LHASH *)lh, &old_data_void, data,            \
                                 lh_##type##_call_hash_func,                    \
@@ -232,8 +231,7 @@
     return ret;                                                                \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE type *lh_##type##_delete(LHASH_OF(type) *lh,                  \
-                                          const type *data) {                  \
+  inline type *lh_##type##_delete(LHASH_OF(type) *lh, const type *data) {      \
     return (type *)OPENSSL_lh_delete((_LHASH *)lh, data,                       \
                                      lh_##type##_call_hash_func,               \
                                      lh_##type##_call_cmp_func);               \
@@ -244,13 +242,13 @@
     void *arg;                                                                 \
   } LHASH_DOALL_##type;                                                        \
                                                                                \
-  OPENSSL_INLINE void lh_##type##_call_doall_arg(void *value, void *arg) {     \
+  inline void lh_##type##_call_doall_arg(void *value, void *arg) {             \
     const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg;            \
     cb->doall_arg((type *)value, cb->arg);                                     \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE void lh_##type##_doall_arg(                                   \
-      LHASH_OF(type) *lh, void (*func)(type *, void *), void *arg) {           \
+  inline void lh_##type##_doall_arg(LHASH_OF(type) *lh,                        \
+                                    void (*func)(type *, void *), void *arg) { \
     LHASH_DOALL_##type cb = {func, arg};                                       \
     OPENSSL_lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall_arg, &cb);       \
   }                                                                            \
diff --git a/crypto/slhdsa/address.h b/crypto/slhdsa/address.h
index c685971..91c468e 100644
--- a/crypto/slhdsa/address.h
+++ b/crypto/slhdsa/address.h
@@ -55,32 +55,30 @@
 #define SLHDSA_SHA2_128S_OFFSET_TREE_INDEX 18
 
 
-OPENSSL_INLINE void slhdsa_set_chain_addr(uint8_t addr[32], uint32_t chain) {
+inline void slhdsa_set_chain_addr(uint8_t addr[32], uint32_t chain) {
   addr[SLHDSA_SHA2_128S_OFFSET_CHAIN_ADDR] = (uint8_t)chain;
 }
 
-OPENSSL_INLINE void slhdsa_set_hash_addr(uint8_t addr[32], uint32_t hash) {
+inline void slhdsa_set_hash_addr(uint8_t addr[32], uint32_t hash) {
   addr[SLHDSA_SHA2_128S_OFFSET_HASH_ADDR] = (uint8_t)hash;
 }
 
-OPENSSL_INLINE void slhdsa_set_keypair_addr(uint8_t addr[32],
-                                            uint32_t keypair) {
+inline void slhdsa_set_keypair_addr(uint8_t addr[32], uint32_t keypair) {
   addr[SLHDSA_SHA2_128S_OFFSET_KP_ADDR2] = (uint8_t)(keypair >> 8);
   addr[SLHDSA_SHA2_128S_OFFSET_KP_ADDR1] = (uint8_t)keypair;
 }
 
-OPENSSL_INLINE void slhdsa_copy_keypair_addr(uint8_t out[32],
-                                             const uint8_t in[32]) {
+inline void slhdsa_copy_keypair_addr(uint8_t out[32], const uint8_t in[32]) {
   OPENSSL_memcpy(out, in, SLHDSA_SHA2_128S_OFFSET_TREE + 8);
   out[SLHDSA_SHA2_128S_OFFSET_KP_ADDR2] = in[SLHDSA_SHA2_128S_OFFSET_KP_ADDR2];
   out[SLHDSA_SHA2_128S_OFFSET_KP_ADDR1] = in[SLHDSA_SHA2_128S_OFFSET_KP_ADDR1];
 }
 
-OPENSSL_INLINE void slhdsa_set_layer_addr(uint8_t addr[32], uint32_t layer) {
+inline void slhdsa_set_layer_addr(uint8_t addr[32], uint32_t layer) {
   addr[SLHDSA_SHA2_128S_OFFSET_LAYER] = (uint8_t)layer;
 }
 
-OPENSSL_INLINE void slhdsa_set_tree_addr(uint8_t addr[32], uint64_t tree) {
+inline void slhdsa_set_tree_addr(uint8_t addr[32], uint64_t tree) {
   CRYPTO_store_u64_be(&addr[SLHDSA_SHA2_128S_OFFSET_TREE], tree);
 }
 
@@ -92,7 +90,7 @@
 #define SLHDSA_SHA2_128S_ADDR_TYPE_WOTSPRF 5
 #define SLHDSA_SHA2_128S_ADDR_TYPE_FORSPRF 6
 
-OPENSSL_INLINE void slhdsa_set_type(uint8_t addr[32], uint32_t type) {
+inline void slhdsa_set_type(uint8_t addr[32], uint32_t type) {
   // FIPS 205 relies on this setting parts of the address to 0, so we do it
   // here to avoid confusion.
   //
@@ -101,17 +99,15 @@
   addr[SLHDSA_SHA2_128S_OFFSET_TYPE] = (uint8_t)type;
 }
 
-OPENSSL_INLINE void slhdsa_set_tree_height(uint8_t addr[32],
-                                           uint32_t tree_height) {
+inline void slhdsa_set_tree_height(uint8_t addr[32], uint32_t tree_height) {
   addr[SLHDSA_SHA2_128S_OFFSET_TREE_HGT] = (uint8_t)tree_height;
 }
 
-OPENSSL_INLINE void slhdsa_set_tree_index(uint8_t addr[32],
-                                          uint32_t tree_index) {
+inline void slhdsa_set_tree_index(uint8_t addr[32], uint32_t tree_index) {
   CRYPTO_store_u32_be(&addr[SLHDSA_SHA2_128S_OFFSET_TREE_INDEX], tree_index);
 }
 
-OPENSSL_INLINE uint32_t slhdsa_get_tree_index(uint8_t addr[32]) {
+inline uint32_t slhdsa_get_tree_index(uint8_t addr[32]) {
   return CRYPTO_load_u32_be(addr + SLHDSA_SHA2_128S_OFFSET_TREE_INDEX);
 }