diff options
author | jsing <> | 2024-03-27 06:51:59 +0000 |
---|---|---|
committer | jsing <> | 2024-03-27 06:51:59 +0000 |
commit | 8f0ec9395ddcd8b87251d1f46ea912a8ead3d7d8 (patch) | |
tree | 45f9a3477068d30926ea1ee13c0117cc9d90fe29 /src/lib | |
parent | 452d650e76b0bb75f6ea2d1cc511b37385a1ddea (diff) | |
download | openbsd-8f0ec9395ddcd8b87251d1f46ea912a8ead3d7d8.tar.gz openbsd-8f0ec9395ddcd8b87251d1f46ea912a8ead3d7d8.tar.bz2 openbsd-8f0ec9395ddcd8b87251d1f46ea912a8ead3d7d8.zip |
Use crypto_rol_u32() instead of an undefined ROTATE macro.
ok tb@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/aes/aes_core.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/libcrypto/aes/aes_core.c b/src/lib/libcrypto/aes/aes_core.c index 3df4aec3cd..9ec84a5c82 100644 --- a/src/lib/libcrypto/aes/aes_core.c +++ b/src/lib/libcrypto/aes/aes_core.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: aes_core.c,v 1.16 2024/03/27 06:39:46 jsing Exp $ */ | 1 | /* $OpenBSD: aes_core.c,v 1.17 2024/03/27 06:51:59 jsing Exp $ */ |
2 | /** | 2 | /** |
3 | * rijndael-alg-fst.c | 3 | * rijndael-alg-fst.c |
4 | * | 4 | * |
@@ -35,6 +35,7 @@ | |||
35 | #include <openssl/aes.h> | 35 | #include <openssl/aes.h> |
36 | 36 | ||
37 | #include "aes_local.h" | 37 | #include "aes_local.h" |
38 | #include "crypto_internal.h" | ||
38 | 39 | ||
39 | #ifndef AES_ASM | 40 | #ifndef AES_ASM |
40 | /* | 41 | /* |
@@ -1356,14 +1357,9 @@ AES_set_decrypt_key(const unsigned char *userKey, const int bits, | |||
1356 | tpb = tp9 ^ tp2; | 1357 | tpb = tp9 ^ tp2; |
1357 | tpd = tp9 ^ tp4; | 1358 | tpd = tp9 ^ tp4; |
1358 | tpe = tp8 ^ tp4 ^ tp2; | 1359 | tpe = tp8 ^ tp4 ^ tp2; |
1359 | #if defined(ROTATE) | 1360 | |
1360 | rk[j] = tpe ^ ROTATE(tpd, 16) ^ | 1361 | rk[j] = tpe ^ crypto_rol_u32(tpd, 16) ^ |
1361 | ROTATE(tp9, 24) ^ ROTATE(tpb, 8); | 1362 | crypto_rol_u32(tp9, 24) ^ crypto_rol_u32(tpb, 8); |
1362 | #else | ||
1363 | rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ | ||
1364 | (tp9 >> 8) ^ (tp9 << 24) ^ | ||
1365 | (tpb >> 24) ^ (tpb << 8); | ||
1366 | #endif | ||
1367 | } | 1363 | } |
1368 | } | 1364 | } |
1369 | return 0; | 1365 | return 0; |