summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_aes.c')
-rw-r--r--src/lib/libcrypto/evp/e_aes.c36
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}
575LCRYPTO_ALIAS(EVP_aes_128_cbc);
575 576
576#ifdef AESNI_CAPABLE 577#ifdef AESNI_CAPABLE
577static const EVP_CIPHER aesni_128_ecb = { 578static 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}
610LCRYPTO_ALIAS(EVP_aes_128_ecb);
609 611
610#ifdef AESNI_CAPABLE 612#ifdef AESNI_CAPABLE
611static const EVP_CIPHER aesni_128_ofb = { 613static 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}
645LCRYPTO_ALIAS(EVP_aes_128_ofb);
643 646
644#ifdef AESNI_CAPABLE 647#ifdef AESNI_CAPABLE
645static const EVP_CIPHER aesni_128_cfb = { 648static 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}
680LCRYPTO_ALIAS(EVP_aes_128_cfb128);
677 681
678#ifdef AESNI_CAPABLE 682#ifdef AESNI_CAPABLE
679static const EVP_CIPHER aesni_128_cfb1 = { 683static 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}
715LCRYPTO_ALIAS(EVP_aes_128_cfb1);
711 716
712#ifdef AESNI_CAPABLE 717#ifdef AESNI_CAPABLE
713static const EVP_CIPHER aesni_128_cfb8 = { 718static 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}
750LCRYPTO_ALIAS(EVP_aes_128_cfb8);
745 751
746#ifdef AESNI_CAPABLE 752#ifdef AESNI_CAPABLE
747static const EVP_CIPHER aesni_128_ctr = { 753static 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}
785LCRYPTO_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}
821LCRYPTO_ALIAS(EVP_aes_192_cbc);
814 822
815#ifdef AESNI_CAPABLE 823#ifdef AESNI_CAPABLE
816static const EVP_CIPHER aesni_192_ecb = { 824static 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}
856LCRYPTO_ALIAS(EVP_aes_192_ecb);
848 857
849#ifdef AESNI_CAPABLE 858#ifdef AESNI_CAPABLE
850static const EVP_CIPHER aesni_192_ofb = { 859static 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}
891LCRYPTO_ALIAS(EVP_aes_192_ofb);
882 892
883#ifdef AESNI_CAPABLE 893#ifdef AESNI_CAPABLE
884static const EVP_CIPHER aesni_192_cfb = { 894static 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}
926LCRYPTO_ALIAS(EVP_aes_192_cfb128);
916 927
917#ifdef AESNI_CAPABLE 928#ifdef AESNI_CAPABLE
918static const EVP_CIPHER aesni_192_cfb1 = { 929static 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}
961LCRYPTO_ALIAS(EVP_aes_192_cfb1);
950 962
951#ifdef AESNI_CAPABLE 963#ifdef AESNI_CAPABLE
952static const EVP_CIPHER aesni_192_cfb8 = { 964static 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}
996LCRYPTO_ALIAS(EVP_aes_192_cfb8);
984 997
985#ifdef AESNI_CAPABLE 998#ifdef AESNI_CAPABLE
986static const EVP_CIPHER aesni_192_ctr = { 999static 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}
1031LCRYPTO_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}
1067LCRYPTO_ALIAS(EVP_aes_256_cbc);
1053 1068
1054#ifdef AESNI_CAPABLE 1069#ifdef AESNI_CAPABLE
1055static const EVP_CIPHER aesni_256_ecb = { 1070static 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}
1102LCRYPTO_ALIAS(EVP_aes_256_ecb);
1087 1103
1088#ifdef AESNI_CAPABLE 1104#ifdef AESNI_CAPABLE
1089static const EVP_CIPHER aesni_256_ofb = { 1105static 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}
1137LCRYPTO_ALIAS(EVP_aes_256_ofb);
1121 1138
1122#ifdef AESNI_CAPABLE 1139#ifdef AESNI_CAPABLE
1123static const EVP_CIPHER aesni_256_cfb = { 1140static 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}
1172LCRYPTO_ALIAS(EVP_aes_256_cfb128);
1155 1173
1156#ifdef AESNI_CAPABLE 1174#ifdef AESNI_CAPABLE
1157static const EVP_CIPHER aesni_256_cfb1 = { 1175static 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}
1207LCRYPTO_ALIAS(EVP_aes_256_cfb1);
1189 1208
1190#ifdef AESNI_CAPABLE 1209#ifdef AESNI_CAPABLE
1191static const EVP_CIPHER aesni_256_cfb8 = { 1210static 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}
1242LCRYPTO_ALIAS(EVP_aes_256_cfb8);
1223 1243
1224#ifdef AESNI_CAPABLE 1244#ifdef AESNI_CAPABLE
1225static const EVP_CIPHER aesni_256_ctr = { 1245static 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}
1277LCRYPTO_ALIAS(EVP_aes_256_ctr);
1257 1278
1258static int 1279static int
1259aes_gcm_cleanup(EVP_CIPHER_CTX *c) 1280aes_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}
1701LCRYPTO_ALIAS(EVP_aes_128_gcm);
1680 1702
1681#ifdef AESNI_CAPABLE 1703#ifdef AESNI_CAPABLE
1682static const EVP_CIPHER aesni_192_gcm = { 1704static 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}
1740LCRYPTO_ALIAS(EVP_aes_192_gcm);
1718 1741
1719#ifdef AESNI_CAPABLE 1742#ifdef AESNI_CAPABLE
1720static const EVP_CIPHER aesni_256_gcm = { 1743static 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}
1779LCRYPTO_ALIAS(EVP_aes_256_gcm);
1756 1780
1757static int 1781static int
1758aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) 1782aes_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}
1946LCRYPTO_ALIAS(EVP_aes_128_xts);
1922 1947
1923#ifdef AESNI_CAPABLE 1948#ifdef AESNI_CAPABLE
1924static const EVP_CIPHER aesni_256_xts = { 1949static 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}
1985LCRYPTO_ALIAS(EVP_aes_256_xts);
1960 1986
1961static int 1987static int
1962aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) 1988aes_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}
2186LCRYPTO_ALIAS(EVP_aes_128_ccm);
2160 2187
2161#ifdef AESNI_CAPABLE 2188#ifdef AESNI_CAPABLE
2162static const EVP_CIPHER aesni_192_ccm = { 2189static 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}
2225LCRYPTO_ALIAS(EVP_aes_192_ccm);
2198 2226
2199#ifdef AESNI_CAPABLE 2227#ifdef AESNI_CAPABLE
2200static const EVP_CIPHER aesni_256_ccm = { 2228static 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}
2264LCRYPTO_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}
2455LCRYPTO_ALIAS(EVP_aead_aes_128_gcm);
2426 2456
2427const EVP_AEAD * 2457const EVP_AEAD *
2428EVP_aead_aes_256_gcm(void) 2458EVP_aead_aes_256_gcm(void)
2429{ 2459{
2430 return &aead_aes_256_gcm; 2460 return &aead_aes_256_gcm;
2431} 2461}
2462LCRYPTO_ALIAS(EVP_aead_aes_256_gcm);
2432 2463
2433typedef struct { 2464typedef 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}
2591LCRYPTO_ALIAS(EVP_aes_128_wrap);
2560 2592
2561static const EVP_CIPHER aes_192_wrap = { 2593static 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}
2613LCRYPTO_ALIAS(EVP_aes_192_wrap);
2581 2614
2582static const EVP_CIPHER aes_256_wrap = { 2615static 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}
2635LCRYPTO_ALIAS(EVP_aes_256_wrap);
2602 2636
2603#endif 2637#endif