diff options
Diffstat (limited to 'src/lib/libcrypto/evp/e_aes.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_aes.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c index 1102b21c15..6135c7d84a 100644 --- a/src/lib/libcrypto/evp/e_aes.c +++ b/src/lib/libcrypto/evp/e_aes.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_aes.c,v 1.57 2024/04/09 13:48:51 beck Exp $ */ | 1 | /* $OpenBSD: e_aes.c,v 1.58 2024/04/09 13:52:41 beck Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -572,6 +572,7 @@ EVP_aes_128_cbc(void) | |||
572 | return &aes_128_cbc; | 572 | return &aes_128_cbc; |
573 | #endif | 573 | #endif |
574 | } | 574 | } |
575 | LCRYPTO_ALIAS(EVP_aes_128_cbc); | ||
575 | 576 | ||
576 | #ifdef AESNI_CAPABLE | 577 | #ifdef AESNI_CAPABLE |
577 | static const EVP_CIPHER aesni_128_ecb = { | 578 | static const EVP_CIPHER aesni_128_ecb = { |
@@ -606,6 +607,7 @@ EVP_aes_128_ecb(void) | |||
606 | return &aes_128_ecb; | 607 | return &aes_128_ecb; |
607 | #endif | 608 | #endif |
608 | } | 609 | } |
610 | LCRYPTO_ALIAS(EVP_aes_128_ecb); | ||
609 | 611 | ||
610 | #ifdef AESNI_CAPABLE | 612 | #ifdef AESNI_CAPABLE |
611 | static const EVP_CIPHER aesni_128_ofb = { | 613 | static const EVP_CIPHER aesni_128_ofb = { |
@@ -640,6 +642,7 @@ EVP_aes_128_ofb(void) | |||
640 | return &aes_128_ofb; | 642 | return &aes_128_ofb; |
641 | #endif | 643 | #endif |
642 | } | 644 | } |
645 | LCRYPTO_ALIAS(EVP_aes_128_ofb); | ||
643 | 646 | ||
644 | #ifdef AESNI_CAPABLE | 647 | #ifdef AESNI_CAPABLE |
645 | static const EVP_CIPHER aesni_128_cfb = { | 648 | static const EVP_CIPHER aesni_128_cfb = { |
@@ -674,6 +677,7 @@ EVP_aes_128_cfb128(void) | |||
674 | return &aes_128_cfb; | 677 | return &aes_128_cfb; |
675 | #endif | 678 | #endif |
676 | } | 679 | } |
680 | LCRYPTO_ALIAS(EVP_aes_128_cfb128); | ||
677 | 681 | ||
678 | #ifdef AESNI_CAPABLE | 682 | #ifdef AESNI_CAPABLE |
679 | static const EVP_CIPHER aesni_128_cfb1 = { | 683 | static const EVP_CIPHER aesni_128_cfb1 = { |
@@ -708,6 +712,7 @@ EVP_aes_128_cfb1(void) | |||
708 | return &aes_128_cfb1; | 712 | return &aes_128_cfb1; |
709 | #endif | 713 | #endif |
710 | } | 714 | } |
715 | LCRYPTO_ALIAS(EVP_aes_128_cfb1); | ||
711 | 716 | ||
712 | #ifdef AESNI_CAPABLE | 717 | #ifdef AESNI_CAPABLE |
713 | static const EVP_CIPHER aesni_128_cfb8 = { | 718 | static const EVP_CIPHER aesni_128_cfb8 = { |
@@ -742,6 +747,7 @@ EVP_aes_128_cfb8(void) | |||
742 | return &aes_128_cfb8; | 747 | return &aes_128_cfb8; |
743 | #endif | 748 | #endif |
744 | } | 749 | } |
750 | LCRYPTO_ALIAS(EVP_aes_128_cfb8); | ||
745 | 751 | ||
746 | #ifdef AESNI_CAPABLE | 752 | #ifdef AESNI_CAPABLE |
747 | static const EVP_CIPHER aesni_128_ctr = { | 753 | static const EVP_CIPHER aesni_128_ctr = { |
@@ -776,6 +782,7 @@ EVP_aes_128_ctr(void) | |||
776 | return &aes_128_ctr; | 782 | return &aes_128_ctr; |
777 | #endif | 783 | #endif |
778 | } | 784 | } |
785 | LCRYPTO_ALIAS(EVP_aes_128_ctr); | ||
779 | 786 | ||
780 | 787 | ||
781 | #ifdef AESNI_CAPABLE | 788 | #ifdef AESNI_CAPABLE |
@@ -811,6 +818,7 @@ EVP_aes_192_cbc(void) | |||
811 | return &aes_192_cbc; | 818 | return &aes_192_cbc; |
812 | #endif | 819 | #endif |
813 | } | 820 | } |
821 | LCRYPTO_ALIAS(EVP_aes_192_cbc); | ||
814 | 822 | ||
815 | #ifdef AESNI_CAPABLE | 823 | #ifdef AESNI_CAPABLE |
816 | static const EVP_CIPHER aesni_192_ecb = { | 824 | static const EVP_CIPHER aesni_192_ecb = { |
@@ -845,6 +853,7 @@ EVP_aes_192_ecb(void) | |||
845 | return &aes_192_ecb; | 853 | return &aes_192_ecb; |
846 | #endif | 854 | #endif |
847 | } | 855 | } |
856 | LCRYPTO_ALIAS(EVP_aes_192_ecb); | ||
848 | 857 | ||
849 | #ifdef AESNI_CAPABLE | 858 | #ifdef AESNI_CAPABLE |
850 | static const EVP_CIPHER aesni_192_ofb = { | 859 | static const EVP_CIPHER aesni_192_ofb = { |
@@ -879,6 +888,7 @@ EVP_aes_192_ofb(void) | |||
879 | return &aes_192_ofb; | 888 | return &aes_192_ofb; |
880 | #endif | 889 | #endif |
881 | } | 890 | } |
891 | LCRYPTO_ALIAS(EVP_aes_192_ofb); | ||
882 | 892 | ||
883 | #ifdef AESNI_CAPABLE | 893 | #ifdef AESNI_CAPABLE |
884 | static const EVP_CIPHER aesni_192_cfb = { | 894 | static const EVP_CIPHER aesni_192_cfb = { |
@@ -913,6 +923,7 @@ EVP_aes_192_cfb128(void) | |||
913 | return &aes_192_cfb; | 923 | return &aes_192_cfb; |
914 | #endif | 924 | #endif |
915 | } | 925 | } |
926 | LCRYPTO_ALIAS(EVP_aes_192_cfb128); | ||
916 | 927 | ||
917 | #ifdef AESNI_CAPABLE | 928 | #ifdef AESNI_CAPABLE |
918 | static const EVP_CIPHER aesni_192_cfb1 = { | 929 | static const EVP_CIPHER aesni_192_cfb1 = { |
@@ -947,6 +958,7 @@ EVP_aes_192_cfb1(void) | |||
947 | return &aes_192_cfb1; | 958 | return &aes_192_cfb1; |
948 | #endif | 959 | #endif |
949 | } | 960 | } |
961 | LCRYPTO_ALIAS(EVP_aes_192_cfb1); | ||
950 | 962 | ||
951 | #ifdef AESNI_CAPABLE | 963 | #ifdef AESNI_CAPABLE |
952 | static const EVP_CIPHER aesni_192_cfb8 = { | 964 | static const EVP_CIPHER aesni_192_cfb8 = { |
@@ -981,6 +993,7 @@ EVP_aes_192_cfb8(void) | |||
981 | return &aes_192_cfb8; | 993 | return &aes_192_cfb8; |
982 | #endif | 994 | #endif |
983 | } | 995 | } |
996 | LCRYPTO_ALIAS(EVP_aes_192_cfb8); | ||
984 | 997 | ||
985 | #ifdef AESNI_CAPABLE | 998 | #ifdef AESNI_CAPABLE |
986 | static const EVP_CIPHER aesni_192_ctr = { | 999 | static const EVP_CIPHER aesni_192_ctr = { |
@@ -1015,6 +1028,7 @@ EVP_aes_192_ctr(void) | |||
1015 | return &aes_192_ctr; | 1028 | return &aes_192_ctr; |
1016 | #endif | 1029 | #endif |
1017 | } | 1030 | } |
1031 | LCRYPTO_ALIAS(EVP_aes_192_ctr); | ||
1018 | 1032 | ||
1019 | 1033 | ||
1020 | #ifdef AESNI_CAPABLE | 1034 | #ifdef AESNI_CAPABLE |
@@ -1050,6 +1064,7 @@ EVP_aes_256_cbc(void) | |||
1050 | return &aes_256_cbc; | 1064 | return &aes_256_cbc; |
1051 | #endif | 1065 | #endif |
1052 | } | 1066 | } |
1067 | LCRYPTO_ALIAS(EVP_aes_256_cbc); | ||
1053 | 1068 | ||
1054 | #ifdef AESNI_CAPABLE | 1069 | #ifdef AESNI_CAPABLE |
1055 | static const EVP_CIPHER aesni_256_ecb = { | 1070 | static const EVP_CIPHER aesni_256_ecb = { |
@@ -1084,6 +1099,7 @@ EVP_aes_256_ecb(void) | |||
1084 | return &aes_256_ecb; | 1099 | return &aes_256_ecb; |
1085 | #endif | 1100 | #endif |
1086 | } | 1101 | } |
1102 | LCRYPTO_ALIAS(EVP_aes_256_ecb); | ||
1087 | 1103 | ||
1088 | #ifdef AESNI_CAPABLE | 1104 | #ifdef AESNI_CAPABLE |
1089 | static const EVP_CIPHER aesni_256_ofb = { | 1105 | static const EVP_CIPHER aesni_256_ofb = { |
@@ -1118,6 +1134,7 @@ EVP_aes_256_ofb(void) | |||
1118 | return &aes_256_ofb; | 1134 | return &aes_256_ofb; |
1119 | #endif | 1135 | #endif |
1120 | } | 1136 | } |
1137 | LCRYPTO_ALIAS(EVP_aes_256_ofb); | ||
1121 | 1138 | ||
1122 | #ifdef AESNI_CAPABLE | 1139 | #ifdef AESNI_CAPABLE |
1123 | static const EVP_CIPHER aesni_256_cfb = { | 1140 | static const EVP_CIPHER aesni_256_cfb = { |
@@ -1152,6 +1169,7 @@ EVP_aes_256_cfb128(void) | |||
1152 | return &aes_256_cfb; | 1169 | return &aes_256_cfb; |
1153 | #endif | 1170 | #endif |
1154 | } | 1171 | } |
1172 | LCRYPTO_ALIAS(EVP_aes_256_cfb128); | ||
1155 | 1173 | ||
1156 | #ifdef AESNI_CAPABLE | 1174 | #ifdef AESNI_CAPABLE |
1157 | static const EVP_CIPHER aesni_256_cfb1 = { | 1175 | static const EVP_CIPHER aesni_256_cfb1 = { |
@@ -1186,6 +1204,7 @@ EVP_aes_256_cfb1(void) | |||
1186 | return &aes_256_cfb1; | 1204 | return &aes_256_cfb1; |
1187 | #endif | 1205 | #endif |
1188 | } | 1206 | } |
1207 | LCRYPTO_ALIAS(EVP_aes_256_cfb1); | ||
1189 | 1208 | ||
1190 | #ifdef AESNI_CAPABLE | 1209 | #ifdef AESNI_CAPABLE |
1191 | static const EVP_CIPHER aesni_256_cfb8 = { | 1210 | static const EVP_CIPHER aesni_256_cfb8 = { |
@@ -1220,6 +1239,7 @@ EVP_aes_256_cfb8(void) | |||
1220 | return &aes_256_cfb8; | 1239 | return &aes_256_cfb8; |
1221 | #endif | 1240 | #endif |
1222 | } | 1241 | } |
1242 | LCRYPTO_ALIAS(EVP_aes_256_cfb8); | ||
1223 | 1243 | ||
1224 | #ifdef AESNI_CAPABLE | 1244 | #ifdef AESNI_CAPABLE |
1225 | static const EVP_CIPHER aesni_256_ctr = { | 1245 | static const EVP_CIPHER aesni_256_ctr = { |
@@ -1254,6 +1274,7 @@ EVP_aes_256_ctr(void) | |||
1254 | return &aes_256_ctr; | 1274 | return &aes_256_ctr; |
1255 | #endif | 1275 | #endif |
1256 | } | 1276 | } |
1277 | LCRYPTO_ALIAS(EVP_aes_256_ctr); | ||
1257 | 1278 | ||
1258 | static int | 1279 | static int |
1259 | aes_gcm_cleanup(EVP_CIPHER_CTX *c) | 1280 | aes_gcm_cleanup(EVP_CIPHER_CTX *c) |
@@ -1677,6 +1698,7 @@ EVP_aes_128_gcm(void) | |||
1677 | return &aes_128_gcm; | 1698 | return &aes_128_gcm; |
1678 | #endif | 1699 | #endif |
1679 | } | 1700 | } |
1701 | LCRYPTO_ALIAS(EVP_aes_128_gcm); | ||
1680 | 1702 | ||
1681 | #ifdef AESNI_CAPABLE | 1703 | #ifdef AESNI_CAPABLE |
1682 | static const EVP_CIPHER aesni_192_gcm = { | 1704 | static const EVP_CIPHER aesni_192_gcm = { |
@@ -1715,6 +1737,7 @@ EVP_aes_192_gcm(void) | |||
1715 | return &aes_192_gcm; | 1737 | return &aes_192_gcm; |
1716 | #endif | 1738 | #endif |
1717 | } | 1739 | } |
1740 | LCRYPTO_ALIAS(EVP_aes_192_gcm); | ||
1718 | 1741 | ||
1719 | #ifdef AESNI_CAPABLE | 1742 | #ifdef AESNI_CAPABLE |
1720 | static const EVP_CIPHER aesni_256_gcm = { | 1743 | static const EVP_CIPHER aesni_256_gcm = { |
@@ -1753,6 +1776,7 @@ EVP_aes_256_gcm(void) | |||
1753 | return &aes_256_gcm; | 1776 | return &aes_256_gcm; |
1754 | #endif | 1777 | #endif |
1755 | } | 1778 | } |
1779 | LCRYPTO_ALIAS(EVP_aes_256_gcm); | ||
1756 | 1780 | ||
1757 | static int | 1781 | static int |
1758 | aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | 1782 | aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) |
@@ -1919,6 +1943,7 @@ EVP_aes_128_xts(void) | |||
1919 | return &aes_128_xts; | 1943 | return &aes_128_xts; |
1920 | #endif | 1944 | #endif |
1921 | } | 1945 | } |
1946 | LCRYPTO_ALIAS(EVP_aes_128_xts); | ||
1922 | 1947 | ||
1923 | #ifdef AESNI_CAPABLE | 1948 | #ifdef AESNI_CAPABLE |
1924 | static const EVP_CIPHER aesni_256_xts = { | 1949 | static const EVP_CIPHER aesni_256_xts = { |
@@ -1957,6 +1982,7 @@ EVP_aes_256_xts(void) | |||
1957 | return &aes_256_xts; | 1982 | return &aes_256_xts; |
1958 | #endif | 1983 | #endif |
1959 | } | 1984 | } |
1985 | LCRYPTO_ALIAS(EVP_aes_256_xts); | ||
1960 | 1986 | ||
1961 | static int | 1987 | static int |
1962 | aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | 1988 | aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) |
@@ -2157,6 +2183,7 @@ EVP_aes_128_ccm(void) | |||
2157 | return &aes_128_ccm; | 2183 | return &aes_128_ccm; |
2158 | #endif | 2184 | #endif |
2159 | } | 2185 | } |
2186 | LCRYPTO_ALIAS(EVP_aes_128_ccm); | ||
2160 | 2187 | ||
2161 | #ifdef AESNI_CAPABLE | 2188 | #ifdef AESNI_CAPABLE |
2162 | static const EVP_CIPHER aesni_192_ccm = { | 2189 | static const EVP_CIPHER aesni_192_ccm = { |
@@ -2195,6 +2222,7 @@ EVP_aes_192_ccm(void) | |||
2195 | return &aes_192_ccm; | 2222 | return &aes_192_ccm; |
2196 | #endif | 2223 | #endif |
2197 | } | 2224 | } |
2225 | LCRYPTO_ALIAS(EVP_aes_192_ccm); | ||
2198 | 2226 | ||
2199 | #ifdef AESNI_CAPABLE | 2227 | #ifdef AESNI_CAPABLE |
2200 | static const EVP_CIPHER aesni_256_ccm = { | 2228 | static const EVP_CIPHER aesni_256_ccm = { |
@@ -2233,6 +2261,7 @@ EVP_aes_256_ccm(void) | |||
2233 | return &aes_256_ccm; | 2261 | return &aes_256_ccm; |
2234 | #endif | 2262 | #endif |
2235 | } | 2263 | } |
2264 | LCRYPTO_ALIAS(EVP_aes_256_ccm); | ||
2236 | 2265 | ||
2237 | #define EVP_AEAD_AES_GCM_TAG_LEN 16 | 2266 | #define EVP_AEAD_AES_GCM_TAG_LEN 16 |
2238 | 2267 | ||
@@ -2423,12 +2452,14 @@ EVP_aead_aes_128_gcm(void) | |||
2423 | { | 2452 | { |
2424 | return &aead_aes_128_gcm; | 2453 | return &aead_aes_128_gcm; |
2425 | } | 2454 | } |
2455 | LCRYPTO_ALIAS(EVP_aead_aes_128_gcm); | ||
2426 | 2456 | ||
2427 | const EVP_AEAD * | 2457 | const EVP_AEAD * |
2428 | EVP_aead_aes_256_gcm(void) | 2458 | EVP_aead_aes_256_gcm(void) |
2429 | { | 2459 | { |
2430 | return &aead_aes_256_gcm; | 2460 | return &aead_aes_256_gcm; |
2431 | } | 2461 | } |
2462 | LCRYPTO_ALIAS(EVP_aead_aes_256_gcm); | ||
2432 | 2463 | ||
2433 | typedef struct { | 2464 | typedef struct { |
2434 | union { | 2465 | union { |
@@ -2557,6 +2588,7 @@ EVP_aes_128_wrap(void) | |||
2557 | { | 2588 | { |
2558 | return &aes_128_wrap; | 2589 | return &aes_128_wrap; |
2559 | } | 2590 | } |
2591 | LCRYPTO_ALIAS(EVP_aes_128_wrap); | ||
2560 | 2592 | ||
2561 | static const EVP_CIPHER aes_192_wrap = { | 2593 | static const EVP_CIPHER aes_192_wrap = { |
2562 | .nid = NID_id_aes192_wrap, | 2594 | .nid = NID_id_aes192_wrap, |
@@ -2578,6 +2610,7 @@ EVP_aes_192_wrap(void) | |||
2578 | { | 2610 | { |
2579 | return &aes_192_wrap; | 2611 | return &aes_192_wrap; |
2580 | } | 2612 | } |
2613 | LCRYPTO_ALIAS(EVP_aes_192_wrap); | ||
2581 | 2614 | ||
2582 | static const EVP_CIPHER aes_256_wrap = { | 2615 | static const EVP_CIPHER aes_256_wrap = { |
2583 | .nid = NID_id_aes256_wrap, | 2616 | .nid = NID_id_aes256_wrap, |
@@ -2599,5 +2632,6 @@ EVP_aes_256_wrap(void) | |||
2599 | { | 2632 | { |
2600 | return &aes_256_wrap; | 2633 | return &aes_256_wrap; |
2601 | } | 2634 | } |
2635 | LCRYPTO_ALIAS(EVP_aes_256_wrap); | ||
2602 | 2636 | ||
2603 | #endif | 2637 | #endif |