5858// function pointer calculation in AES_ctr128_encrypt. Without it,
5959// on AArch64 there is risk of the calculations requiring a PC-relative
6060// offset outside of the range (-1MB,1MB) addressable using `ADR`.
61- static inline void aes_hw_encrypt_wrapper (const uint8_t * in , uint8_t * out ,
62- const AES_KEY * key ) {
63- aes_hw_encrypt (in , out , key );
64- }
65-
66- static inline void vpaes_encrypt_wrapper (const uint8_t * in , uint8_t * out ,
67- const AES_KEY * key ) {
68- vpaes_encrypt (in , out , key );
69- }
70-
71- static inline void aes_nohw_encrypt_wrapper (const uint8_t * in , uint8_t * out ,
72- const AES_KEY * key ) {
73- aes_nohw_encrypt (in , out , key );
74- }
75-
7661static inline void aes_hw_ctr32_encrypt_blocks_wrapper (const uint8_t * in ,
77- uint8_t * out , size_t len ,
78- const AES_KEY * key ,
79- const uint8_t ivec [16 ]) {
80- aes_hw_ctr32_encrypt_blocks (in , out , len , key , ivec );
81- }
82-
83- static inline void aes_nohw_ctr32_encrypt_blocks_wrapper (const uint8_t * in ,
84- uint8_t * out , size_t len ,
85- const AES_KEY * key ,
86- const uint8_t ivec [16 ]) {
87- aes_nohw_ctr32_encrypt_blocks (in , out , len , key , ivec );
62+ uint8_t * out , size_t len ,
63+ const AES_KEY * key ,
64+ const uint8_t ivec [16 ])
65+ {
66+ aes_hw_ctr32_encrypt_blocks (in , out , len , key , ivec );
8867}
8968
9069#if defined(VPAES_CTR32 )
@@ -94,7 +73,12 @@ static inline void vpaes_ctr32_encrypt_blocks_wrapper(const uint8_t *in,
9473 const uint8_t ivec [16 ]) {
9574 vpaes_ctr32_encrypt_blocks (in , out , len , key , ivec );
9675}
97- #endif
76+ #else // VPAES_CTR32
77+ static inline void vpaes_encrypt_wrapper (const uint8_t * in , uint8_t * out ,
78+ const AES_KEY * key ) {
79+ vpaes_encrypt (in , out , key );
80+ }
81+ #endif // !VPAES_CTR32
9882
9983void AES_ctr128_encrypt (const uint8_t * in , uint8_t * out , size_t len ,
10084 const AES_KEY * key , uint8_t ivec [AES_BLOCK_SIZE ],
@@ -114,7 +98,7 @@ void AES_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len,
11498#endif
11599 } else {
116100 CRYPTO_ctr128_encrypt_ctr32 (in , out , len , key , ivec , ecount_buf , num ,
117- aes_nohw_ctr32_encrypt_blocks_wrapper );
101+ aes_nohw_ctr32_encrypt_blocks );
118102 }
119103
120104 FIPS_service_indicator_update_state ();
0 commit comments