diff options
Diffstat (limited to 'src/lib/libcrypto/evp/e_aes.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_aes.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c index 790b26384d..35c8d944ed 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.51 2023/03/01 11:16:06 tb Exp $ */ | 1 | /* $OpenBSD: e_aes.c,v 1.52 2023/07/07 13:54:45 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 = { |
@@ -708,6 +711,7 @@ EVP_aes_128_cfb1(void) | |||
708 | return &aes_128_cfb1; | 711 | return &aes_128_cfb1; |
709 | #endif | 712 | #endif |
710 | } | 713 | } |
714 | LCRYPTO_ALIAS(EVP_aes_128_cfb1); | ||
711 | 715 | ||
712 | #ifdef AESNI_CAPABLE | 716 | #ifdef AESNI_CAPABLE |
713 | static const EVP_CIPHER aesni_128_cfb8 = { | 717 | static const EVP_CIPHER aesni_128_cfb8 = { |
@@ -742,6 +746,7 @@ EVP_aes_128_cfb8(void) | |||
742 | return &aes_128_cfb8; | 746 | return &aes_128_cfb8; |
743 | #endif | 747 | #endif |
744 | } | 748 | } |
749 | LCRYPTO_ALIAS(EVP_aes_128_cfb8); | ||
745 | 750 | ||
746 | #ifdef AESNI_CAPABLE | 751 | #ifdef AESNI_CAPABLE |
747 | static const EVP_CIPHER aesni_128_ctr = { | 752 | static const EVP_CIPHER aesni_128_ctr = { |
@@ -776,6 +781,7 @@ EVP_aes_128_ctr(void) | |||
776 | return &aes_128_ctr; | 781 | return &aes_128_ctr; |
777 | #endif | 782 | #endif |
778 | } | 783 | } |
784 | LCRYPTO_ALIAS(EVP_aes_128_ctr); | ||
779 | 785 | ||
780 | 786 | ||
781 | #ifdef AESNI_CAPABLE | 787 | #ifdef AESNI_CAPABLE |
@@ -811,6 +817,7 @@ EVP_aes_192_cbc(void) | |||
811 | return &aes_192_cbc; | 817 | return &aes_192_cbc; |
812 | #endif | 818 | #endif |
813 | } | 819 | } |
820 | LCRYPTO_ALIAS(EVP_aes_192_cbc); | ||
814 | 821 | ||
815 | #ifdef AESNI_CAPABLE | 822 | #ifdef AESNI_CAPABLE |
816 | static const EVP_CIPHER aesni_192_ecb = { | 823 | static const EVP_CIPHER aesni_192_ecb = { |
@@ -845,6 +852,7 @@ EVP_aes_192_ecb(void) | |||
845 | return &aes_192_ecb; | 852 | return &aes_192_ecb; |
846 | #endif | 853 | #endif |
847 | } | 854 | } |
855 | LCRYPTO_ALIAS(EVP_aes_192_ecb); | ||
848 | 856 | ||
849 | #ifdef AESNI_CAPABLE | 857 | #ifdef AESNI_CAPABLE |
850 | static const EVP_CIPHER aesni_192_ofb = { | 858 | static const EVP_CIPHER aesni_192_ofb = { |
@@ -879,6 +887,7 @@ EVP_aes_192_ofb(void) | |||
879 | return &aes_192_ofb; | 887 | return &aes_192_ofb; |
880 | #endif | 888 | #endif |
881 | } | 889 | } |
890 | LCRYPTO_ALIAS(EVP_aes_192_ofb); | ||
882 | 891 | ||
883 | #ifdef AESNI_CAPABLE | 892 | #ifdef AESNI_CAPABLE |
884 | static const EVP_CIPHER aesni_192_cfb = { | 893 | static const EVP_CIPHER aesni_192_cfb = { |
@@ -947,6 +956,7 @@ EVP_aes_192_cfb1(void) | |||
947 | return &aes_192_cfb1; | 956 | return &aes_192_cfb1; |
948 | #endif | 957 | #endif |
949 | } | 958 | } |
959 | LCRYPTO_ALIAS(EVP_aes_192_cfb1); | ||
950 | 960 | ||
951 | #ifdef AESNI_CAPABLE | 961 | #ifdef AESNI_CAPABLE |
952 | static const EVP_CIPHER aesni_192_cfb8 = { | 962 | static const EVP_CIPHER aesni_192_cfb8 = { |
@@ -981,6 +991,7 @@ EVP_aes_192_cfb8(void) | |||
981 | return &aes_192_cfb8; | 991 | return &aes_192_cfb8; |
982 | #endif | 992 | #endif |
983 | } | 993 | } |
994 | LCRYPTO_ALIAS(EVP_aes_192_cfb8); | ||
984 | 995 | ||
985 | #ifdef AESNI_CAPABLE | 996 | #ifdef AESNI_CAPABLE |
986 | static const EVP_CIPHER aesni_192_ctr = { | 997 | static const EVP_CIPHER aesni_192_ctr = { |
@@ -1015,6 +1026,7 @@ EVP_aes_192_ctr(void) | |||
1015 | return &aes_192_ctr; | 1026 | return &aes_192_ctr; |
1016 | #endif | 1027 | #endif |
1017 | } | 1028 | } |
1029 | LCRYPTO_ALIAS(EVP_aes_192_ctr); | ||
1018 | 1030 | ||
1019 | 1031 | ||
1020 | #ifdef AESNI_CAPABLE | 1032 | #ifdef AESNI_CAPABLE |
@@ -1050,6 +1062,7 @@ EVP_aes_256_cbc(void) | |||
1050 | return &aes_256_cbc; | 1062 | return &aes_256_cbc; |
1051 | #endif | 1063 | #endif |
1052 | } | 1064 | } |
1065 | LCRYPTO_ALIAS(EVP_aes_256_cbc); | ||
1053 | 1066 | ||
1054 | #ifdef AESNI_CAPABLE | 1067 | #ifdef AESNI_CAPABLE |
1055 | static const EVP_CIPHER aesni_256_ecb = { | 1068 | static const EVP_CIPHER aesni_256_ecb = { |
@@ -1084,6 +1097,7 @@ EVP_aes_256_ecb(void) | |||
1084 | return &aes_256_ecb; | 1097 | return &aes_256_ecb; |
1085 | #endif | 1098 | #endif |
1086 | } | 1099 | } |
1100 | LCRYPTO_ALIAS(EVP_aes_256_ecb); | ||
1087 | 1101 | ||
1088 | #ifdef AESNI_CAPABLE | 1102 | #ifdef AESNI_CAPABLE |
1089 | static const EVP_CIPHER aesni_256_ofb = { | 1103 | static const EVP_CIPHER aesni_256_ofb = { |
@@ -1118,6 +1132,7 @@ EVP_aes_256_ofb(void) | |||
1118 | return &aes_256_ofb; | 1132 | return &aes_256_ofb; |
1119 | #endif | 1133 | #endif |
1120 | } | 1134 | } |
1135 | LCRYPTO_ALIAS(EVP_aes_256_ofb); | ||
1121 | 1136 | ||
1122 | #ifdef AESNI_CAPABLE | 1137 | #ifdef AESNI_CAPABLE |
1123 | static const EVP_CIPHER aesni_256_cfb = { | 1138 | static const EVP_CIPHER aesni_256_cfb = { |
@@ -1186,6 +1201,7 @@ EVP_aes_256_cfb1(void) | |||
1186 | return &aes_256_cfb1; | 1201 | return &aes_256_cfb1; |
1187 | #endif | 1202 | #endif |
1188 | } | 1203 | } |
1204 | LCRYPTO_ALIAS(EVP_aes_256_cfb1); | ||
1189 | 1205 | ||
1190 | #ifdef AESNI_CAPABLE | 1206 | #ifdef AESNI_CAPABLE |
1191 | static const EVP_CIPHER aesni_256_cfb8 = { | 1207 | static const EVP_CIPHER aesni_256_cfb8 = { |
@@ -1220,6 +1236,7 @@ EVP_aes_256_cfb8(void) | |||
1220 | return &aes_256_cfb8; | 1236 | return &aes_256_cfb8; |
1221 | #endif | 1237 | #endif |
1222 | } | 1238 | } |
1239 | LCRYPTO_ALIAS(EVP_aes_256_cfb8); | ||
1223 | 1240 | ||
1224 | #ifdef AESNI_CAPABLE | 1241 | #ifdef AESNI_CAPABLE |
1225 | static const EVP_CIPHER aesni_256_ctr = { | 1242 | static const EVP_CIPHER aesni_256_ctr = { |
@@ -1254,6 +1271,7 @@ EVP_aes_256_ctr(void) | |||
1254 | return &aes_256_ctr; | 1271 | return &aes_256_ctr; |
1255 | #endif | 1272 | #endif |
1256 | } | 1273 | } |
1274 | LCRYPTO_ALIAS(EVP_aes_256_ctr); | ||
1257 | 1275 | ||
1258 | static int | 1276 | static int |
1259 | aes_gcm_cleanup(EVP_CIPHER_CTX *c) | 1277 | aes_gcm_cleanup(EVP_CIPHER_CTX *c) |
@@ -1672,6 +1690,7 @@ EVP_aes_128_gcm(void) | |||
1672 | return &aes_128_gcm; | 1690 | return &aes_128_gcm; |
1673 | #endif | 1691 | #endif |
1674 | } | 1692 | } |
1693 | LCRYPTO_ALIAS(EVP_aes_128_gcm); | ||
1675 | 1694 | ||
1676 | #ifdef AESNI_CAPABLE | 1695 | #ifdef AESNI_CAPABLE |
1677 | static const EVP_CIPHER aesni_192_gcm = { | 1696 | static const EVP_CIPHER aesni_192_gcm = { |
@@ -1710,6 +1729,7 @@ EVP_aes_192_gcm(void) | |||
1710 | return &aes_192_gcm; | 1729 | return &aes_192_gcm; |
1711 | #endif | 1730 | #endif |
1712 | } | 1731 | } |
1732 | LCRYPTO_ALIAS(EVP_aes_192_gcm); | ||
1713 | 1733 | ||
1714 | #ifdef AESNI_CAPABLE | 1734 | #ifdef AESNI_CAPABLE |
1715 | static const EVP_CIPHER aesni_256_gcm = { | 1735 | static const EVP_CIPHER aesni_256_gcm = { |
@@ -1748,6 +1768,7 @@ EVP_aes_256_gcm(void) | |||
1748 | return &aes_256_gcm; | 1768 | return &aes_256_gcm; |
1749 | #endif | 1769 | #endif |
1750 | } | 1770 | } |
1771 | LCRYPTO_ALIAS(EVP_aes_256_gcm); | ||
1751 | 1772 | ||
1752 | static int | 1773 | static int |
1753 | aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | 1774 | aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) |
@@ -1914,6 +1935,7 @@ EVP_aes_128_xts(void) | |||
1914 | return &aes_128_xts; | 1935 | return &aes_128_xts; |
1915 | #endif | 1936 | #endif |
1916 | } | 1937 | } |
1938 | LCRYPTO_ALIAS(EVP_aes_128_xts); | ||
1917 | 1939 | ||
1918 | #ifdef AESNI_CAPABLE | 1940 | #ifdef AESNI_CAPABLE |
1919 | static const EVP_CIPHER aesni_256_xts = { | 1941 | static const EVP_CIPHER aesni_256_xts = { |
@@ -1952,6 +1974,7 @@ EVP_aes_256_xts(void) | |||
1952 | return &aes_256_xts; | 1974 | return &aes_256_xts; |
1953 | #endif | 1975 | #endif |
1954 | } | 1976 | } |
1977 | LCRYPTO_ALIAS(EVP_aes_256_xts); | ||
1955 | 1978 | ||
1956 | static int | 1979 | static int |
1957 | aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | 1980 | aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) |
@@ -2148,6 +2171,7 @@ EVP_aes_128_ccm(void) | |||
2148 | return &aes_128_ccm; | 2171 | return &aes_128_ccm; |
2149 | #endif | 2172 | #endif |
2150 | } | 2173 | } |
2174 | LCRYPTO_ALIAS(EVP_aes_128_ccm); | ||
2151 | 2175 | ||
2152 | #ifdef AESNI_CAPABLE | 2176 | #ifdef AESNI_CAPABLE |
2153 | static const EVP_CIPHER aesni_192_ccm = { | 2177 | static const EVP_CIPHER aesni_192_ccm = { |
@@ -2186,6 +2210,7 @@ EVP_aes_192_ccm(void) | |||
2186 | return &aes_192_ccm; | 2210 | return &aes_192_ccm; |
2187 | #endif | 2211 | #endif |
2188 | } | 2212 | } |
2213 | LCRYPTO_ALIAS(EVP_aes_192_ccm); | ||
2189 | 2214 | ||
2190 | #ifdef AESNI_CAPABLE | 2215 | #ifdef AESNI_CAPABLE |
2191 | static const EVP_CIPHER aesni_256_ccm = { | 2216 | static const EVP_CIPHER aesni_256_ccm = { |
@@ -2224,6 +2249,7 @@ EVP_aes_256_ccm(void) | |||
2224 | return &aes_256_ccm; | 2249 | return &aes_256_ccm; |
2225 | #endif | 2250 | #endif |
2226 | } | 2251 | } |
2252 | LCRYPTO_ALIAS(EVP_aes_256_ccm); | ||
2227 | 2253 | ||
2228 | #define EVP_AEAD_AES_GCM_TAG_LEN 16 | 2254 | #define EVP_AEAD_AES_GCM_TAG_LEN 16 |
2229 | 2255 | ||
@@ -2414,12 +2440,14 @@ EVP_aead_aes_128_gcm(void) | |||
2414 | { | 2440 | { |
2415 | return &aead_aes_128_gcm; | 2441 | return &aead_aes_128_gcm; |
2416 | } | 2442 | } |
2443 | LCRYPTO_ALIAS(EVP_aead_aes_128_gcm); | ||
2417 | 2444 | ||
2418 | const EVP_AEAD * | 2445 | const EVP_AEAD * |
2419 | EVP_aead_aes_256_gcm(void) | 2446 | EVP_aead_aes_256_gcm(void) |
2420 | { | 2447 | { |
2421 | return &aead_aes_256_gcm; | 2448 | return &aead_aes_256_gcm; |
2422 | } | 2449 | } |
2450 | LCRYPTO_ALIAS(EVP_aead_aes_256_gcm); | ||
2423 | 2451 | ||
2424 | typedef struct { | 2452 | typedef struct { |
2425 | union { | 2453 | union { |
@@ -2545,6 +2573,7 @@ EVP_aes_128_wrap(void) | |||
2545 | { | 2573 | { |
2546 | return &aes_128_wrap; | 2574 | return &aes_128_wrap; |
2547 | } | 2575 | } |
2576 | LCRYPTO_ALIAS(EVP_aes_128_wrap); | ||
2548 | 2577 | ||
2549 | static const EVP_CIPHER aes_192_wrap = { | 2578 | static const EVP_CIPHER aes_192_wrap = { |
2550 | .nid = NID_id_aes192_wrap, | 2579 | .nid = NID_id_aes192_wrap, |
@@ -2567,6 +2596,7 @@ EVP_aes_192_wrap(void) | |||
2567 | { | 2596 | { |
2568 | return &aes_192_wrap; | 2597 | return &aes_192_wrap; |
2569 | } | 2598 | } |
2599 | LCRYPTO_ALIAS(EVP_aes_192_wrap); | ||
2570 | 2600 | ||
2571 | static const EVP_CIPHER aes_256_wrap = { | 2601 | static const EVP_CIPHER aes_256_wrap = { |
2572 | .nid = NID_id_aes256_wrap, | 2602 | .nid = NID_id_aes256_wrap, |
@@ -2589,5 +2619,6 @@ EVP_aes_256_wrap(void) | |||
2589 | { | 2619 | { |
2590 | return &aes_256_wrap; | 2620 | return &aes_256_wrap; |
2591 | } | 2621 | } |
2622 | LCRYPTO_ALIAS(EVP_aes_256_wrap); | ||
2592 | 2623 | ||
2593 | #endif | 2624 | #endif |