diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2024-03-27 06:52:00 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2024-03-27 06:52:00 +0000 |
commit | f77e375da03389ca056e33dd095e7cc591ec108e (patch) | |
tree | 810cb258e983f18e34e3c53decf75e0e52d67522 /lib/libcrypto/aes | |
parent | b0f3d70bee8b8159397fd0e7cce9b163bb043180 (diff) |
Use crypto_rol_u32() instead of an undefined ROTATE macro.
ok tb@
Diffstat (limited to 'lib/libcrypto/aes')
-rw-r--r-- | lib/libcrypto/aes/aes_core.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libcrypto/aes/aes_core.c b/lib/libcrypto/aes/aes_core.c index 3df4aec3cd2..9ec84a5c82c 100644 --- a/lib/libcrypto/aes/aes_core.c +++ b/lib/libcrypto/aes/aes_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_core.c,v 1.16 2024/03/27 06:39:46 jsing Exp $ */ +/* $OpenBSD: aes_core.c,v 1.17 2024/03/27 06:51:59 jsing Exp $ */ /** * rijndael-alg-fst.c * @@ -35,6 +35,7 @@ #include <openssl/aes.h> #include "aes_local.h" +#include "crypto_internal.h" #ifndef AES_ASM /* @@ -1356,14 +1357,9 @@ AES_set_decrypt_key(const unsigned char *userKey, const int bits, tpb = tp9 ^ tp2; tpd = tp9 ^ tp4; tpe = tp8 ^ tp4 ^ tp2; -#if defined(ROTATE) - rk[j] = tpe ^ ROTATE(tpd, 16) ^ - ROTATE(tp9, 24) ^ ROTATE(tpb, 8); -#else - rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ - (tp9 >> 8) ^ (tp9 << 24) ^ - (tpb >> 24) ^ (tpb << 8); -#endif + + rk[j] = tpe ^ crypto_rol_u32(tpd, 16) ^ + crypto_rol_u32(tp9, 24) ^ crypto_rol_u32(tpb, 8); } } return 0; |