TianoCore EDK2 master
Loading...
Searching...
No Matches
Crypto.c
Go to the documentation of this file.
1
10#include <Base.h>
11#include <Library/DebugLib.h>
13#include <Library/TlsLib.h>
14#include <Protocol/Crypto.h>
16
21#define EDKII_CRYPTO_PCD ((const PCD_CRYPTO_SERVICE_FAMILY_ENABLE *)\
22 (FixedPcdGetPtr (PcdCryptoServiceFamilyEnable)))
23
41#define CALL_BASECRYPTLIB(Enable, Function, Args, ErrorReturnValue) \
42 EDKII_CRYPTO_PCD->Enable \
43 ? Function Args \
44 : (BaseCryptLibServiceNotEnabled (#Function), ErrorReturnValue)
45
61#define CALL_VOID_BASECRYPTLIB(Enable, Function, Args) \
62 EDKII_CRYPTO_PCD->Enable \
63 ? Function Args \
64 : BaseCryptLibServiceNotEnabled (#Function)
65
79static
80VOID
81BaseCryptLibServiceNotEnabled (
82 IN CONST CHAR8 *FunctionName
83 )
84{
85 DEBUG ((DEBUG_ERROR, "[%a] Function %a() is not enabled\n", gEfiCallerBaseName, FunctionName));
86 ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
87}
88
97static
98VOID
99BaseCryptLibServiceDeprecated (
100 IN CONST CHAR8 *FunctionName
101 )
102{
103 DEBUG ((DEBUG_ERROR, "[%a] Function %a() is deprecated and unsupported any longer\n", gEfiCallerBaseName, FunctionName));
104 ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
105}
106
113UINTN
114EFIAPI
116 VOID
117 )
118{
120}
121
122// =====================================================================================
123// One-Way Cryptographic Hash Primitives
124// =====================================================================================
125
133UINTN
134EFIAPI
136 VOID
137 )
138{
139 return BaseCryptLibServiceDeprecated ("Md4GetContextSize"), 0;
140}
141
151BOOLEAN
152EFIAPI
154 OUT VOID *Md4Context
155 )
156{
157 return BaseCryptLibServiceDeprecated ("Md4Init"), FALSE;
158}
159
170BOOLEAN
171EFIAPI
173 IN CONST VOID *Md4Context,
174 OUT VOID *NewMd4Context
175 )
176{
177 return BaseCryptLibServiceDeprecated ("Md4Duplicate"), FALSE;
178}
179
191BOOLEAN
192EFIAPI
194 IN OUT VOID *Md4Context,
195 IN CONST VOID *Data,
196 IN UINTN DataSize
197 )
198{
199 return BaseCryptLibServiceDeprecated ("Md4Update"), FALSE;
200}
201
213BOOLEAN
214EFIAPI
216 IN OUT VOID *Md4Context,
217 OUT UINT8 *HashValue
218 )
219{
220 return BaseCryptLibServiceDeprecated ("Md4Final"), FALSE;
221}
222
235BOOLEAN
236EFIAPI
238 IN CONST VOID *Data,
239 IN UINTN DataSize,
240 OUT UINT8 *HashValue
241 )
242{
243 return BaseCryptLibServiceDeprecated ("Md4HashAll"), FALSE;
244}
245
246#ifndef ENABLE_MD5_DEPRECATED_INTERFACES
247
256UINTN
257EFIAPI
259 VOID
260 )
261{
262 return BaseCryptLibServiceDeprecated ("Md5GetContextSize"), 0;
263}
264
277BOOLEAN
278EFIAPI
280 OUT VOID *Md5Context
281 )
282{
283 return BaseCryptLibServiceDeprecated ("Md5Init"), FALSE;
284}
285
299BOOLEAN
300EFIAPI
302 IN CONST VOID *Md5Context,
303 OUT VOID *NewMd5Context
304 )
305{
306 return BaseCryptLibServiceDeprecated ("Md5Init"), FALSE;
307}
308
327BOOLEAN
328EFIAPI
330 IN OUT VOID *Md5Context,
331 IN CONST VOID *Data,
332 IN UINTN DataSize
333 )
334{
335 return BaseCryptLibServiceDeprecated ("Md5Init"), FALSE;
336}
337
358BOOLEAN
359EFIAPI
361 IN OUT VOID *Md5Context,
362 OUT UINT8 *HashValue
363 )
364{
365 return BaseCryptLibServiceDeprecated ("Md5Final"), FALSE;
366}
367
384BOOLEAN
385EFIAPI
387 IN CONST VOID *Data,
388 IN UINTN DataSize,
389 OUT UINT8 *HashValue
390 )
391{
392 return BaseCryptLibServiceDeprecated ("Md5HashAll"), FALSE;
393}
394
395#else
396
406UINTN
407EFIAPI
408CryptoServiceMd5GetContextSize (
409 VOID
410 )
411{
412 return CALL_BASECRYPTLIB (Md5.Services.GetContextSize, Md5GetContextSize, (), 0);
413}
414
429BOOLEAN
430EFIAPI
431CryptoServiceMd5Init (
432 OUT VOID *Md5Context
433 )
434{
435 return CALL_BASECRYPTLIB (Md5.Services.Init, Md5Init, (Md5Context), FALSE);
436}
437
453BOOLEAN
454EFIAPI
455CryptoServiceMd5Duplicate (
456 IN CONST VOID *Md5Context,
457 OUT VOID *NewMd5Context
458 )
459{
460 return CALL_BASECRYPTLIB (Md5.Services.Duplicate, Md5Duplicate, (Md5Context, NewMd5Context), FALSE);
461}
462
483BOOLEAN
484EFIAPI
485CryptoServiceMd5Update (
486 IN OUT VOID *Md5Context,
487 IN CONST VOID *Data,
488 IN UINTN DataSize
489 )
490{
491 return CALL_BASECRYPTLIB (Md5.Services.Update, Md5Update, (Md5Context, Data, DataSize), FALSE);
492}
493
516BOOLEAN
517EFIAPI
518CryptoServiceMd5Final (
519 IN OUT VOID *Md5Context,
520 OUT UINT8 *HashValue
521 )
522{
523 return CALL_BASECRYPTLIB (Md5.Services.Final, Md5Final, (Md5Context, HashValue), FALSE);
524}
525
544BOOLEAN
545EFIAPI
546CryptoServiceMd5HashAll (
547 IN CONST VOID *Data,
548 IN UINTN DataSize,
549 OUT UINT8 *HashValue
550 )
551{
552 return CALL_BASECRYPTLIB (Md5.Services.HashAll, Md5HashAll, (Data, DataSize, HashValue), FALSE);
553}
554
555#endif
556
557#ifdef DISABLE_SHA1_DEPRECATED_INTERFACES
558
567UINTN
568EFIAPI
569DeprecatedCryptoServiceSha1GetContextSize (
570 VOID
571 )
572{
573 return BaseCryptLibServiceDeprecated ("Sha1GetContextSize"), 0;
574}
575
590BOOLEAN
591EFIAPI
592DeprecatedCryptoServiceSha1Init (
593 OUT VOID *Sha1Context
594 )
595{
596 return BaseCryptLibServiceDeprecated ("Sha1Init"), FALSE;
597}
598
612BOOLEAN
613EFIAPI
614DeprecatedCryptoServiceSha1Duplicate (
615 IN CONST VOID *Sha1Context,
616 OUT VOID *NewSha1Context
617 )
618{
619 return BaseCryptLibServiceDeprecated ("Sha1Duplicate"), FALSE;
620}
621
640BOOLEAN
641EFIAPI
642DeprecatedCryptoServiceSha1Update (
643 IN OUT VOID *Sha1Context,
644 IN CONST VOID *Data,
645 IN UINTN DataSize
646 )
647{
648 return BaseCryptLibServiceDeprecated ("Sha1Update"), FALSE;
649}
650
671BOOLEAN
672EFIAPI
673DeprecatedCryptoServiceSha1Final (
674 IN OUT VOID *Sha1Context,
675 OUT UINT8 *HashValue
676 )
677{
678 return BaseCryptLibServiceDeprecated ("Sha1Final"), FALSE;
679}
680
697BOOLEAN
698EFIAPI
699DeprecatedCryptoServiceSha1HashAll (
700 IN CONST VOID *Data,
701 IN UINTN DataSize,
702 OUT UINT8 *HashValue
703 )
704{
705 return BaseCryptLibServiceDeprecated ("Sha1HashAll"), FALSE;
706}
707
708#else
709
719UINTN
720EFIAPI
722 VOID
723 )
724{
725 return CALL_BASECRYPTLIB (Sha1.Services.GetContextSize, Sha1GetContextSize, (), 0);
726}
727
742BOOLEAN
743EFIAPI
745 OUT VOID *Sha1Context
746 )
747{
748 return CALL_BASECRYPTLIB (Sha1.Services.Init, Sha1Init, (Sha1Context), FALSE);
749}
750
766BOOLEAN
767EFIAPI
769 IN CONST VOID *Sha1Context,
770 OUT VOID *NewSha1Context
771 )
772{
773 return CALL_BASECRYPTLIB (Sha1.Services.Duplicate, Sha1Duplicate, (Sha1Context, NewSha1Context), FALSE);
774}
775
796BOOLEAN
797EFIAPI
799 IN OUT VOID *Sha1Context,
800 IN CONST VOID *Data,
801 IN UINTN DataSize
802 )
803{
804 return CALL_BASECRYPTLIB (Sha1.Services.Update, Sha1Update, (Sha1Context, Data, DataSize), FALSE);
805}
806
829BOOLEAN
830EFIAPI
832 IN OUT VOID *Sha1Context,
833 OUT UINT8 *HashValue
834 )
835{
836 return CALL_BASECRYPTLIB (Sha1.Services.Final, Sha1Final, (Sha1Context, HashValue), FALSE);
837}
838
857BOOLEAN
858EFIAPI
860 IN CONST VOID *Data,
861 IN UINTN DataSize,
862 OUT UINT8 *HashValue
863 )
864{
865 return CALL_BASECRYPTLIB (Sha1.Services.HashAll, Sha1HashAll, (Data, DataSize, HashValue), FALSE);
866}
867
868#endif
869
876UINTN
877EFIAPI
879 VOID
880 )
881{
882 return CALL_BASECRYPTLIB (Sha256.Services.GetContextSize, Sha256GetContextSize, (), 0);
883}
884
897BOOLEAN
898EFIAPI
900 OUT VOID *Sha256Context
901 )
902{
903 return CALL_BASECRYPTLIB (Sha256.Services.Init, Sha256Init, (Sha256Context), FALSE);
904}
905
921BOOLEAN
922EFIAPI
924 IN CONST VOID *Sha256Context,
925 OUT VOID *NewSha256Context
926 )
927{
928 return CALL_BASECRYPTLIB (Sha256.Services.Duplicate, Sha256Duplicate, (Sha256Context, NewSha256Context), FALSE);
929}
930
949BOOLEAN
950EFIAPI
952 IN OUT VOID *Sha256Context,
953 IN CONST VOID *Data,
954 IN UINTN DataSize
955 )
956{
957 return CALL_BASECRYPTLIB (Sha256.Services.Update, Sha256Update, (Sha256Context, Data, DataSize), FALSE);
958}
959
980BOOLEAN
981EFIAPI
983 IN OUT VOID *Sha256Context,
984 OUT UINT8 *HashValue
985 )
986{
987 return CALL_BASECRYPTLIB (Sha256.Services.Final, Sha256Final, (Sha256Context, HashValue), FALSE);
988}
989
1008BOOLEAN
1009EFIAPI
1011 IN CONST VOID *Data,
1012 IN UINTN DataSize,
1013 OUT UINT8 *HashValue
1014 )
1015{
1016 return CALL_BASECRYPTLIB (Sha256.Services.HashAll, Sha256HashAll, (Data, DataSize, HashValue), FALSE);
1017}
1018
1025UINTN
1026EFIAPI
1028 VOID
1029 )
1030{
1031 return CALL_BASECRYPTLIB (Sha384.Services.GetContextSize, Sha384GetContextSize, (), 0);
1032}
1033
1046BOOLEAN
1047EFIAPI
1049 OUT VOID *Sha384Context
1050 )
1051{
1052 return CALL_BASECRYPTLIB (Sha384.Services.Init, Sha384Init, (Sha384Context), FALSE);
1053}
1054
1070BOOLEAN
1071EFIAPI
1073 IN CONST VOID *Sha384Context,
1074 OUT VOID *NewSha384Context
1075 )
1076{
1077 return CALL_BASECRYPTLIB (Sha384.Services.Duplicate, Sha384Duplicate, (Sha384Context, NewSha384Context), FALSE);
1078}
1079
1098BOOLEAN
1099EFIAPI
1101 IN OUT VOID *Sha384Context,
1102 IN CONST VOID *Data,
1103 IN UINTN DataSize
1104 )
1105{
1106 return CALL_BASECRYPTLIB (Sha384.Services.Update, Sha384Update, (Sha384Context, Data, DataSize), FALSE);
1107}
1108
1129BOOLEAN
1130EFIAPI
1132 IN OUT VOID *Sha384Context,
1133 OUT UINT8 *HashValue
1134 )
1135{
1136 return CALL_BASECRYPTLIB (Sha384.Services.Final, Sha384Final, (Sha384Context, HashValue), FALSE);
1137}
1138
1157BOOLEAN
1158EFIAPI
1160 IN CONST VOID *Data,
1161 IN UINTN DataSize,
1162 OUT UINT8 *HashValue
1163 )
1164{
1165 return CALL_BASECRYPTLIB (Sha384.Services.HashAll, Sha384HashAll, (Data, DataSize, HashValue), FALSE);
1166}
1167
1174UINTN
1175EFIAPI
1177 VOID
1178 )
1179{
1180 return CALL_BASECRYPTLIB (Sha512.Services.GetContextSize, Sha512GetContextSize, (), 0);
1181}
1182
1195BOOLEAN
1196EFIAPI
1198 OUT VOID *Sha512Context
1199 )
1200{
1201 return CALL_BASECRYPTLIB (Sha512.Services.Init, Sha512Init, (Sha512Context), FALSE);
1202}
1203
1219BOOLEAN
1220EFIAPI
1222 IN CONST VOID *Sha512Context,
1223 OUT VOID *NewSha512Context
1224 )
1225{
1226 return CALL_BASECRYPTLIB (Sha512.Services.Duplicate, Sha512Duplicate, (Sha512Context, NewSha512Context), FALSE);
1227}
1228
1247BOOLEAN
1248EFIAPI
1250 IN OUT VOID *Sha512Context,
1251 IN CONST VOID *Data,
1252 IN UINTN DataSize
1253 )
1254{
1255 return CALL_BASECRYPTLIB (Sha512.Services.Update, Sha512Update, (Sha512Context, Data, DataSize), FALSE);
1256}
1257
1278BOOLEAN
1279EFIAPI
1281 IN OUT VOID *Sha512Context,
1282 OUT UINT8 *HashValue
1283 )
1284{
1285 return CALL_BASECRYPTLIB (Sha512.Services.Final, Sha512Final, (Sha512Context, HashValue), FALSE);
1286}
1287
1306BOOLEAN
1307EFIAPI
1309 IN CONST VOID *Data,
1310 IN UINTN DataSize,
1311 OUT UINT8 *HashValue
1312 )
1313{
1314 return CALL_BASECRYPTLIB (Sha512.Services.HashAll, Sha512HashAll, (Data, DataSize, HashValue), FALSE);
1315}
1316
1323UINTN
1324EFIAPI
1326 VOID
1327 )
1328{
1329 return CALL_BASECRYPTLIB (Sm3.Services.GetContextSize, Sm3GetContextSize, (), 0);
1330}
1331
1344BOOLEAN
1345EFIAPI
1347 OUT VOID *Sm3Context
1348 )
1349{
1350 return CALL_BASECRYPTLIB (Sm3.Services.Init, Sm3Init, (Sm3Context), FALSE);
1351}
1352
1368BOOLEAN
1369EFIAPI
1371 IN CONST VOID *Sm3Context,
1372 OUT VOID *NewSm3Context
1373 )
1374{
1375 return CALL_BASECRYPTLIB (Sm3.Services.Duplicate, Sm3Duplicate, (Sm3Context, NewSm3Context), FALSE);
1376}
1377
1396BOOLEAN
1397EFIAPI
1399 IN OUT VOID *Sm3Context,
1400 IN CONST VOID *Data,
1401 IN UINTN DataSize
1402 )
1403{
1404 return CALL_BASECRYPTLIB (Sm3.Services.Update, Sm3Update, (Sm3Context, Data, DataSize), FALSE);
1405}
1406
1427BOOLEAN
1428EFIAPI
1430 IN OUT VOID *Sm3Context,
1431 OUT UINT8 *HashValue
1432 )
1433{
1434 return CALL_BASECRYPTLIB (Sm3.Services.Final, Sm3Final, (Sm3Context, HashValue), FALSE);
1435}
1436
1455BOOLEAN
1456EFIAPI
1458 IN CONST VOID *Data,
1459 IN UINTN DataSize,
1460 OUT UINT8 *HashValue
1461 )
1462{
1463 return CALL_BASECRYPTLIB (Sm3.Services.HashAll, Sm3HashAll, (Data, DataSize, HashValue), FALSE);
1464}
1465
1466// =====================================================================================
1467// MAC (Message Authentication Code) Primitive
1468// =====================================================================================
1469
1477VOID *
1478EFIAPI
1480 VOID
1481 )
1482{
1483 return BaseCryptLibServiceDeprecated ("HmacMd5New"), NULL;
1484}
1485
1493VOID
1494EFIAPI
1496 IN VOID *HmacMd5Ctx
1497 )
1498{
1499 BaseCryptLibServiceDeprecated ("HmacMd5Free");
1500}
1501
1513BOOLEAN
1514EFIAPI
1516 OUT VOID *HmacMd5Context,
1517 IN CONST UINT8 *Key,
1518 IN UINTN KeySize
1519 )
1520{
1521 return BaseCryptLibServiceDeprecated ("HmacMd5SetKey"), FALSE;
1522}
1523
1534BOOLEAN
1535EFIAPI
1537 IN CONST VOID *HmacMd5Context,
1538 OUT VOID *NewHmacMd5Context
1539 )
1540{
1541 return BaseCryptLibServiceDeprecated ("HmacMd5Duplicate"), FALSE;
1542}
1543
1555BOOLEAN
1556EFIAPI
1558 IN OUT VOID *HmacMd5Context,
1559 IN CONST VOID *Data,
1560 IN UINTN DataSize
1561 )
1562{
1563 return BaseCryptLibServiceDeprecated ("HmacMd5Update"), FALSE;
1564}
1565
1577BOOLEAN
1578EFIAPI
1580 IN OUT VOID *HmacMd5Context,
1581 OUT UINT8 *HmacValue
1582 )
1583{
1584 return BaseCryptLibServiceDeprecated ("HmacMd5Final"), FALSE;
1585}
1586
1594VOID *
1595EFIAPI
1597 VOID
1598 )
1599{
1600 return BaseCryptLibServiceDeprecated ("HmacSha1New"), NULL;
1601}
1602
1610VOID
1611EFIAPI
1613 IN VOID *HmacSha1Ctx
1614 )
1615{
1616 BaseCryptLibServiceDeprecated ("HmacSha1Free");
1617}
1618
1630BOOLEAN
1631EFIAPI
1633 OUT VOID *HmacSha1Context,
1634 IN CONST UINT8 *Key,
1635 IN UINTN KeySize
1636 )
1637{
1638 return BaseCryptLibServiceDeprecated ("HmacSha1SetKey"), FALSE;
1639}
1640
1651BOOLEAN
1652EFIAPI
1654 IN CONST VOID *HmacSha1Context,
1655 OUT VOID *NewHmacSha1Context
1656 )
1657{
1658 return BaseCryptLibServiceDeprecated ("HmacSha1Duplicate"), FALSE;
1659}
1660
1672BOOLEAN
1673EFIAPI
1675 IN OUT VOID *HmacSha1Context,
1676 IN CONST VOID *Data,
1677 IN UINTN DataSize
1678 )
1679{
1680 return BaseCryptLibServiceDeprecated ("HmacSha1Update"), FALSE;
1681}
1682
1694BOOLEAN
1695EFIAPI
1697 IN OUT VOID *HmacSha1Context,
1698 OUT UINT8 *HmacValue
1699 )
1700{
1701 return BaseCryptLibServiceDeprecated ("HmacSha1Final"), FALSE;
1702}
1703
1711VOID *
1712EFIAPI
1714 VOID
1715 )
1716{
1717 return CALL_BASECRYPTLIB (HmacSha256.Services.New, HmacSha256New, (), NULL);
1718}
1719
1726VOID
1727EFIAPI
1729 IN VOID *HmacSha256Ctx
1730 )
1731{
1732 CALL_VOID_BASECRYPTLIB (HmacSha256.Services.Free, HmacSha256Free, (HmacSha256Ctx));
1733}
1734
1751BOOLEAN
1752EFIAPI
1754 OUT VOID *HmacSha256Context,
1755 IN CONST UINT8 *Key,
1756 IN UINTN KeySize
1757 )
1758{
1759 return CALL_BASECRYPTLIB (HmacSha256.Services.SetKey, HmacSha256SetKey, (HmacSha256Context, Key, KeySize), FALSE);
1760}
1761
1777BOOLEAN
1778EFIAPI
1780 IN CONST VOID *HmacSha256Context,
1781 OUT VOID *NewHmacSha256Context
1782 )
1783{
1784 return CALL_BASECRYPTLIB (HmacSha256.Services.Duplicate, HmacSha256Duplicate, (HmacSha256Context, NewHmacSha256Context), FALSE);
1785}
1786
1807BOOLEAN
1808EFIAPI
1810 IN OUT VOID *HmacSha256Context,
1811 IN CONST VOID *Data,
1812 IN UINTN DataSize
1813 )
1814{
1815 return CALL_BASECRYPTLIB (HmacSha256.Services.Update, HmacSha256Update, (HmacSha256Context, Data, DataSize), FALSE);
1816}
1817
1840BOOLEAN
1841EFIAPI
1843 IN OUT VOID *HmacSha256Context,
1844 OUT UINT8 *HmacValue
1845 )
1846{
1847 return CALL_BASECRYPTLIB (HmacSha256.Services.Final, HmacSha256Final, (HmacSha256Context, HmacValue), FALSE);
1848}
1849
1870BOOLEAN
1871EFIAPI
1873 IN CONST VOID *Data,
1874 IN UINTN DataSize,
1875 IN CONST UINT8 *Key,
1876 IN UINTN KeySize,
1877 OUT UINT8 *HmacValue
1878 )
1879{
1880 return CALL_BASECRYPTLIB (HmacSha256.Services.All, HmacSha256All, (Data, DataSize, Key, KeySize, HmacValue), FALSE);
1881}
1882
1890VOID *
1891EFIAPI
1893 VOID
1894 )
1895{
1896 return CALL_BASECRYPTLIB (HmacSha384.Services.New, HmacSha384New, (), NULL);
1897}
1898
1905VOID
1906EFIAPI
1908 IN VOID *HmacSha384Ctx
1909 )
1910{
1911 CALL_VOID_BASECRYPTLIB (HmacSha384.Services.Free, HmacSha384Free, (HmacSha384Ctx));
1912}
1913
1930BOOLEAN
1931EFIAPI
1933 OUT VOID *HmacSha384Context,
1934 IN CONST UINT8 *Key,
1935 IN UINTN KeySize
1936 )
1937{
1938 return CALL_BASECRYPTLIB (HmacSha384.Services.SetKey, HmacSha384SetKey, (HmacSha384Context, Key, KeySize), FALSE);
1939}
1940
1956BOOLEAN
1957EFIAPI
1959 IN CONST VOID *HmacSha384Context,
1960 OUT VOID *NewHmacSha384Context
1961 )
1962{
1963 return CALL_BASECRYPTLIB (HmacSha384.Services.Duplicate, HmacSha256Duplicate, (HmacSha384Context, NewHmacSha384Context), FALSE);
1964}
1965
1986BOOLEAN
1987EFIAPI
1989 IN OUT VOID *HmacSha384Context,
1990 IN CONST VOID *Data,
1991 IN UINTN DataSize
1992 )
1993{
1994 return CALL_BASECRYPTLIB (HmacSha384.Services.Update, HmacSha384Update, (HmacSha384Context, Data, DataSize), FALSE);
1995}
1996
2019BOOLEAN
2020EFIAPI
2022 IN OUT VOID *HmacSha384Context,
2023 OUT UINT8 *HmacValue
2024 )
2025{
2026 return CALL_BASECRYPTLIB (HmacSha384.Services.Final, HmacSha384Final, (HmacSha384Context, HmacValue), FALSE);
2027}
2028
2049BOOLEAN
2050EFIAPI
2052 IN CONST VOID *Data,
2053 IN UINTN DataSize,
2054 IN CONST UINT8 *Key,
2055 IN UINTN KeySize,
2056 OUT UINT8 *HmacValue
2057 )
2058{
2059 return CALL_BASECRYPTLIB (HmacSha384.Services.All, HmacSha384All, (Data, DataSize, Key, KeySize, HmacValue), FALSE);
2060}
2061
2062// =====================================================================================
2063// Symmetric Cryptography Primitive
2064// =====================================================================================
2065
2073UINTN
2074EFIAPI
2076 VOID
2077 )
2078{
2079 return BaseCryptLibServiceDeprecated ("TdesGetContextSize"), 0;
2080}
2081
2093BOOLEAN
2094EFIAPI
2096 OUT VOID *TdesContext,
2097 IN CONST UINT8 *Key,
2098 IN UINTN KeyLength
2099 )
2100{
2101 return BaseCryptLibServiceDeprecated ("TdesInit"), FALSE;
2102}
2103
2116BOOLEAN
2117EFIAPI
2119 IN VOID *TdesContext,
2120 IN CONST UINT8 *Input,
2121 IN UINTN InputSize,
2122 OUT UINT8 *Output
2123 )
2124{
2125 return BaseCryptLibServiceDeprecated ("TdesEcbEncrypt"), FALSE;
2126}
2127
2140BOOLEAN
2141EFIAPI
2143 IN VOID *TdesContext,
2144 IN CONST UINT8 *Input,
2145 IN UINTN InputSize,
2146 OUT UINT8 *Output
2147 )
2148{
2149 return BaseCryptLibServiceDeprecated ("TdesEcbDecrypt"), FALSE;
2150}
2151
2165BOOLEAN
2166EFIAPI
2168 IN VOID *TdesContext,
2169 IN CONST UINT8 *Input,
2170 IN UINTN InputSize,
2171 IN CONST UINT8 *Ivec,
2172 OUT UINT8 *Output
2173 )
2174{
2175 return BaseCryptLibServiceDeprecated ("TdesCbcEncrypt"), FALSE;
2176}
2177
2191BOOLEAN
2192EFIAPI
2194 IN VOID *TdesContext,
2195 IN CONST UINT8 *Input,
2196 IN UINTN InputSize,
2197 IN CONST UINT8 *Ivec,
2198 OUT UINT8 *Output
2199 )
2200{
2201 return BaseCryptLibServiceDeprecated ("TdesCbcDecrypt"), FALSE;
2202}
2203
2213UINTN
2214EFIAPI
2216 VOID
2217 )
2218{
2219 return CALL_BASECRYPTLIB (Aes.Services.GetContextSize, AesGetContextSize, (), 0);
2220}
2221
2244BOOLEAN
2245EFIAPI
2247 OUT VOID *AesContext,
2248 IN CONST UINT8 *Key,
2249 IN UINTN KeyLength
2250 )
2251{
2252 return CALL_BASECRYPTLIB (Aes.Services.Init, AesInit, (AesContext, Key, KeyLength), FALSE);
2253}
2254
2267BOOLEAN
2268EFIAPI
2270 IN VOID *AesContext,
2271 IN CONST UINT8 *Input,
2272 IN UINTN InputSize,
2273 OUT UINT8 *Output
2274 )
2275{
2276 return BaseCryptLibServiceDeprecated ("AesEcbEncrypt"), FALSE;
2277}
2278
2291BOOLEAN
2292EFIAPI
2294 IN VOID *AesContext,
2295 IN CONST UINT8 *Input,
2296 IN UINTN InputSize,
2297 OUT UINT8 *Output
2298 )
2299{
2300 return BaseCryptLibServiceDeprecated ("AesEcbDecrypt"), FALSE;
2301}
2302
2332BOOLEAN
2333EFIAPI
2335 IN VOID *AesContext,
2336 IN CONST UINT8 *Input,
2337 IN UINTN InputSize,
2338 IN CONST UINT8 *Ivec,
2339 OUT UINT8 *Output
2340 )
2341{
2342 return CALL_BASECRYPTLIB (Aes.Services.CbcEncrypt, AesCbcEncrypt, (AesContext, Input, InputSize, Ivec, Output), FALSE);
2343}
2344
2374BOOLEAN
2375EFIAPI
2377 IN VOID *AesContext,
2378 IN CONST UINT8 *Input,
2379 IN UINTN InputSize,
2380 IN CONST UINT8 *Ivec,
2381 OUT UINT8 *Output
2382 )
2383{
2384 return CALL_BASECRYPTLIB (Aes.Services.CbcDecrypt, AesCbcDecrypt, (AesContext, Input, InputSize, Ivec, Output), FALSE);
2385}
2386
2394UINTN
2395EFIAPI
2397 VOID
2398 )
2399{
2400 return BaseCryptLibServiceDeprecated ("Arc4GetContextSize"), 0;
2401}
2402
2414BOOLEAN
2415EFIAPI
2417 OUT VOID *Arc4Context,
2418 IN CONST UINT8 *Key,
2419 IN UINTN KeySize
2420 )
2421{
2422 return BaseCryptLibServiceDeprecated ("Arc4Init"), FALSE;
2423}
2424
2437BOOLEAN
2438EFIAPI
2440 IN OUT VOID *Arc4Context,
2441 IN CONST UINT8 *Input,
2442 IN UINTN InputSize,
2443 OUT UINT8 *Output
2444 )
2445{
2446 return BaseCryptLibServiceDeprecated ("Arc4Encrypt"), FALSE;
2447}
2448
2461BOOLEAN
2462EFIAPI
2464 IN OUT VOID *Arc4Context,
2465 IN UINT8 *Input,
2466 IN UINTN InputSize,
2467 OUT UINT8 *Output
2468 )
2469{
2470 return BaseCryptLibServiceDeprecated ("Arc4Decrypt"), FALSE;
2471}
2472
2482BOOLEAN
2483EFIAPI
2485 IN OUT VOID *Arc4Context
2486 )
2487{
2488 return BaseCryptLibServiceDeprecated ("Arc4Reset"), FALSE;
2489}
2490
2491// =====================================================================================
2492// Asymmetric Cryptography Primitive
2493// =====================================================================================
2494
2502VOID *
2503EFIAPI
2505 VOID
2506 )
2507{
2508 return CALL_BASECRYPTLIB (Rsa.Services.New, RsaNew, (), NULL);
2509}
2510
2519VOID
2520EFIAPI
2522 IN VOID *RsaContext
2523 )
2524{
2525 CALL_VOID_BASECRYPTLIB (Rsa.Services.Free, RsaFree, (RsaContext));
2526}
2527
2550BOOLEAN
2551EFIAPI
2553 IN OUT VOID *RsaContext,
2554 IN RSA_KEY_TAG KeyTag,
2555 IN CONST UINT8 *BigNumber,
2556 IN UINTN BnSize
2557 )
2558{
2559 return CALL_BASECRYPTLIB (Rsa.Services.SetKey, RsaSetKey, (RsaContext, KeyTag, BigNumber, BnSize), FALSE);
2560}
2561
2590BOOLEAN
2591EFIAPI
2593 IN OUT VOID *RsaContext,
2594 IN RSA_KEY_TAG KeyTag,
2595 OUT UINT8 *BigNumber,
2596 IN OUT UINTN *BnSize
2597 )
2598{
2599 return CALL_BASECRYPTLIB (Rsa.Services.GetKey, RsaGetKey, (RsaContext, KeyTag, BigNumber, BnSize), FALSE);
2600}
2601
2625BOOLEAN
2626EFIAPI
2628 IN OUT VOID *RsaContext,
2629 IN UINTN ModulusLength,
2630 IN CONST UINT8 *PublicExponent,
2631 IN UINTN PublicExponentSize
2632 )
2633{
2634 return CALL_BASECRYPTLIB (Rsa.Services.GenerateKey, RsaGenerateKey, (RsaContext, ModulusLength, PublicExponent, PublicExponentSize), FALSE);
2635}
2636
2658BOOLEAN
2659EFIAPI
2661 IN VOID *RsaContext
2662 )
2663{
2664 return CALL_BASECRYPTLIB (Rsa.Services.CheckKey, RsaCheckKey, (RsaContext), FALSE);
2665}
2666
2694BOOLEAN
2695EFIAPI
2697 IN VOID *RsaContext,
2698 IN CONST UINT8 *MessageHash,
2699 IN UINTN HashSize,
2700 OUT UINT8 *Signature,
2701 IN OUT UINTN *SigSize
2702 )
2703{
2704 return CALL_BASECRYPTLIB (Rsa.Services.Pkcs1Sign, RsaPkcs1Sign, (RsaContext, MessageHash, HashSize, Signature, SigSize), FALSE);
2705}
2706
2726BOOLEAN
2727EFIAPI
2729 IN VOID *RsaContext,
2730 IN CONST UINT8 *MessageHash,
2731 IN UINTN HashSize,
2732 IN CONST UINT8 *Signature,
2733 IN UINTN SigSize
2734 )
2735{
2736 return CALL_BASECRYPTLIB (Rsa.Services.Pkcs1Verify, RsaPkcs1Verify, (RsaContext, MessageHash, HashSize, Signature, SigSize), FALSE);
2737}
2738
2758BOOLEAN
2759EFIAPI
2761 IN CONST UINT8 *PemData,
2762 IN UINTN PemSize,
2763 IN CONST CHAR8 *Password,
2764 OUT VOID **RsaContext
2765 )
2766{
2767 return CALL_BASECRYPTLIB (Rsa.Services.GetPrivateKeyFromPem, RsaGetPrivateKeyFromPem, (PemData, PemSize, Password, RsaContext), FALSE);
2768}
2769
2788BOOLEAN
2789EFIAPI
2791 IN CONST UINT8 *Cert,
2792 IN UINTN CertSize,
2793 OUT VOID **RsaContext
2794 )
2795{
2796 return CALL_BASECRYPTLIB (Rsa.Services.GetPublicKeyFromX509, RsaGetPublicKeyFromX509, (Cert, CertSize, RsaContext), FALSE);
2797}
2798
2818BOOLEAN
2819EFIAPI
2821 IN CONST UINT8 *Cert,
2822 IN UINTN CertSize,
2823 OUT UINT8 *CertSubject,
2824 IN OUT UINTN *SubjectSize
2825 )
2826{
2827 return CALL_BASECRYPTLIB (X509.Services.GetSubjectName, X509GetSubjectName, (Cert, CertSize, CertSubject, SubjectSize), FALSE);
2828}
2829
2856RETURN_STATUS
2857EFIAPI
2859 IN CONST UINT8 *Cert,
2860 IN UINTN CertSize,
2861 OUT CHAR8 *CommonName OPTIONAL,
2862 IN OUT UINTN *CommonNameSize
2863 )
2864{
2865 return CALL_BASECRYPTLIB (X509.Services.GetCommonName, X509GetCommonName, (Cert, CertSize, CommonName, CommonNameSize), RETURN_UNSUPPORTED);
2866}
2867
2894RETURN_STATUS
2895EFIAPI
2897 IN CONST UINT8 *Cert,
2898 IN UINTN CertSize,
2899 OUT CHAR8 *NameBuffer OPTIONAL,
2900 IN OUT UINTN *NameBufferSize
2901 )
2902{
2903 return CALL_BASECRYPTLIB (X509.Services.GetOrganizationName, X509GetOrganizationName, (Cert, CertSize, NameBuffer, NameBufferSize), RETURN_UNSUPPORTED);
2904}
2905
2924BOOLEAN
2925EFIAPI
2927 IN CONST UINT8 *Cert,
2928 IN UINTN CertSize,
2929 IN CONST UINT8 *CACert,
2930 IN UINTN CACertSize
2931 )
2932{
2933 return CALL_BASECRYPTLIB (X509.Services.VerifyCert, X509VerifyCert, (Cert, CertSize, CACert, CACertSize), FALSE);
2934}
2935
2952BOOLEAN
2953EFIAPI
2955 IN CONST UINT8 *Cert,
2956 IN UINTN CertSize,
2957 OUT UINT8 **SingleX509Cert
2958 )
2959{
2960 return CALL_BASECRYPTLIB (X509.Services.ConstructCertificate, X509ConstructCertificate, (Cert, CertSize, SingleX509Cert), FALSE);
2961}
2962
2982BOOLEAN
2983EFIAPI
2985 IN OUT UINT8 **X509Stack,
2986 IN VA_LIST Args
2987 )
2988{
2989 return CALL_BASECRYPTLIB (X509.Services.ConstructCertificateStackV, X509ConstructCertificateStackV, (X509Stack, Args), FALSE);
2990}
2991
3010BOOLEAN
3011EFIAPI
3013 IN OUT UINT8 **X509Stack,
3014 ...
3015 )
3016{
3017 VA_LIST Args;
3018 BOOLEAN Result;
3019
3020 VA_START (Args, X509Stack);
3021 Result = CryptoServiceX509ConstructCertificateStackV (X509Stack, Args);
3022 VA_END (Args);
3023 return Result;
3024}
3025
3034VOID
3035EFIAPI
3037 IN VOID *X509Cert
3038 )
3039{
3040 CALL_VOID_BASECRYPTLIB (X509.Services.Free, X509Free, (X509Cert));
3041}
3042
3051VOID
3052EFIAPI
3054 IN VOID *X509Stack
3055 )
3056{
3057 CALL_VOID_BASECRYPTLIB (X509.Services.StackFree, X509StackFree, (X509Stack));
3058}
3059
3077BOOLEAN
3078EFIAPI
3080 IN CONST UINT8 *Cert,
3081 IN UINTN CertSize,
3082 OUT UINT8 **TBSCert,
3083 OUT UINTN *TBSCertSize
3084 )
3085{
3086 return CALL_BASECRYPTLIB (X509.Services.GetTBSCert, X509GetTBSCert, (Cert, CertSize, TBSCert, TBSCertSize), FALSE);
3087}
3088
3105BOOLEAN
3106EFIAPI
3108 IN CONST UINT8 *Cert,
3109 IN UINTN CertSize,
3110 OUT UINTN *Version
3111 )
3112{
3113 return CALL_BASECRYPTLIB (X509.Services.GetVersion, X509GetVersion, (Cert, CertSize, Version), FALSE);
3114}
3115
3139BOOLEAN
3140EFIAPI
3142 IN CONST UINT8 *Cert,
3143 IN UINTN CertSize,
3144 OUT UINT8 *SerialNumber, OPTIONAL
3145 IN OUT UINTN *SerialNumberSize
3146 )
3147{
3148 return CALL_BASECRYPTLIB (X509.Services.GetSerialNumber, X509GetSerialNumber, (Cert, CertSize, SerialNumber, SerialNumberSize), FALSE);
3149}
3150
3170BOOLEAN
3171EFIAPI
3173 IN CONST UINT8 *Cert,
3174 IN UINTN CertSize,
3175 OUT UINT8 *CertIssuer,
3176 IN OUT UINTN *CertIssuerSize
3177 )
3178{
3179 return CALL_BASECRYPTLIB (X509.Services.GetIssuerName, X509GetIssuerName, (Cert, CertSize, CertIssuer, CertIssuerSize), FALSE);
3180}
3181
3200BOOLEAN
3201EFIAPI
3203 IN CONST UINT8 *Cert,
3204 IN UINTN CertSize,
3205 OUT UINT8 *Oid, OPTIONAL
3206 IN OUT UINTN *OidSize
3207 )
3208{
3209 return CALL_BASECRYPTLIB (X509.Services.GetSignatureAlgorithm, X509GetSignatureAlgorithm, (Cert, CertSize, Oid, OidSize), FALSE);
3210}
3211
3232BOOLEAN
3233EFIAPI
3235 IN CONST UINT8 *Cert,
3236 IN UINTN CertSize,
3237 IN CONST UINT8 *Oid,
3238 IN UINTN OidSize,
3239 OUT UINT8 *ExtensionData,
3240 IN OUT UINTN *ExtensionDataSize
3241 )
3242{
3243 return CALL_BASECRYPTLIB (X509.Services.GetExtensionData, X509GetExtensionData, (Cert, CertSize, Oid, OidSize, ExtensionData, ExtensionDataSize), FALSE);
3244}
3245
3263BOOLEAN
3264EFIAPI
3266 IN CONST UINT8 *Cert,
3267 IN UINTN CertSize,
3268 OUT UINT8 *Usage,
3269 IN OUT UINTN *UsageSize
3270 )
3271{
3272 return CALL_BASECRYPTLIB (X509.Services.GetExtendedKeyUsage, X509GetExtendedKeyUsage, (Cert, CertSize, Usage, UsageSize), FALSE);
3273}
3274
3296BOOLEAN
3297EFIAPI
3299 IN CONST UINT8 *Cert,
3300 IN UINTN CertSize,
3301 IN UINT8 *From,
3302 IN OUT UINTN *FromSize,
3303 IN UINT8 *To,
3304 IN OUT UINTN *ToSize
3305 )
3306{
3307 return CALL_BASECRYPTLIB (X509.Services.GetValidity, X509GetValidity, (Cert, CertSize, From, FromSize, To, ToSize), FALSE);
3308}
3309
3333BOOLEAN
3334EFIAPI
3336 IN CONST CHAR8 *DateTimeStr,
3337 OUT VOID *DateTime,
3338 IN OUT UINTN *DateTimeSize
3339 )
3340{
3341 return CALL_BASECRYPTLIB (X509.Services.FormatDateTime, X509FormatDateTime, (DateTimeStr, DateTime, DateTimeSize), FALSE);
3342}
3343
3360INT32
3361EFIAPI
3363 IN CONST VOID *DateTime1,
3364 IN CONST VOID *DateTime2
3365 )
3366{
3367 return CALL_BASECRYPTLIB (X509.Services.CompareDateTime, X509CompareDateTime, (DateTime1, DateTime2), FALSE);
3368}
3369
3381BOOLEAN
3382EFIAPI
3384 IN CONST UINT8 *Cert,
3385 IN UINTN CertSize,
3386 OUT UINTN *Usage
3387 )
3388{
3389 return CALL_BASECRYPTLIB (X509.Services.GetKeyUsage, X509GetKeyUsage, (Cert, CertSize, Usage), FALSE);
3390}
3391
3408BOOLEAN
3409EFIAPI
3411 IN CONST UINT8 *RootCert,
3412 IN UINTN RootCertLength,
3413 IN CONST UINT8 *CertChain,
3414 IN UINTN CertChainLength
3415 )
3416{
3417 return CALL_BASECRYPTLIB (X509.Services.VerifyCertChain, X509VerifyCertChain, (RootCert, RootCertLength, CertChain, CertChainLength), FALSE);
3418}
3419
3438BOOLEAN
3439EFIAPI
3441 IN CONST UINT8 *CertChain,
3442 IN UINTN CertChainLength,
3443 IN CONST INT32 CertIndex,
3444 OUT CONST UINT8 **Cert,
3445 OUT UINTN *CertLength
3446 )
3447{
3448 return CALL_BASECRYPTLIB (X509.Services.GetCertFromCertChain, X509GetCertFromCertChain, (CertChain, CertChainLength, CertIndex, Cert, CertLength), FALSE);
3449}
3450
3462BOOLEAN
3463EFIAPI
3465 IN OUT UINT8 **Ptr,
3466 IN CONST UINT8 *End,
3467 OUT UINTN *Length,
3468 IN UINT32 Tag
3469 )
3470{
3471 return CALL_BASECRYPTLIB (X509.Services.Asn1GetTag, Asn1GetTag, (Ptr, End, Length, Tag), FALSE);
3472}
3473
3492BOOLEAN
3493EFIAPI
3495 CONST UINT8 *Cert,
3496 UINTN CertSize,
3497 UINT8 *BasicConstraints,
3498 UINTN *BasicConstraintsSize
3499 )
3500{
3501 return CALL_BASECRYPTLIB (X509.Services.GetExtendedBasicConstraints, X509GetExtendedBasicConstraints, (Cert, CertSize, BasicConstraints, BasicConstraintsSize), FALSE);
3502}
3503
3531BOOLEAN
3532EFIAPI
3534 IN UINTN PasswordLength,
3535 IN CONST CHAR8 *Password,
3536 IN UINTN SaltLength,
3537 IN CONST UINT8 *Salt,
3538 IN UINTN IterationCount,
3539 IN UINTN DigestSize,
3540 IN UINTN KeyLength,
3541 OUT UINT8 *OutKey
3542 )
3543{
3544 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs5HashPassword, Pkcs5HashPassword, (PasswordLength, Password, SaltLength, Salt, IterationCount, DigestSize, KeyLength, OutKey), FALSE);
3545}
3546
3576BOOLEAN
3577EFIAPI
3579 IN CONST UINT8 *PublicKey,
3580 IN UINTN PublicKeySize,
3581 IN UINT8 *InData,
3582 IN UINTN InDataSize,
3583 IN CONST UINT8 *PrngSeed OPTIONAL,
3584 IN UINTN PrngSeedSize OPTIONAL,
3585 OUT UINT8 **EncryptedData,
3586 OUT UINTN *EncryptedDataSize
3587 )
3588{
3589 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs1v2Encrypt, Pkcs1v2Encrypt, (PublicKey, PublicKeySize, InData, InDataSize, PrngSeed, PrngSeedSize, EncryptedData, EncryptedDataSize), FALSE);
3590}
3591
3625BOOLEAN
3626EFIAPI
3628 IN VOID *RsaContext,
3629 IN UINT8 *InData,
3630 IN UINTN InDataSize,
3631 IN CONST UINT8 *PrngSeed OPTIONAL,
3632 IN UINTN PrngSeedSize OPTIONAL,
3633 IN UINT16 DigestLen OPTIONAL,
3634 OUT UINT8 **EncryptedData,
3635 OUT UINTN *EncryptedDataSize
3636 )
3637{
3638 return CALL_BASECRYPTLIB (Rsa.Services.RsaOaepEncrypt, RsaOaepEncrypt, (RsaContext, InData, InDataSize, PrngSeed, PrngSeedSize, DigestLen, EncryptedData, EncryptedDataSize), FALSE);
3639}
3640
3662BOOLEAN
3663EFIAPI
3665 IN CONST UINT8 *PrivateKey,
3666 IN UINTN PrivateKeySize,
3667 IN UINT8 *EncryptedData,
3668 IN UINTN EncryptedDataSize,
3669 OUT UINT8 **OutData,
3670 OUT UINTN *OutDataSize
3671 )
3672{
3673 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs1v2Decrypt, Pkcs1v2Decrypt, (PrivateKey, PrivateKeySize, EncryptedData, EncryptedDataSize, OutData, OutDataSize), FALSE);
3674}
3675
3703BOOLEAN
3704EFIAPI
3706 IN VOID *RsaContext,
3707 IN UINT8 *EncryptedData,
3708 IN UINTN EncryptedDataSize,
3709 IN UINT16 DigestLen OPTIONAL,
3710 OUT UINT8 **OutData,
3711 OUT UINTN *OutDataSize
3712 )
3713{
3714 return CALL_BASECRYPTLIB (Rsa.Services.RsaOaepDecrypt, RsaOaepDecrypt, (RsaContext, EncryptedData, EncryptedDataSize, DigestLen, OutData, OutDataSize), FALSE);
3715}
3716
3743BOOLEAN
3744EFIAPI
3746 IN CONST UINT8 *P7Data,
3747 IN UINTN P7Length,
3748 OUT UINT8 **CertStack,
3749 OUT UINTN *StackLength,
3750 OUT UINT8 **TrustedCert,
3751 OUT UINTN *CertLength
3752 )
3753{
3754 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs7GetSigners, Pkcs7GetSigners, (P7Data, P7Length, CertStack, StackLength, TrustedCert, CertLength), FALSE);
3755}
3756
3765VOID
3766EFIAPI
3768 IN UINT8 *Certs
3769 )
3770{
3771 CALL_VOID_BASECRYPTLIB (Pkcs.Services.Pkcs7FreeSigners, Pkcs7FreeSigners, (Certs));
3772}
3773
3796BOOLEAN
3797EFIAPI
3799 IN CONST UINT8 *P7Data,
3800 IN UINTN P7Length,
3801 OUT UINT8 **SignerChainCerts,
3802 OUT UINTN *ChainLength,
3803 OUT UINT8 **UnchainCerts,
3804 OUT UINTN *UnchainLength
3805 )
3806{
3807 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs7GetCertificatesList, Pkcs7GetCertificatesList, (P7Data, P7Length, SignerChainCerts, ChainLength, UnchainCerts, UnchainLength), FALSE);
3808}
3809
3837BOOLEAN
3838EFIAPI
3840 IN CONST UINT8 *PrivateKey,
3841 IN UINTN PrivateKeySize,
3842 IN CONST UINT8 *KeyPassword,
3843 IN UINT8 *InData,
3844 IN UINTN InDataSize,
3845 IN UINT8 *SignCert,
3846 IN UINT8 *OtherCerts OPTIONAL,
3847 OUT UINT8 **SignedData,
3848 OUT UINTN *SignedDataSize
3849 )
3850{
3851 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs7Sign, Pkcs7Sign, (PrivateKey, PrivateKeySize, KeyPassword, InData, InDataSize, SignCert, OtherCerts, SignedData, SignedDataSize), FALSE);
3852}
3853
3876BOOLEAN
3877EFIAPI
3879 IN CONST UINT8 *P7Data,
3880 IN UINTN P7Length,
3881 IN CONST UINT8 *TrustedCert,
3882 IN UINTN CertLength,
3883 IN CONST UINT8 *InData,
3884 IN UINTN DataLength
3885 )
3886{
3887 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs7Verify, Pkcs7Verify, (P7Data, P7Length, TrustedCert, CertLength, InData, DataLength), FALSE);
3888}
3889
3922RETURN_STATUS
3923EFIAPI
3925 IN CONST UINT8 *Pkcs7Signature,
3926 IN CONST UINT32 SignatureSize,
3927 IN CONST CHAR8 *RequiredEKUs[],
3928 IN CONST UINT32 RequiredEKUsSize,
3929 IN BOOLEAN RequireAllPresent
3930 )
3931{
3932 return CALL_BASECRYPTLIB (Pkcs.Services.VerifyEKUsInPkcs7Signature, VerifyEKUsInPkcs7Signature, (Pkcs7Signature, SignatureSize, RequiredEKUs, RequiredEKUsSize, RequireAllPresent), FALSE);
3933}
3934
3955BOOLEAN
3956EFIAPI
3958 IN CONST UINT8 *P7Data,
3959 IN UINTN P7Length,
3960 OUT VOID **Content,
3961 OUT UINTN *ContentSize
3962 )
3963{
3964 return CALL_BASECRYPTLIB (Pkcs.Services.Pkcs7GetAttachedContent, Pkcs7GetAttachedContent, (P7Data, P7Length, Content, ContentSize), FALSE);
3965}
3966
3991BOOLEAN
3992EFIAPI
3994 IN CONST UINT8 *AuthData,
3995 IN UINTN DataSize,
3996 IN CONST UINT8 *TrustedCert,
3997 IN UINTN CertSize,
3998 IN CONST UINT8 *ImageHash,
3999 IN UINTN HashSize
4000 )
4001{
4002 return CALL_BASECRYPTLIB (Pkcs.Services.AuthenticodeVerify, AuthenticodeVerify, (AuthData, DataSize, TrustedCert, CertSize, ImageHash, HashSize), FALSE);
4003}
4004
4025BOOLEAN
4026EFIAPI
4028 IN CONST UINT8 *AuthData,
4029 IN UINTN DataSize,
4030 IN CONST UINT8 *TsaCert,
4031 IN UINTN CertSize,
4032 OUT EFI_TIME *SigningTime
4033 )
4034{
4035 return CALL_BASECRYPTLIB (Pkcs.Services.ImageTimestampVerify, ImageTimestampVerify, (AuthData, DataSize, TsaCert, CertSize, SigningTime), FALSE);
4036}
4037
4038// =====================================================================================
4039// DH Key Exchange Primitive
4040// =====================================================================================
4041
4050VOID *
4051EFIAPI
4053 VOID
4054 )
4055{
4056 return CALL_BASECRYPTLIB (Dh.Services.New, DhNew, (), NULL);
4057}
4058
4067VOID
4068EFIAPI
4070 IN VOID *DhContext
4071 )
4072{
4073 CALL_VOID_BASECRYPTLIB (Dh.Services.Free, DhFree, (DhContext));
4074}
4075
4100BOOLEAN
4101EFIAPI
4103 IN OUT VOID *DhContext,
4105 IN UINTN PrimeLength,
4106 OUT UINT8 *Prime
4107 )
4108{
4109 return CALL_BASECRYPTLIB (Dh.Services.GenerateParameter, DhGenerateParameter, (DhContext, Generator, PrimeLength, Prime), FALSE);
4110}
4111
4135BOOLEAN
4136EFIAPI
4138 IN OUT VOID *DhContext,
4140 IN UINTN PrimeLength,
4141 IN CONST UINT8 *Prime
4142 )
4143{
4144 return CALL_BASECRYPTLIB (Dh.Services.SetParameter, DhSetParameter, (DhContext, Generator, PrimeLength, Prime), FALSE);
4145}
4146
4171BOOLEAN
4172EFIAPI
4174 IN OUT VOID *DhContext,
4175 OUT UINT8 *PublicKey,
4176 IN OUT UINTN *PublicKeySize
4177 )
4178{
4179 return CALL_BASECRYPTLIB (Dh.Services.GenerateKey, DhGenerateKey, (DhContext, PublicKey, PublicKeySize), FALSE);
4180}
4181
4208BOOLEAN
4209EFIAPI
4211 IN OUT VOID *DhContext,
4212 IN CONST UINT8 *PeerPublicKey,
4213 IN UINTN PeerPublicKeySize,
4214 OUT UINT8 *Key,
4215 IN OUT UINTN *KeySize
4216 )
4217{
4218 return CALL_BASECRYPTLIB (Dh.Services.ComputeKey, DhComputeKey, (DhContext, PeerPublicKey, PeerPublicKeySize, Key, KeySize), FALSE);
4219}
4220
4221// =====================================================================================
4222// Pseudo-Random Generation Primitive
4223// =====================================================================================
4224
4243BOOLEAN
4244EFIAPI
4246 IN CONST UINT8 *Seed OPTIONAL,
4247 IN UINTN SeedSize
4248 )
4249{
4250 return CALL_BASECRYPTLIB (Random.Services.Seed, RandomSeed, (Seed, SeedSize), FALSE);
4251}
4252
4267BOOLEAN
4268EFIAPI
4270 OUT UINT8 *Output,
4271 IN UINTN Size
4272 )
4273{
4274 return CALL_BASECRYPTLIB (Random.Services.Bytes, RandomBytes, (Output, Size), FALSE);
4275}
4276
4277// =====================================================================================
4278// Key Derivation Function Primitive
4279// =====================================================================================
4280
4297BOOLEAN
4298EFIAPI
4300 IN CONST UINT8 *Key,
4301 IN UINTN KeySize,
4302 IN CONST UINT8 *Salt,
4303 IN UINTN SaltSize,
4304 IN CONST UINT8 *Info,
4305 IN UINTN InfoSize,
4306 OUT UINT8 *Out,
4307 IN UINTN OutSize
4308 )
4309{
4310 return CALL_BASECRYPTLIB (Hkdf.Services.Sha256ExtractAndExpand, HkdfSha256ExtractAndExpand, (Key, KeySize, Salt, SaltSize, Info, InfoSize, Out, OutSize), FALSE);
4311}
4312
4327BOOLEAN
4328EFIAPI
4330 IN CONST UINT8 *Key,
4331 IN UINTN KeySize,
4332 IN CONST UINT8 *Salt,
4333 IN UINTN SaltSize,
4334 OUT UINT8 *PrkOut,
4335 UINTN PrkOutSize
4336 )
4337{
4338 return CALL_BASECRYPTLIB (Hkdf.Services.Sha256Extract, HkdfSha256Extract, (Key, KeySize, Salt, SaltSize, PrkOut, PrkOutSize), FALSE);
4339}
4340
4355BOOLEAN
4356EFIAPI
4358 IN CONST UINT8 *Prk,
4359 IN UINTN PrkSize,
4360 IN CONST UINT8 *Info,
4361 IN UINTN InfoSize,
4362 OUT UINT8 *Out,
4363 IN UINTN OutSize
4364 )
4365{
4366 return CALL_BASECRYPTLIB (Hkdf.Services.Sha256Expand, HkdfSha256Expand, (Prk, PrkSize, Info, InfoSize, Out, OutSize), FALSE);
4367}
4368
4385BOOLEAN
4386EFIAPI
4388 IN CONST UINT8 *Key,
4389 IN UINTN KeySize,
4390 IN CONST UINT8 *Salt,
4391 IN UINTN SaltSize,
4392 IN CONST UINT8 *Info,
4393 IN UINTN InfoSize,
4394 OUT UINT8 *Out,
4395 IN UINTN OutSize
4396 )
4397{
4398 return CALL_BASECRYPTLIB (Hkdf.Services.Sha384ExtractAndExpand, HkdfSha384ExtractAndExpand, (Key, KeySize, Salt, SaltSize, Info, InfoSize, Out, OutSize), FALSE);
4399}
4400
4415BOOLEAN
4416EFIAPI
4418 IN CONST UINT8 *Key,
4419 IN UINTN KeySize,
4420 IN CONST UINT8 *Salt,
4421 IN UINTN SaltSize,
4422 OUT UINT8 *PrkOut,
4423 UINTN PrkOutSize
4424 )
4425{
4426 return CALL_BASECRYPTLIB (Hkdf.Services.Sha384Extract, HkdfSha384Extract, (Key, KeySize, Salt, SaltSize, PrkOut, PrkOutSize), FALSE);
4427}
4428
4443BOOLEAN
4444EFIAPI
4446 IN CONST UINT8 *Prk,
4447 IN UINTN PrkSize,
4448 IN CONST UINT8 *Info,
4449 IN UINTN InfoSize,
4450 OUT UINT8 *Out,
4451 IN UINTN OutSize
4452 )
4453{
4454 return CALL_BASECRYPTLIB (Hkdf.Services.Sha384Expand, HkdfSha384Expand, (Prk, PrkSize, Info, InfoSize, Out, OutSize), FALSE);
4455}
4456
4468BOOLEAN
4469EFIAPI
4471 VOID
4472 )
4473{
4474 return CALL_BASECRYPTLIB (Tls.Services.Initialize, TlsInitialize, (), FALSE);
4475}
4476
4483VOID
4484EFIAPI
4486 IN VOID *TlsCtx
4487 )
4488{
4489 CALL_VOID_BASECRYPTLIB (Tls.Services.CtxFree, TlsCtxFree, (TlsCtx));
4490}
4491
4503VOID *
4504EFIAPI
4506 IN UINT8 MajorVer,
4507 IN UINT8 MinorVer
4508 )
4509{
4510 return CALL_BASECRYPTLIB (Tls.Services.CtxNew, TlsCtxNew, (MajorVer, MinorVer), NULL);
4511}
4512
4522VOID
4523EFIAPI
4525 IN VOID *Tls
4526 )
4527{
4528 CALL_VOID_BASECRYPTLIB (Tls.Services.Free, TlsFree, (Tls));
4529}
4530
4544VOID *
4545EFIAPI
4547 IN VOID *TlsCtx
4548 )
4549{
4550 return CALL_BASECRYPTLIB (Tls.Services.New, TlsNew, (TlsCtx), NULL);
4551}
4552
4564BOOLEAN
4565EFIAPI
4567 IN VOID *Tls
4568 )
4569{
4570 return CALL_BASECRYPTLIB (Tls.Services.InHandshake, TlsInHandshake, (Tls), FALSE);
4571}
4572
4600EFIAPI
4602 IN VOID *Tls,
4603 IN UINT8 *BufferIn OPTIONAL,
4604 IN UINTN BufferInSize OPTIONAL,
4605 OUT UINT8 *BufferOut OPTIONAL,
4606 IN OUT UINTN *BufferOutSize
4607 )
4608{
4609 return CALL_BASECRYPTLIB (Tls.Services.DoHandshake, TlsDoHandshake, (Tls, BufferIn, BufferInSize, BufferOut, BufferOutSize), EFI_UNSUPPORTED);
4610}
4611
4638EFIAPI
4640 IN VOID *Tls,
4641 IN UINT8 *BufferIn OPTIONAL,
4642 IN UINTN BufferInSize OPTIONAL,
4643 OUT UINT8 *BufferOut OPTIONAL,
4644 IN OUT UINTN *BufferOutSize
4645 )
4646{
4647 return CALL_BASECRYPTLIB (Tls.Services.HandleAlert, TlsHandleAlert, (Tls, BufferIn, BufferInSize, BufferOut, BufferOutSize), EFI_UNSUPPORTED);
4648}
4649
4669EFIAPI
4671 IN VOID *Tls,
4672 IN OUT UINT8 *Buffer,
4673 IN OUT UINTN *BufferSize
4674 )
4675{
4676 return CALL_BASECRYPTLIB (Tls.Services.CloseNotify, TlsCloseNotify, (Tls, Buffer, BufferSize), EFI_UNSUPPORTED);
4677}
4678
4693INTN
4694EFIAPI
4696 IN VOID *Tls,
4697 IN OUT VOID *Buffer,
4698 IN UINTN BufferSize
4699 )
4700{
4701 return CALL_BASECRYPTLIB (Tls.Services.CtrlTrafficOut, TlsCtrlTrafficOut, (Tls, Buffer, BufferSize), 0);
4702}
4703
4718INTN
4719EFIAPI
4721 IN VOID *Tls,
4722 IN VOID *Buffer,
4723 IN UINTN BufferSize
4724 )
4725{
4726 return CALL_BASECRYPTLIB (Tls.Services.CtrlTrafficIn, TlsCtrlTrafficIn, (Tls, Buffer, BufferSize), 0);
4727}
4728
4744INTN
4745EFIAPI
4747 IN VOID *Tls,
4748 IN OUT VOID *Buffer,
4749 IN UINTN BufferSize
4750 )
4751{
4752 return CALL_BASECRYPTLIB (Tls.Services.Read, TlsRead, (Tls, Buffer, BufferSize), 0);
4753}
4754
4770INTN
4771EFIAPI
4773 IN VOID *Tls,
4774 IN VOID *Buffer,
4775 IN UINTN BufferSize
4776 )
4777{
4778 return CALL_BASECRYPTLIB (Tls.Services.Write, TlsWrite, (Tls, Buffer, BufferSize), 0);
4779}
4780
4795EFIAPI
4797 IN VOID *Tls
4798 )
4799{
4800 return CALL_BASECRYPTLIB (Tls.Services.Shutdown, TlsShutdown, (Tls), EFI_UNSUPPORTED);
4801}
4802
4818EFIAPI
4820 IN VOID *Tls,
4821 IN UINT8 MajorVer,
4822 IN UINT8 MinorVer
4823 )
4824{
4825 return CALL_BASECRYPTLIB (TlsSet.Services.Version, TlsSetVersion, (Tls, MajorVer, MinorVer), EFI_UNSUPPORTED);
4826}
4827
4842EFIAPI
4844 IN VOID *Tls,
4845 IN BOOLEAN IsServer
4846 )
4847{
4848 return CALL_BASECRYPTLIB (TlsSet.Services.ConnectionEnd, TlsSetConnectionEnd, (Tls, IsServer), EFI_UNSUPPORTED);
4849}
4850
4870EFIAPI
4872 IN VOID *Tls,
4873 IN UINT16 *CipherId,
4874 IN UINTN CipherNum
4875 )
4876{
4877 return CALL_BASECRYPTLIB (TlsSet.Services.CipherList, TlsSetCipherList, (Tls, CipherId, CipherNum), EFI_UNSUPPORTED);
4878}
4879
4893EFIAPI
4895 IN UINT8 CompMethod
4896 )
4897{
4898 return CALL_BASECRYPTLIB (TlsSet.Services.CompressionMethod, TlsSetCompressionMethod, (CompMethod), EFI_UNSUPPORTED);
4899}
4900
4910VOID
4911EFIAPI
4913 IN VOID *Tls,
4914 IN UINT32 VerifyMode
4915 )
4916{
4917 CALL_VOID_BASECRYPTLIB (TlsSet.Services.Verify, TlsSetVerify, (Tls, VerifyMode));
4918}
4919
4933EFIAPI
4935 IN VOID *Tls,
4936 IN UINT32 Flags,
4937 IN CHAR8 *HostName
4938 )
4939{
4940 return CALL_BASECRYPTLIB (TlsSet.Services.VerifyHost, TlsSetVerifyHost, (Tls, Flags, HostName), EFI_UNSUPPORTED);
4941}
4942
4959EFIAPI
4961 IN VOID *Tls,
4962 IN UINT8 *SessionId,
4963 IN UINT16 SessionIdLen
4964 )
4965{
4966 return CALL_BASECRYPTLIB (TlsSet.Services.SessionId, TlsSetSessionId, (Tls, SessionId, SessionIdLen), EFI_UNSUPPORTED);
4967}
4968
4987EFIAPI
4989 IN VOID *Tls,
4990 IN VOID *Data,
4991 IN UINTN DataSize
4992 )
4993{
4994 return CALL_BASECRYPTLIB (TlsSet.Services.CaCertificate, TlsSetCaCertificate, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4995}
4996
5015EFIAPI
5017 IN VOID *Tls,
5018 IN VOID *Data,
5019 IN UINTN DataSize
5020 )
5021{
5022 return CALL_BASECRYPTLIB (TlsSet.Services.HostPublicCert, TlsSetHostPublicCert, (Tls, Data, DataSize), EFI_UNSUPPORTED);
5023}
5024
5044EFIAPI
5046 IN VOID *Tls,
5047 IN VOID *Data,
5048 IN UINTN DataSize,
5049 IN VOID *Password OPTIONAL
5050 )
5051{
5052 return CALL_BASECRYPTLIB (TlsSet.Services.HostPrivateKeyEx, TlsSetHostPrivateKeyEx, (Tls, Data, DataSize, Password), EFI_UNSUPPORTED);
5053}
5054
5072EFIAPI
5074 IN VOID *Tls,
5075 IN VOID *Data,
5076 IN UINTN DataSize
5077 )
5078{
5079 return CALL_BASECRYPTLIB (TlsSet.Services.HostPrivateKey, TlsSetHostPrivateKey, (Tls, Data, DataSize), EFI_UNSUPPORTED);
5080}
5081
5097EFIAPI
5099 IN VOID *Data,
5100 IN UINTN DataSize
5101 )
5102{
5103 return CALL_BASECRYPTLIB (TlsSet.Services.CertRevocationList, TlsSetCertRevocationList, (Data, DataSize), EFI_UNSUPPORTED);
5104}
5105
5124EFIAPI
5126 IN VOID *Tls,
5127 IN UINT8 *Data,
5128 IN UINTN DataSize
5129 )
5130{
5131 return CALL_BASECRYPTLIB (TlsSet.Services.SignatureAlgoList, TlsSetSignatureAlgoList, (Tls, Data, DataSize), EFI_UNSUPPORTED);
5132}
5133
5149EFIAPI
5151 IN VOID *Tls,
5152 IN UINT8 *Data,
5153 IN UINTN DataSize
5154 )
5155{
5156 return CALL_BASECRYPTLIB (TlsSet.Services.EcCurve, TlsSetEcCurve, (Tls, Data, DataSize), EFI_UNSUPPORTED);
5157}
5158
5172UINT16
5173EFIAPI
5175 IN VOID *Tls
5176 )
5177{
5178 return CALL_BASECRYPTLIB (TlsGet.Services.Version, TlsGetVersion, (Tls), 0);
5179}
5180
5194UINT8
5195EFIAPI
5197 IN VOID *Tls
5198 )
5199{
5200 return CALL_BASECRYPTLIB (TlsGet.Services.ConnectionEnd, TlsGetConnectionEnd, (Tls), 0);
5201}
5202
5218EFIAPI
5220 IN VOID *Tls,
5221 IN OUT UINT16 *CipherId
5222 )
5223{
5224 return CALL_BASECRYPTLIB (TlsGet.Services.CurrentCipher, TlsGetCurrentCipher, (Tls, CipherId), EFI_UNSUPPORTED);
5225}
5226
5244EFIAPI
5246 IN VOID *Tls,
5247 IN OUT UINT8 *CompressionId
5248 )
5249{
5250 return CALL_BASECRYPTLIB (TlsGet.Services.CurrentCompressionId, TlsGetCurrentCompressionId, (Tls, CompressionId), EFI_UNSUPPORTED);
5251}
5252
5266UINT32
5267EFIAPI
5269 IN VOID *Tls
5270 )
5271{
5272 return CALL_BASECRYPTLIB (TlsGet.Services.Verify, TlsGetVerify, (Tls), 0);
5273}
5274
5291EFIAPI
5293 IN VOID *Tls,
5294 IN OUT UINT8 *SessionId,
5295 IN OUT UINT16 *SessionIdLen
5296 )
5297{
5298 return CALL_BASECRYPTLIB (TlsGet.Services.SessionId, TlsGetSessionId, (Tls, SessionId, SessionIdLen), EFI_UNSUPPORTED);
5299}
5300
5312VOID
5313EFIAPI
5315 IN VOID *Tls,
5316 IN OUT UINT8 *ClientRandom
5317 )
5318{
5319 CALL_VOID_BASECRYPTLIB (TlsGet.Services.ClientRandom, TlsGetClientRandom, (Tls, ClientRandom));
5320}
5321
5333VOID
5334EFIAPI
5336 IN VOID *Tls,
5337 IN OUT UINT8 *ServerRandom
5338 )
5339{
5340 CALL_VOID_BASECRYPTLIB (TlsGet.Services.ServerRandom, TlsGetServerRandom, (Tls, ServerRandom));
5341}
5342
5358EFIAPI
5360 IN VOID *Tls,
5361 IN OUT UINT8 *KeyMaterial
5362 )
5363{
5364 return CALL_BASECRYPTLIB (TlsGet.Services.KeyMaterial, TlsGetKeyMaterial, (Tls, KeyMaterial), EFI_UNSUPPORTED);
5365}
5366
5384EFIAPI
5386 IN VOID *Tls,
5387 OUT VOID *Data,
5388 IN OUT UINTN *DataSize
5389 )
5390{
5391 return CALL_BASECRYPTLIB (TlsGet.Services.CaCertificate, TlsGetCaCertificate, (Tls, Data, DataSize), EFI_UNSUPPORTED);
5392}
5393
5412EFIAPI
5414 IN VOID *Tls,
5415 OUT VOID *Data,
5416 IN OUT UINTN *DataSize
5417 )
5418{
5419 return CALL_BASECRYPTLIB (TlsGet.Services.HostPublicCert, TlsGetHostPublicCert, (Tls, Data, DataSize), EFI_UNSUPPORTED);
5420}
5421
5439EFIAPI
5441 IN VOID *Tls,
5442 OUT VOID *Data,
5443 IN OUT UINTN *DataSize
5444 )
5445{
5446 return CALL_BASECRYPTLIB (TlsGet.Services.HostPrivateKey, TlsGetHostPrivateKey, (Tls, Data, DataSize), EFI_UNSUPPORTED);
5447}
5448
5465EFIAPI
5467 OUT VOID *Data,
5468 IN OUT UINTN *DataSize
5469 )
5470{
5471 return CALL_BASECRYPTLIB (TlsGet.Services.CertRevocationList, TlsGetCertRevocationList, (Data, DataSize), EFI_UNSUPPORTED);
5472}
5473
5493EFIAPI
5495 IN VOID *Tls,
5496 IN CONST VOID *Label,
5497 IN CONST VOID *Context,
5498 IN UINTN ContextLen,
5499 OUT VOID *KeyBuffer,
5500 IN UINTN KeyBufferLen
5501 )
5502{
5503 return CALL_BASECRYPTLIB (
5504 TlsGet.Services.ExportKey,
5506 (Tls, Label, Context, ContextLen,
5507 KeyBuffer, KeyBufferLen),
5508 EFI_UNSUPPORTED
5509 );
5510}
5511
5544BOOLEAN
5545EFIAPI
5547 IN VOID *RsaContext,
5548 IN CONST UINT8 *Message,
5549 IN UINTN MsgSize,
5550 IN UINT16 DigestLen,
5551 IN UINT16 SaltLen,
5552 OUT UINT8 *Signature,
5553 IN OUT UINTN *SigSize
5554 )
5555{
5556 return CALL_BASECRYPTLIB (RsaPss.Services.Sign, RsaPssSign, (RsaContext, Message, MsgSize, DigestLen, SaltLen, Signature, SigSize), FALSE);
5557}
5558
5577BOOLEAN
5578EFIAPI
5580 IN VOID *RsaContext,
5581 IN CONST UINT8 *Message,
5582 IN UINTN MsgSize,
5583 IN CONST UINT8 *Signature,
5584 IN UINTN SigSize,
5585 IN UINT16 DigestLen,
5586 IN UINT16 SaltLen
5587 )
5588{
5589 return CALL_BASECRYPTLIB (RsaPss.Services.Verify, RsaPssVerify, (RsaContext, Message, MsgSize, Signature, SigSize, DigestLen, SaltLen), FALSE);
5590}
5591
5609BOOLEAN
5610EFIAPI
5612 IN CONST VOID *Input,
5613 IN UINTN InputByteLen,
5614 IN UINTN BlockSize,
5615 OUT VOID *Output,
5616 IN UINTN OutputByteLen,
5617 IN CONST VOID *Customization,
5618 IN UINTN CustomByteLen
5619 )
5620{
5621 return CALL_BASECRYPTLIB (ParallelHash.Services.HashAll, ParallelHash256HashAll, (Input, InputByteLen, BlockSize, Output, OutputByteLen, Customization, CustomByteLen), FALSE);
5622}
5623
5648BOOLEAN
5649EFIAPI
5651 IN CONST UINT8 *Key,
5652 IN UINTN KeySize,
5653 IN CONST UINT8 *Iv,
5654 IN UINTN IvSize,
5655 IN CONST UINT8 *AData,
5656 IN UINTN ADataSize,
5657 IN CONST UINT8 *DataIn,
5658 IN UINTN DataInSize,
5659 OUT UINT8 *TagOut,
5660 IN UINTN TagSize,
5661 OUT UINT8 *DataOut,
5662 OUT UINTN *DataOutSize
5663 )
5664{
5665 return CALL_BASECRYPTLIB (AeadAesGcm.Services.Encrypt, AeadAesGcmEncrypt, (Key, KeySize, Iv, IvSize, AData, ADataSize, DataIn, DataInSize, TagOut, TagSize, DataOut, DataOutSize), FALSE);
5666}
5667
5693BOOLEAN
5694EFIAPI
5696 IN CONST UINT8 *Key,
5697 IN UINTN KeySize,
5698 IN CONST UINT8 *Iv,
5699 IN UINTN IvSize,
5700 IN CONST UINT8 *AData,
5701 IN UINTN ADataSize,
5702 IN CONST UINT8 *DataIn,
5703 IN UINTN DataInSize,
5704 IN CONST UINT8 *Tag,
5705 IN UINTN TagSize,
5706 OUT UINT8 *DataOut,
5707 OUT UINTN *DataOutSize
5708 )
5709{
5710 return CALL_BASECRYPTLIB (AeadAesGcm.Services.Decrypt, AeadAesGcmDecrypt, (Key, KeySize, Iv, IvSize, AData, ADataSize, DataIn, DataInSize, Tag, TagSize, DataOut, DataOutSize), FALSE);
5711}
5712
5713// =====================================================================================
5714// Big number primitives
5715// =====================================================================================
5716
5722VOID *
5723EFIAPI
5725 VOID
5726 )
5727{
5728 return CALL_BASECRYPTLIB (Bn.Services.Init, BigNumInit, (), NULL);
5729}
5730
5739VOID *
5740EFIAPI
5742 IN CONST UINT8 *Buf,
5743 IN UINTN Len
5744 )
5745{
5746 return CALL_BASECRYPTLIB (Bn.Services.FromBin, BigNumFromBin, (Buf, Len), NULL);
5747}
5748
5758INTN
5759EFIAPI
5761 IN CONST VOID *Bn,
5762 OUT UINT8 *Buf
5763 )
5764{
5765 return CALL_BASECRYPTLIB (Bn.Services.ToBin, BigNumToBin, (Bn, Buf), -1);
5766}
5767
5774VOID
5775EFIAPI
5777 IN VOID *Bn,
5778 IN BOOLEAN Clear
5779 )
5780{
5781 CALL_VOID_BASECRYPTLIB (Bn.Services.Free, BigNumFree, (Bn, Clear));
5782}
5783
5796BOOLEAN
5797EFIAPI
5799 IN CONST VOID *BnA,
5800 IN CONST VOID *BnB,
5801 OUT VOID *BnRes
5802 )
5803{
5804 return CALL_BASECRYPTLIB (Bn.Services.Add, BigNumAdd, (BnA, BnB, BnRes), FALSE);
5805}
5806
5819BOOLEAN
5820EFIAPI
5822 IN CONST VOID *BnA,
5823 IN CONST VOID *BnB,
5824 OUT VOID *BnRes
5825 )
5826{
5827 return CALL_BASECRYPTLIB (Bn.Services.Sub, BigNumSub, (BnA, BnB, BnRes), FALSE);
5828}
5829
5842BOOLEAN
5843EFIAPI
5845 IN CONST VOID *BnA,
5846 IN CONST VOID *BnB,
5847 OUT VOID *BnRes
5848 )
5849{
5850 return CALL_BASECRYPTLIB (Bn.Services.Mod, BigNumMod, (BnA, BnB, BnRes), FALSE);
5851}
5852
5866BOOLEAN
5867EFIAPI
5869 IN CONST VOID *BnA,
5870 IN CONST VOID *BnP,
5871 IN CONST VOID *BnM,
5872 OUT VOID *BnRes
5873 )
5874{
5875 return CALL_BASECRYPTLIB (Bn.Services.ExpMod, BigNumExpMod, (BnA, BnP, BnM, BnRes), FALSE);
5876}
5877
5890BOOLEAN
5891EFIAPI
5893 IN CONST VOID *BnA,
5894 IN CONST VOID *BnM,
5895 OUT VOID *BnRes
5896 )
5897{
5898 return CALL_BASECRYPTLIB (Bn.Services.InverseMod, BigNumInverseMod, (BnA, BnM, BnRes), FALSE);
5899}
5900
5913BOOLEAN
5914EFIAPI
5916 IN CONST VOID *BnA,
5917 IN CONST VOID *BnB,
5918 OUT VOID *BnRes
5919 )
5920{
5921 return CALL_BASECRYPTLIB (Bn.Services.Div, BigNumDiv, (BnA, BnB, BnRes), FALSE);
5922}
5923
5937BOOLEAN
5938EFIAPI
5940 IN CONST VOID *BnA,
5941 IN CONST VOID *BnB,
5942 IN CONST VOID *BnM,
5943 OUT VOID *BnRes
5944 )
5945{
5946 return CALL_BASECRYPTLIB (Bn.Services.MulMod, BigNumMulMod, (BnA, BnB, BnM, BnRes), FALSE);
5947}
5948
5959INTN
5960EFIAPI
5962 IN CONST VOID *BnA,
5963 IN CONST VOID *BnB
5964 )
5965{
5966 return CALL_BASECRYPTLIB (Bn.Services.Cmp, BigNumCmp, (BnA, BnB), 0);
5967}
5968
5976UINTN
5977EFIAPI
5979 IN CONST VOID *Bn
5980 )
5981{
5982 return CALL_BASECRYPTLIB (Bn.Services.Bits, BigNumBits, (Bn), 0);
5983}
5984
5992UINTN
5993EFIAPI
5995 IN CONST VOID *Bn
5996 )
5997{
5998 return CALL_BASECRYPTLIB (Bn.Services.Bytes, BigNumBytes, (Bn), 0);
5999}
6000
6010BOOLEAN
6011EFIAPI
6013 IN CONST VOID *Bn,
6014 IN UINTN Num
6015 )
6016{
6017 return CALL_BASECRYPTLIB (Bn.Services.IsWord, BigNumIsWord, (Bn, Num), FALSE);
6018}
6019
6028BOOLEAN
6029EFIAPI
6031 IN CONST VOID *Bn
6032 )
6033{
6034 return CALL_BASECRYPTLIB (Bn.Services.IsOdd, BigNumIsOdd, (Bn), FALSE);
6035}
6036
6046VOID *
6047EFIAPI
6049 OUT VOID *BnDst,
6050 IN CONST VOID *BnSrc
6051 )
6052{
6053 return CALL_BASECRYPTLIB (Bn.Services.Copy, BigNumCopy, (BnDst, BnSrc), NULL);
6054}
6055
6062CONST VOID *
6063EFIAPI
6065 VOID
6066 )
6067{
6068 return CALL_BASECRYPTLIB (Bn.Services.ValueOne, BigNumValueOne, (), NULL);
6069}
6070
6083BOOLEAN
6084EFIAPI
6086 IN CONST VOID *Bn,
6087 IN UINTN N,
6088 OUT VOID *BnRes
6089 )
6090{
6091 return CALL_BASECRYPTLIB (Bn.Services.RShift, BigNumRShift, (Bn, N, BnRes), FALSE);
6092}
6093
6101VOID
6102EFIAPI
6104 IN VOID *Bn
6105 )
6106{
6107 CALL_VOID_BASECRYPTLIB (Bn.Services.ConstTime, BigNumConstTime, (Bn));
6108}
6109
6122BOOLEAN
6123EFIAPI
6125 IN CONST VOID *BnA,
6126 IN CONST VOID *BnM,
6127 OUT VOID *BnRes
6128 )
6129{
6130 return CALL_BASECRYPTLIB (Bn.Services.SqrMod, BigNumSqrMod, (BnA, BnM, BnRes), FALSE);
6131}
6132
6140VOID *
6141EFIAPI
6143 VOID
6144 )
6145{
6146 return CALL_BASECRYPTLIB (Bn.Services.NewContext, BigNumNewContext, (), NULL);
6147}
6148
6154VOID
6155EFIAPI
6157 IN VOID *BnCtx
6158 )
6159{
6160 CALL_VOID_BASECRYPTLIB (Bn.Services.ContextFree, BigNumContextFree, (BnCtx));
6161}
6162
6172BOOLEAN
6173EFIAPI
6175 IN VOID *Bn,
6176 IN UINTN Val
6177 )
6178{
6179 return CALL_BASECRYPTLIB (Bn.Services.SetUint, BigNumSetUint, (Bn, Val), FALSE);
6180}
6181
6193BOOLEAN
6194EFIAPI
6196 IN CONST VOID *BnA,
6197 IN CONST VOID *BnB,
6198 IN CONST VOID *BnM,
6199 OUT VOID *BnRes
6200 )
6201{
6202 return CALL_BASECRYPTLIB (Bn.Services.AddMod, BigNumAddMod, (BnA, BnB, BnM, BnRes), FALSE);
6203}
6204
6205// =====================================================================================
6206// Basic Elliptic Curve Primitives
6207// =====================================================================================
6208
6220VOID *
6221EFIAPI
6223 IN UINTN CryptoNid
6224 )
6225{
6226 return CALL_BASECRYPTLIB (Ec.Services.GroupInit, EcGroupInit, (CryptoNid), NULL);
6227}
6228
6243BOOLEAN
6244EFIAPI
6246 IN CONST VOID *EcGroup,
6247 OUT VOID *BnPrime,
6248 OUT VOID *BnA,
6249 OUT VOID *BnB,
6250 IN VOID *BnCtx
6251 )
6252{
6253 return CALL_BASECRYPTLIB (Ec.Services.GroupGetCurve, EcGroupGetCurve, (EcGroup, BnPrime, BnA, BnB, BnCtx), FALSE);
6254}
6255
6268BOOLEAN
6269EFIAPI
6271 IN VOID *EcGroup,
6272 OUT VOID *BnOrder
6273 )
6274{
6275 return CALL_BASECRYPTLIB (Ec.Services.GroupGetOrder, EcGroupGetOrder, (EcGroup, BnOrder), FALSE);
6276}
6277
6283VOID
6284EFIAPI
6286 IN VOID *EcGroup
6287 )
6288{
6289 CALL_VOID_BASECRYPTLIB (Ec.Services.GroupFree, EcGroupFree, (EcGroup));
6290}
6291
6301VOID *
6302EFIAPI
6304 IN CONST VOID *EcGroup
6305 )
6306{
6307 return CALL_BASECRYPTLIB (Ec.Services.PointInit, EcPointInit, (EcGroup), NULL);
6308}
6309
6316VOID
6317EFIAPI
6319 IN VOID *EcPoint,
6320 IN BOOLEAN Clear
6321 )
6322{
6323 CALL_VOID_BASECRYPTLIB (Ec.Services.PointDeInit, EcPointDeInit, (EcPoint, Clear));
6324}
6325
6341BOOLEAN
6342EFIAPI
6344 IN CONST VOID *EcGroup,
6345 IN CONST VOID *EcPoint,
6346 OUT VOID *BnX,
6347 OUT VOID *BnY,
6348 IN VOID *BnCtx
6349 )
6350{
6351 return CALL_BASECRYPTLIB (Ec.Services.PointGetAffineCoordinates, EcPointGetAffineCoordinates, (EcGroup, EcPoint, BnX, BnY, BnCtx), FALSE);
6352}
6353
6366BOOLEAN
6367EFIAPI
6369 IN CONST VOID *EcGroup,
6370 IN VOID *EcPoint,
6371 IN CONST VOID *BnX,
6372 IN CONST VOID *BnY,
6373 IN VOID *BnCtx
6374 )
6375{
6376 return CALL_BASECRYPTLIB (Ec.Services.PointSetAffineCoordinates, EcPointSetAffineCoordinates, (EcGroup, EcPoint, BnX, BnY, BnCtx), FALSE);
6377}
6378
6391BOOLEAN
6392EFIAPI
6394 IN CONST VOID *EcGroup,
6395 OUT VOID *EcPointResult,
6396 IN CONST VOID *EcPointA,
6397 IN CONST VOID *EcPointB,
6398 IN VOID *BnCtx
6399 )
6400{
6401 return CALL_BASECRYPTLIB (Ec.Services.PointAdd, EcPointAdd, (EcGroup, EcPointResult, EcPointA, EcPointB, BnCtx), FALSE);
6402}
6403
6417BOOLEAN
6418EFIAPI
6420 IN CONST VOID *EcGroup,
6421 OUT VOID *EcPointResult,
6422 IN CONST VOID *EcPoint,
6423 IN CONST VOID *BnPScalar,
6424 IN VOID *BnCtx
6425 )
6426{
6427 return CALL_BASECRYPTLIB (Ec.Services.PointMul, EcPointMul, (EcGroup, EcPointResult, EcPoint, BnPScalar, BnCtx), FALSE);
6428}
6429
6440BOOLEAN
6441EFIAPI
6443 IN CONST VOID *EcGroup,
6444 IN OUT VOID *EcPoint,
6445 IN VOID *BnCtx
6446 )
6447{
6448 return CALL_BASECRYPTLIB (Ec.Services.PointInvert, EcPointInvert, (EcGroup, EcPoint, BnCtx), FALSE);
6449}
6450
6461BOOLEAN
6462EFIAPI
6464 IN CONST VOID *EcGroup,
6465 IN CONST VOID *EcPoint,
6466 IN VOID *BnCtx
6467 )
6468{
6469 return CALL_BASECRYPTLIB (Ec.Services.PointIsOnCurve, EcPointIsOnCurve, (EcGroup, EcPoint, BnCtx), FALSE);
6470}
6471
6481BOOLEAN
6482EFIAPI
6484 IN CONST VOID *EcGroup,
6485 IN CONST VOID *EcPoint
6486 )
6487{
6488 return CALL_BASECRYPTLIB (Ec.Services.PointIsAtInfinity, EcPointIsAtInfinity, (EcGroup, EcPoint), FALSE);
6489}
6490
6502BOOLEAN
6503EFIAPI
6505 IN CONST VOID *EcGroup,
6506 IN CONST VOID *EcPointA,
6507 IN CONST VOID *EcPointB,
6508 IN VOID *BnCtx
6509 )
6510{
6511 return CALL_BASECRYPTLIB (Ec.Services.PointEqual, EcPointEqual, (EcGroup, EcPointA, EcPointB, BnCtx), FALSE);
6512}
6513
6531BOOLEAN
6532EFIAPI
6534 IN CONST VOID *EcGroup,
6535 IN VOID *EcPoint,
6536 IN CONST VOID *BnX,
6537 IN UINT8 YBit,
6538 IN VOID *BnCtx
6539 )
6540{
6541 return CALL_BASECRYPTLIB (Ec.Services.PointSetCompressedCoordinates, EcPointSetCompressedCoordinates, (EcGroup, EcPoint, BnX, YBit, BnCtx), FALSE);
6542}
6543
6544// =====================================================================================
6545// Elliptic Curve Diffie Hellman Primitives
6546// =====================================================================================
6547
6556VOID *
6557EFIAPI
6559 IN UINTN Nid
6560 )
6561{
6562 return CALL_BASECRYPTLIB (Ec.Services.NewByNid, EcNewByNid, (Nid), NULL);
6563}
6564
6570VOID
6571EFIAPI
6573 IN VOID *EcContext
6574 )
6575{
6576 CALL_VOID_BASECRYPTLIB (Ec.Services.Free, EcFree, (EcContext));
6577}
6578
6605BOOLEAN
6606EFIAPI
6608 IN OUT VOID *EcContext,
6609 OUT UINT8 *PublicKey,
6610 IN OUT UINTN *PublicKeySize
6611 )
6612{
6613 return CALL_BASECRYPTLIB (Ec.Services.GenerateKey, EcGenerateKey, (EcContext, PublicKey, PublicKeySize), FALSE);
6614}
6615
6630BOOLEAN
6631EFIAPI
6633 IN OUT VOID *EcContext,
6634 OUT UINT8 *PublicKey,
6635 IN OUT UINTN *PublicKeySize
6636 )
6637{
6638 return CALL_BASECRYPTLIB (Ec.Services.GetPubKey, EcGetPubKey, (EcContext, PublicKey, PublicKeySize), FALSE);
6639}
6640
6666BOOLEAN
6667EFIAPI
6669 IN OUT VOID *EcContext,
6670 IN CONST UINT8 *PeerPublic,
6671 IN UINTN PeerPublicSize,
6672 IN CONST INT32 *CompressFlag,
6673 OUT UINT8 *Key,
6674 IN OUT UINTN *KeySize
6675 )
6676{
6677 return CALL_BASECRYPTLIB (Ec.Services.DhComputeKey, EcDhComputeKey, (EcContext, PeerPublic, PeerPublicSize, CompressFlag, Key, KeySize), FALSE);
6678}
6679
6696BOOLEAN
6697EFIAPI
6699 IN CONST UINT8 *Cert,
6700 IN UINTN CertSize,
6701 OUT VOID **EcContext
6702 )
6703{
6704 return CALL_BASECRYPTLIB (Ec.Services.GetPublicKeyFromX509, EcGetPublicKeyFromX509, (Cert, CertSize, EcContext), FALSE);
6705}
6706
6724BOOLEAN
6725EFIAPI
6727 IN CONST UINT8 *PemData,
6728 IN UINTN PemSize,
6729 IN CONST CHAR8 *Password,
6730 OUT VOID **EcContext
6731 )
6732{
6733 return CALL_BASECRYPTLIB (Ec.Services.GetPrivateKeyFromPem, EcGetPrivateKeyFromPem, (PemData, PemSize, Password, EcContext), FALSE);
6734}
6735
6765BOOLEAN
6766EFIAPI
6768 IN VOID *EcContext,
6769 IN UINTN HashNid,
6770 IN CONST UINT8 *MessageHash,
6771 IN UINTN HashSize,
6772 OUT UINT8 *Signature,
6773 IN OUT UINTN *SigSize
6774 )
6775{
6776 return CALL_BASECRYPTLIB (Ec.Services.DsaSign, EcDsaSign, (EcContext, HashNid, MessageHash, HashSize, Signature, SigSize), FALSE);
6777}
6778
6802BOOLEAN
6803EFIAPI
6805 IN VOID *EcContext,
6806 IN UINTN HashNid,
6807 IN CONST UINT8 *MessageHash,
6808 IN UINTN HashSize,
6809 IN CONST UINT8 *Signature,
6810 IN UINTN SigSize
6811 )
6812{
6813 return CALL_BASECRYPTLIB (Ec.Services.DsaVerify, EcDsaVerify, (EcContext, HashNid, MessageHash, HashSize, Signature, SigSize), FALSE);
6814}
6815
6816const EDKII_CRYPTO_PROTOCOL mEdkiiCrypto = {
6847 #ifndef ENABLE_MD5_DEPRECATED_INTERFACES
6855 #else
6857 CryptoServiceMd5GetContextSize,
6858 CryptoServiceMd5Init,
6859 CryptoServiceMd5Duplicate,
6860 CryptoServiceMd5Update,
6861 CryptoServiceMd5Final,
6862 CryptoServiceMd5HashAll,
6863 #endif
6898 #ifdef DISABLE_SHA1_DEPRECATED_INTERFACES
6900 DeprecatedCryptoServiceSha1GetContextSize,
6901 DeprecatedCryptoServiceSha1Init,
6902 DeprecatedCryptoServiceSha1Duplicate,
6903 DeprecatedCryptoServiceSha1Update,
6904 DeprecatedCryptoServiceSha1Final,
6905 DeprecatedCryptoServiceSha1HashAll,
6906 #else
6914 #endif
7119};
UINT64 UINTN
INT64 INTN
BOOLEAN EFIAPI RsaPssSign(IN VOID *RsaContext, IN CONST UINT8 *Message, IN UINTN MsgSize, IN UINT16 DigestLen, IN UINT16 SaltLen, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
BOOLEAN EFIAPI X509GetSerialNumber(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *SerialNumber, OPTIONAL IN OUT UINTN *SerialNumberSize)
Definition: CryptX509.c:1011
BOOLEAN EFIAPI HmacSha384Update(IN OUT VOID *HmacSha384Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptHmac.c:564
BOOLEAN EFIAPI EcPointInvert(IN CONST VOID *EcGroup, IN OUT VOID *EcPoint, IN VOID *BnCtx)
Definition: CryptEc.c:302
BOOLEAN EFIAPI RsaCheckKey(IN VOID *RsaContext)
Definition: CryptRsaExt.c:243
BOOLEAN EFIAPI EcPointSetCompressedCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN UINT8 YBit, IN VOID *BnCtx)
Definition: CryptEc.c:393
BOOLEAN EFIAPI BigNumExpMod(IN CONST VOID *BnA, IN CONST VOID *BnP, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptBn.c:177
INT32 EFIAPI X509CompareDateTime(IN CONST VOID *DateTime1, IN CONST VOID *DateTime2)
Definition: CryptX509.c:1618
RSA_KEY_TAG
Definition: BaseCryptLib.h:74
BOOLEAN EFIAPI AesInit(OUT VOID *AesContext, IN CONST UINT8 *Key, IN UINTN KeyLength)
Definition: CryptAes.c:53
BOOLEAN EFIAPI EcPointMul(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPoint, IN CONST VOID *BnPScalar, IN VOID *BnCtx)
Definition: CryptEc.c:279
UINTN EFIAPI Sha256GetContextSize(VOID)
Definition: CryptSha256.c:20
BOOLEAN EFIAPI HmacSha384SetKey(OUT VOID *HmacSha384Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: CryptHmac.c:508
BOOLEAN EFIAPI HkdfSha256Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
Definition: CryptHkdf.c:279
BOOLEAN EFIAPI EcPointAdd(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: CryptEc.c:253
BOOLEAN EFIAPI EcGenerateKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptEc.c:475
BOOLEAN EFIAPI EcPointIsOnCurve(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, IN VOID *BnCtx)
Definition: CryptEc.c:323
BOOLEAN EFIAPI DhGenerateParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, OUT UINT8 *Prime)
Definition: CryptDh.c:76
BOOLEAN EFIAPI Pkcs5HashPassword(IN UINTN PasswordLength, IN CONST CHAR8 *Password, IN UINTN SaltLength, IN CONST UINT8 *Salt, IN UINTN IterationCount, IN UINTN DigestSize, IN UINTN KeyLength, OUT UINT8 *OutKey)
VOID *EFIAPI HmacSha256New(VOID)
Definition: CryptHmac.c:297
BOOLEAN EFIAPI BigNumMulMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptBn.c:284
UINTN EFIAPI Sha384GetContextSize(VOID)
Definition: CryptSha512.c:20
BOOLEAN EFIAPI Sha512HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptSha512.c:427
BOOLEAN EFIAPI Sm3Duplicate(IN CONST VOID *Sm3Context, OUT VOID *NewSm3Context)
Definition: CryptSm3.c:79
BOOLEAN EFIAPI HmacSha256Duplicate(IN CONST VOID *HmacSha256Context, OUT VOID *NewHmacSha256Context)
Definition: CryptHmac.c:359
BOOLEAN EFIAPI Sha512Final(IN OUT VOID *Sha512Context, OUT UINT8 *HashValue)
Definition: CryptSha512.c:389
BOOLEAN EFIAPI BigNumInverseMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptBn.c:212
VOID *EFIAPI HmacSha384New(VOID)
Definition: CryptHmac.c:468
VOID *EFIAPI BigNumFromBin(IN CONST UINT8 *Buf, IN UINTN Len)
Definition: CryptBn.c:35
BOOLEAN EFIAPI X509GetVersion(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Version)
Definition: CryptX509.c:957
BOOLEAN EFIAPI X509GetExtensionData(IN CONST UINT8 *Cert, IN UINTN CertSize, IN CONST UINT8 *Oid, IN UINTN OidSize, OUT UINT8 *ExtensionData, IN OUT UINTN *ExtensionDataSize)
Definition: CryptX509.c:1274
BOOLEAN EFIAPI BigNumDiv(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptBn.c:249
BOOLEAN EFIAPI EcPointIsAtInfinity(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint)
Definition: CryptEc.c:343
BOOLEAN EFIAPI EcGetPubKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptEc.c:567
BOOLEAN EFIAPI Pkcs7Sign(IN CONST UINT8 *PrivateKey, IN UINTN PrivateKeySize, IN CONST UINT8 *KeyPassword, IN UINT8 *InData, IN UINTN InDataSize, IN UINT8 *SignCert, IN UINT8 *OtherCerts OPTIONAL, OUT UINT8 **SignedData, OUT UINTN *SignedDataSize)
BOOLEAN EFIAPI Sha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context)
Definition: CryptSha512.c:78
BOOLEAN EFIAPI HmacSha384All(IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue)
Definition: CryptHmac.c:627
VOID *EFIAPI DhNew(VOID)
Definition: CryptDh.c:22
UINTN EFIAPI Sm3GetContextSize(VOID)
Definition: CryptSm3.c:20
BOOLEAN EFIAPI X509GetIssuerName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *CertIssuer, IN OUT UINTN *CertIssuerSize)
Definition: CryptX509.c:1097
VOID *EFIAPI RsaNew(VOID)
Definition: CryptRsaBasic.c:30
BOOLEAN EFIAPI AeadAesGcmDecrypt(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Iv, IN UINTN IvSize, IN CONST UINT8 *AData, IN UINTN ADataSize, IN CONST UINT8 *DataIn, IN UINTN DataInSize, IN CONST UINT8 *Tag, IN UINTN TagSize, OUT UINT8 *DataOut, OUT UINTN *DataOutSize)
BOOLEAN EFIAPI RsaGetPrivateKeyFromPem(IN CONST UINT8 *PemData, IN UINTN PemSize, IN CONST CHAR8 *Password, OUT VOID **RsaContext)
Definition: CryptPem.c:66
BOOLEAN EFIAPI BigNumSqrMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptBn.c:480
UINTN EFIAPI BigNumBits(IN CONST VOID *Bn)
Definition: CryptBn.c:334
UINTN EFIAPI Sha512GetContextSize(VOID)
Definition: CryptSha512.c:246
BOOLEAN EFIAPI Sha1Final(IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
Definition: CryptSha1.c:163
BOOLEAN EFIAPI Sm3Update(IN OUT VOID *Sm3Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptSm3.c:116
BOOLEAN EFIAPI EcDsaSign(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: CryptEc.c:801
VOID EFIAPI HmacSha384Free(IN VOID *HmacSha384Ctx)
Definition: CryptHmac.c:483
BOOLEAN EFIAPI DhGenerateKey(IN OUT VOID *DhContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptDh.c:196
BOOLEAN EFIAPI X509FormatDateTime(IN CONST CHAR8 *DateTimeStr, OUT VOID *DateTime, IN OUT UINTN *DateTimeSize)
Definition: CryptX509.c:1550
BOOLEAN EFIAPI X509VerifyCert(IN CONST UINT8 *Cert, IN UINTN CertSize, IN CONST UINT8 *CACert, IN UINTN CACertSize)
Definition: CryptX509.c:659
VOID EFIAPI HmacSha256Free(IN VOID *HmacSha256Ctx)
Definition: CryptHmac.c:312
VOID EFIAPI DhFree(IN VOID *DhContext)
Definition: CryptDh.c:42
BOOLEAN EFIAPI Sha512Init(OUT VOID *Sha512Context)
Definition: CryptSha512.c:270
BOOLEAN EFIAPI DhSetParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, IN CONST UINT8 *Prime)
Definition: CryptDh.c:131
BOOLEAN EFIAPI Sm3Final(IN OUT VOID *Sm3Context, OUT UINT8 *HashValue)
Definition: CryptSm3.c:166
BOOLEAN EFIAPI RandomBytes(OUT UINT8 *Output, IN UINTN Size)
Definition: CryptRand.c:76
UINTN EFIAPI AesGetContextSize(VOID)
Definition: CryptAes.c:20
BOOLEAN EFIAPI Sha256Init(OUT VOID *Sha256Context)
Definition: CryptSha256.c:44
VOID *EFIAPI BigNumNewContext(VOID)
Definition: CryptBn.c:509
BOOLEAN EFIAPI X509GetSignatureAlgorithm(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Oid, OPTIONAL IN OUT UINTN *OidSize)
Definition: CryptX509.c:1180
BOOLEAN EFIAPI RsaGetPublicKeyFromX509(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT VOID **RsaContext)
Definition: CryptX509.c:580
RETURN_STATUS EFIAPI X509GetOrganizationName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT CHAR8 *NameBuffer OPTIONAL, IN OUT UINTN *NameBufferSize)
Definition: CryptX509.c:552
VOID EFIAPI X509StackFree(IN VOID *X509Stack)
Definition: CryptX509.c:241
VOID EFIAPI BigNumFree(IN VOID *Bn, IN BOOLEAN Clear)
Definition: CryptBn.c:70
BOOLEAN EFIAPI Pkcs7GetSigners(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT UINT8 **CertStack, OUT UINTN *StackLength, OUT UINT8 **TrustedCert, OUT UINTN *CertLength)
BOOLEAN EFIAPI Sha1Duplicate(IN CONST VOID *Sha1Context, OUT VOID *NewSha1Context)
Definition: CryptSha1.c:78
BOOLEAN EFIAPI ParallelHash256HashAll(IN CONST VOID *Input, IN UINTN InputByteLen, IN UINTN BlockSize, OUT VOID *Output, IN UINTN OutputByteLen, IN CONST VOID *Customization, IN UINTN CustomByteLen)
BOOLEAN EFIAPI AuthenticodeVerify(IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN CONST UINT8 *ImageHash, IN UINTN HashSize)
BOOLEAN EFIAPI X509GetExtendedKeyUsage(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Usage, IN OUT UINTN *UsageSize)
Definition: CryptX509.c:1406
BOOLEAN EFIAPI Sha384HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptSha512.c:201
VOID *EFIAPI EcNewByNid(IN UINTN Nid)
Definition: CryptEc.c:419
BOOLEAN EFIAPI Sha256Final(IN OUT VOID *Sha256Context, OUT UINT8 *HashValue)
Definition: CryptSha256.c:161
BOOLEAN EFIAPI HkdfSha384ExtractAndExpand(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: CryptHkdf.c:345
BOOLEAN EFIAPI Pkcs1v2Encrypt(IN CONST UINT8 *PublicKey, IN UINTN PublicKeySize, IN UINT8 *InData, IN UINTN InDataSize, IN CONST UINT8 *PrngSeed OPTIONAL, IN UINTN PrngSeedSize OPTIONAL, OUT UINT8 **EncryptedData, OUT UINTN *EncryptedDataSize)
BOOLEAN EFIAPI X509GetValidity(IN CONST UINT8 *Cert, IN UINTN CertSize, IN UINT8 *From, IN OUT UINTN *FromSize, IN UINT8 *To, IN OUT UINTN *ToSize)
Definition: CryptX509.c:1442
BOOLEAN EFIAPI HmacSha384Final(IN OUT VOID *HmacSha384Context, OUT UINT8 *HmacValue)
Definition: CryptHmac.c:597
BOOLEAN EFIAPI Sm3HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptSm3.c:206
BOOLEAN EFIAPI BigNumIsWord(IN CONST VOID *Bn, IN UINTN Num)
Definition: CryptBn.c:368
INTN EFIAPI BigNumCmp(IN CONST VOID *BnA, IN CONST VOID *BnB)
Definition: CryptBn.c:317
VOID *EFIAPI EcPointInit(IN CONST VOID *EcGroup)
Definition: CryptEc.c:158
VOID *EFIAPI EcGroupInit(IN UINTN CryptoNid)
Definition: CryptEc.c:68
BOOLEAN EFIAPI Sha384Update(IN OUT VOID *Sha384Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptSha512.c:115
BOOLEAN EFIAPI BigNumAdd(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptBn.c:96
BOOLEAN EFIAPI Sha256Duplicate(IN CONST VOID *Sha256Context, OUT VOID *NewSha256Context)
Definition: CryptSha256.c:76
BOOLEAN EFIAPI HmacSha256SetKey(OUT VOID *HmacSha256Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: CryptHmac.c:335
BOOLEAN EFIAPI EcGetPrivateKeyFromPem(IN CONST UINT8 *PemData, IN UINTN PemSize, IN CONST CHAR8 *Password, OUT VOID **EcContext)
Definition: CryptPem.c:149
BOOLEAN EFIAPI Sm3Init(OUT VOID *Sm3Context)
Definition: CryptSm3.c:44
BOOLEAN EFIAPI HmacSha256Update(IN OUT VOID *HmacSha256Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptHmac.c:387
BOOLEAN EFIAPI DhComputeKey(IN OUT VOID *DhContext, IN CONST UINT8 *PeerPublicKey, IN UINTN PeerPublicKeySize, OUT UINT8 *Key, IN OUT UINTN *KeySize)
Definition: CryptDh.c:265
BOOLEAN EFIAPI Sha1Init(OUT VOID *Sha1Context)
Definition: CryptSha1.c:46
BOOLEAN EFIAPI HkdfSha384Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
Definition: CryptHkdf.c:375
BOOLEAN EFIAPI Sha256HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptSha256.c:199
VOID EFIAPI BigNumConstTime(IN VOID *Bn)
Definition: CryptBn.c:459
CONST VOID *EFIAPI BigNumValueOne(VOID)
Definition: CryptBn.c:420
BOOLEAN EFIAPI Sha512Duplicate(IN CONST VOID *Sha512Context, OUT VOID *NewSha512Context)
Definition: CryptSha512.c:304
BOOLEAN EFIAPI Asn1GetTag(IN OUT UINT8 **Ptr, IN CONST UINT8 *End, OUT UINTN *Length, IN UINT32 Tag)
Definition: CryptX509.c:1884
BOOLEAN EFIAPI RsaGetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, OUT UINT8 *BigNumber, IN OUT UINTN *BnSize)
Definition: CryptRsaExt.c:50
BOOLEAN EFIAPI BigNumSetUint(IN VOID *Bn, IN UINTN Val)
Definition: CryptBn.c:541
VOID EFIAPI BigNumContextFree(IN VOID *BnCtx)
Definition: CryptBn.c:523
BOOLEAN EFIAPI EcPointEqual(IN CONST VOID *EcGroup, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: CryptEc.c:364
BOOLEAN EFIAPI BigNumIsOdd(IN CONST VOID *Bn)
Definition: CryptBn.c:386
BOOLEAN EFIAPI BigNumSub(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptBn.c:119
BOOLEAN EFIAPI RandomSeed(IN CONST UINT8 *Seed OPTIONAL, IN UINTN SeedSize)
Definition: CryptRand.c:36
BOOLEAN EFIAPI RsaOaepEncrypt(IN VOID *RsaContext, IN UINT8 *InData, IN UINTN InDataSize, IN CONST UINT8 *PrngSeed OPTIONAL, IN UINTN PrngSeedSize OPTIONAL, IN UINT16 DigestLen OPTIONAL, OUT UINT8 **EncryptedData, OUT UINTN *EncryptedDataSize)
BOOLEAN EFIAPI RsaOaepDecrypt(IN VOID *RsaContext, IN UINT8 *EncryptedData, IN UINTN EncryptedDataSize, IN UINT16 DigestLen OPTIONAL, OUT UINT8 **OutData, OUT UINTN *OutDataSize)
BOOLEAN EFIAPI RsaSetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, IN CONST UINT8 *BigNumber, IN UINTN BnSize)
Definition: CryptRsaBasic.c:82
BOOLEAN EFIAPI Pkcs7Verify(IN CONST UINT8 *P7Data, IN UINTN P7Length, IN CONST UINT8 *TrustedCert, IN UINTN CertLength, IN CONST UINT8 *InData, IN UINTN DataLength)
RETURN_STATUS EFIAPI VerifyEKUsInPkcs7Signature(IN CONST UINT8 *Pkcs7Signature, IN CONST UINT32 SignatureSize, IN CONST CHAR8 *RequiredEKUs[], IN CONST UINT32 RequiredEKUsSize, IN BOOLEAN RequireAllPresent)
BOOLEAN EFIAPI Sha256Update(IN OUT VOID *Sha256Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptSha256.c:113
VOID *EFIAPI BigNumCopy(OUT VOID *BnDst, IN CONST VOID *BnSrc)
Definition: CryptBn.c:404
BOOLEAN EFIAPI EcGroupGetCurve(IN CONST VOID *EcGroup, OUT VOID *BnPrime, OUT VOID *BnA, OUT VOID *BnB, IN VOID *BnCtx)
Definition: CryptEc.c:100
BOOLEAN EFIAPI HmacSha256All(IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue)
Definition: CryptHmac.c:448
BOOLEAN EFIAPI BigNumAddMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptBn.c:562
BOOLEAN EFIAPI EcGetPublicKeyFromX509(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT VOID **EcContext)
Definition: CryptX509.c:878
BOOLEAN EFIAPI HkdfSha256Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: CryptHkdf.c:315
VOID EFIAPI RsaFree(IN VOID *RsaContext)
Definition: CryptRsaBasic.c:48
BOOLEAN EFIAPI HkdfSha256ExtractAndExpand(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: CryptHkdf.c:249
VOID EFIAPI Pkcs7FreeSigners(IN UINT8 *Certs)
BOOLEAN EFIAPI BigNumMod(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptBn.c:142
BOOLEAN EFIAPI Pkcs7GetAttachedContent(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT VOID **Content, OUT UINTN *ContentSize)
VOID EFIAPI EcPointDeInit(IN VOID *EcPoint, IN BOOLEAN Clear)
Definition: CryptEc.c:173
BOOLEAN EFIAPI EcDsaVerify(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
Definition: CryptEc.c:933
BOOLEAN EFIAPI Sha1HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptSha1.c:201
BOOLEAN EFIAPI ImageTimestampVerify(IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TsaCert, IN UINTN CertSize, OUT EFI_TIME *SigningTime)
Definition: CryptTs.c:555
VOID EFIAPI X509Free(IN VOID *X509Cert)
Definition: CryptX509.c:214
VOID *EFIAPI BigNumInit(VOID)
Definition: CryptBn.c:18
UINTN EFIAPI Sha1GetContextSize(VOID)
Definition: CryptSha1.c:22
BOOLEAN EFIAPI BigNumRShift(IN CONST VOID *Bn, IN UINTN N, OUT VOID *BnRes)
Definition: CryptBn.c:441
BOOLEAN EFIAPI Sha384Final(IN OUT VOID *Sha384Context, OUT UINT8 *HashValue)
Definition: CryptSha512.c:163
BOOLEAN EFIAPI X509ConstructCertificateStackV(IN OUT UINT8 **X509Stack, IN VA_LIST Args)
Definition: CryptX509.c:94
BOOLEAN EFIAPI Pkcs1v2Decrypt(IN CONST UINT8 *PrivateKey, IN UINTN PrivateKeySize, IN UINT8 *EncryptedData, IN UINTN EncryptedDataSize, OUT UINT8 **OutData, OUT UINTN *OutDataSize)
BOOLEAN EFIAPI X509GetCertFromCertChain(IN CONST UINT8 *CertChain, IN UINTN CertChainLength, IN CONST INT32 CertIndex, OUT CONST UINT8 **Cert, OUT UINTN *CertLength)
Definition: CryptX509.c:1792
BOOLEAN EFIAPI EcGroupGetOrder(IN VOID *EcGroup, OUT VOID *BnOrder)
Definition: CryptEc.c:125
UINTN EFIAPI BigNumBytes(IN CONST VOID *Bn)
Definition: CryptBn.c:350
BOOLEAN EFIAPI X509GetSubjectName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *CertSubject, IN OUT UINTN *SubjectSize)
Definition: CryptX509.c:277
BOOLEAN EFIAPI AeadAesGcmEncrypt(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Iv, IN UINTN IvSize, IN CONST UINT8 *AData, IN UINTN ADataSize, IN CONST UINT8 *DataIn, IN UINTN DataInSize, OUT UINT8 *TagOut, IN UINTN TagSize, OUT UINT8 *DataOut, OUT UINTN *DataOutSize)
BOOLEAN EFIAPI RsaPssVerify(IN VOID *RsaContext, IN CONST UINT8 *Message, IN UINTN MsgSize, IN CONST UINT8 *Signature, IN UINTN SigSize, IN UINT16 DigestLen, IN UINT16 SaltLen)
Definition: CryptRsaPss.c:67
BOOLEAN EFIAPI EcDhComputeKey(IN OUT VOID *EcContext, IN CONST UINT8 *PeerPublic, IN UINTN PeerPublicSize, IN CONST INT32 *CompressFlag, OUT UINT8 *Key, IN OUT UINTN *KeySize)
Definition: CryptEc.c:667
BOOLEAN EFIAPI Sha384Init(OUT VOID *Sha384Context)
Definition: CryptSha512.c:44
BOOLEAN EFIAPI X509GetKeyUsage(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Usage)
Definition: CryptX509.c:1639
BOOLEAN EFIAPI Pkcs7GetCertificatesList(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT UINT8 **SignerChainCerts, OUT UINTN *ChainLength, OUT UINT8 **UnchainCerts, OUT UINTN *UnchainLength)
VOID EFIAPI EcGroupFree(IN VOID *EcGroup)
Definition: CryptEc.c:140
BOOLEAN EFIAPI AesCbcEncrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: CryptAes.c:112
BOOLEAN EFIAPI RsaPkcs1Verify(IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
BOOLEAN EFIAPI X509GetTBSCert(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **TBSCert, OUT UINTN *TBSCertSize)
Definition: CryptX509.c:798
BOOLEAN EFIAPI X509GetExtendedBasicConstraints(CONST UINT8 *Cert, UINTN CertSize, UINT8 *BasicConstraints, UINTN *BasicConstraintsSize)
Definition: CryptX509.c:1938
BOOLEAN EFIAPI Sha512Update(IN OUT VOID *Sha512Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptSha512.c:341
RETURN_STATUS EFIAPI X509GetCommonName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT CHAR8 *CommonName OPTIONAL, IN OUT UINTN *CommonNameSize)
Definition: CryptX509.c:514
BOOLEAN EFIAPI HmacSha256Final(IN OUT VOID *HmacSha256Context, OUT UINT8 *HmacValue)
Definition: CryptHmac.c:418
BOOLEAN EFIAPI HkdfSha384Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: CryptHkdf.c:411
BOOLEAN EFIAPI EcPointGetAffineCoordinates(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, OUT VOID *BnX, OUT VOID *BnY, IN VOID *BnCtx)
Definition: CryptEc.c:202
BOOLEAN EFIAPI Sha1Update(IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptSha1.c:115
BOOLEAN EFIAPI EcPointSetAffineCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN CONST VOID *BnY, IN VOID *BnCtx)
Definition: CryptEc.c:227
INTN EFIAPI BigNumToBin(IN CONST VOID *Bn, OUT UINT8 *Buf)
Definition: CryptBn.c:54
BOOLEAN EFIAPI RsaGenerateKey(IN OUT VOID *RsaContext, IN UINTN ModulusLength, IN CONST UINT8 *PublicExponent, IN UINTN PublicExponentSize)
Definition: CryptRsaExt.c:179
BOOLEAN EFIAPI X509VerifyCertChain(IN CONST UINT8 *RootCert, IN UINTN RootCertLength, IN CONST UINT8 *CertChain, IN UINTN CertChainLength)
Definition: CryptX509.c:1705
BOOLEAN EFIAPI X509ConstructCertificate(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **SingleX509Cert)
Definition: CryptX509.c:43
BOOLEAN EFIAPI RsaPkcs1Sign(IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: CryptRsaExt.c:297
VOID EFIAPI EcFree(IN VOID *EcContext)
Definition: CryptEc.c:440
BOOLEAN EFIAPI AesCbcDecrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: CryptAes.c:174
BOOLEAN EFIAPI CryptoServiceSha512Update(IN OUT VOID *Sha512Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:1249
BOOLEAN EFIAPI CryptoServiceBigNumMod(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: Crypto.c:5844
BOOLEAN EFIAPI CryptoServiceAuthenticodeVerify(IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN CONST UINT8 *ImageHash, IN UINTN HashSize)
Definition: Crypto.c:3993
UINT16 EFIAPI CryptoServiceTlsGetVersion(IN VOID *Tls)
Definition: Crypto.c:5174
BOOLEAN EFIAPI CryptoServiceX509GetTBSCert(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **TBSCert, OUT UINTN *TBSCertSize)
Definition: Crypto.c:3079
BOOLEAN EFIAPI CryptoServiceParallelHash256HashAll(IN CONST VOID *Input, IN UINTN InputByteLen, IN UINTN BlockSize, OUT VOID *Output, IN UINTN OutputByteLen, IN CONST VOID *Customization, IN UINTN CustomByteLen)
Definition: Crypto.c:5611
UINTN EFIAPI CryptoServiceBigNumBytes(IN CONST VOID *Bn)
Definition: Crypto.c:5994
VOID EFIAPI DeprecatedCryptoServiceHmacSha1Free(IN VOID *HmacSha1Ctx)
Definition: Crypto.c:1612
BOOLEAN EFIAPI CryptoServiceAesCbcEncrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: Crypto.c:2334
BOOLEAN EFIAPI CryptoServiceBigNumAddMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: Crypto.c:6195
UINTN EFIAPI CryptoServiceSm3GetContextSize(VOID)
Definition: Crypto.c:1325
BOOLEAN EFIAPI CryptoServiceEcPointGetAffineCoordinates(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, OUT VOID *BnX, OUT VOID *BnY, IN VOID *BnCtx)
Definition: Crypto.c:6343
BOOLEAN EFIAPI CryptoServiceDhGenerateKey(IN OUT VOID *DhContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: Crypto.c:4173
BOOLEAN EFIAPI CryptoServiceSha512Final(IN OUT VOID *Sha512Context, OUT UINT8 *HashValue)
Definition: Crypto.c:1280
BOOLEAN EFIAPI CryptoServiceBigNumSqrMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: Crypto.c:6124
VOID EFIAPI CryptoServiceX509Free(IN VOID *X509Cert)
Definition: Crypto.c:3036
BOOLEAN EFIAPI CryptoServiceX509VerifyCertChain(IN CONST UINT8 *RootCert, IN UINTN RootCertLength, IN CONST UINT8 *CertChain, IN UINTN CertChainLength)
Definition: Crypto.c:3410
INTN EFIAPI CryptoServiceTlsCtrlTrafficOut(IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
Definition: Crypto.c:4695
BOOLEAN EFIAPI CryptoServiceEcPointIsOnCurve(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, IN VOID *BnCtx)
Definition: Crypto.c:6463
INTN EFIAPI CryptoServiceBigNumToBin(IN CONST VOID *Bn, OUT UINT8 *Buf)
Definition: Crypto.c:5760
BOOLEAN EFIAPI CryptoServiceSha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context)
Definition: Crypto.c:1072
EFI_STATUS EFIAPI CryptoServiceTlsSetHostPublicCert(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:5016
BOOLEAN EFIAPI CryptoServiceBigNumSetUint(IN VOID *Bn, IN UINTN Val)
Definition: Crypto.c:6174
BOOLEAN EFIAPI CryptoServiceSha1Final(IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
Definition: Crypto.c:831
EFI_STATUS EFIAPI CryptoServiceTlsSetVersion(IN VOID *Tls, IN UINT8 MajorVer, IN UINT8 MinorVer)
Definition: Crypto.c:4819
EFI_STATUS EFIAPI CryptoServiceTlsHandleAlert(IN VOID *Tls, IN UINT8 *BufferIn OPTIONAL, IN UINTN BufferInSize OPTIONAL, OUT UINT8 *BufferOut OPTIONAL, IN OUT UINTN *BufferOutSize)
Definition: Crypto.c:4639
BOOLEAN EFIAPI CryptoServiceX509GetSignatureAlgorithm(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Oid, OPTIONAL IN OUT UINTN *OidSize)
Definition: Crypto.c:3202
VOID *EFIAPI CryptoServiceTlsNew(IN VOID *TlsCtx)
Definition: Crypto.c:4546
BOOLEAN EFIAPI CryptoServiceEcPointMul(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPoint, IN CONST VOID *BnPScalar, IN VOID *BnCtx)
Definition: Crypto.c:6419
BOOLEAN EFIAPI CryptoServiceHmacSha256Duplicate(IN CONST VOID *HmacSha256Context, OUT VOID *NewHmacSha256Context)
Definition: Crypto.c:1779
INT32 EFIAPI CryptoServiceX509CompareDateTime(IN CONST VOID *DateTime1, IN CONST VOID *DateTime2)
Definition: Crypto.c:3362
BOOLEAN EFIAPI CryptoServicePkcs1v2Encrypt(IN CONST UINT8 *PublicKey, IN UINTN PublicKeySize, IN UINT8 *InData, IN UINTN InDataSize, IN CONST UINT8 *PrngSeed OPTIONAL, IN UINTN PrngSeedSize OPTIONAL, OUT UINT8 **EncryptedData, OUT UINTN *EncryptedDataSize)
Definition: Crypto.c:3578
EFI_STATUS EFIAPI CryptoServiceTlsGetKeyMaterial(IN VOID *Tls, IN OUT UINT8 *KeyMaterial)
Definition: Crypto.c:5359
BOOLEAN EFIAPI CryptoServiceAeadAesGcmEncrypt(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Iv, IN UINTN IvSize, IN CONST UINT8 *AData, IN UINTN ADataSize, IN CONST UINT8 *DataIn, IN UINTN DataInSize, OUT UINT8 *TagOut, IN UINTN TagSize, OUT UINT8 *DataOut, OUT UINTN *DataOutSize)
Definition: Crypto.c:5650
EFI_STATUS EFIAPI CryptoServiceTlsGetCurrentCompressionId(IN VOID *Tls, IN OUT UINT8 *CompressionId)
Definition: Crypto.c:5245
VOID EFIAPI CryptoServiceX509StackFree(IN VOID *X509Stack)
Definition: Crypto.c:3053
EFI_STATUS EFIAPI CryptoServiceTlsSetCaCertificate(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:4988
EFI_STATUS EFIAPI CryptoServiceTlsSetSignatureAlgoList(IN VOID *Tls, IN UINT8 *Data, IN UINTN DataSize)
Definition: Crypto.c:5125
UINTN EFIAPI CryptoServiceGetCryptoVersion(VOID)
Definition: Crypto.c:115
BOOLEAN EFIAPI CryptoServiceHmacSha384Final(IN OUT VOID *HmacSha384Context, OUT UINT8 *HmacValue)
Definition: Crypto.c:2021
EFI_STATUS EFIAPI CryptoServiceTlsGetCurrentCipher(IN VOID *Tls, IN OUT UINT16 *CipherId)
Definition: Crypto.c:5219
VOID *EFIAPI CryptoServiceBigNumNewContext(VOID)
Definition: Crypto.c:6142
BOOLEAN EFIAPI CryptoServiceDhComputeKey(IN OUT VOID *DhContext, IN CONST UINT8 *PeerPublicKey, IN UINTN PeerPublicKeySize, OUT UINT8 *Key, IN OUT UINTN *KeySize)
Definition: Crypto.c:4210
BOOLEAN EFIAPI CryptoServiceRsaGetPublicKeyFromX509(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT VOID **RsaContext)
Definition: Crypto.c:2790
BOOLEAN EFIAPI CryptoServiceRsaPssSign(IN VOID *RsaContext, IN CONST UINT8 *Message, IN UINTN MsgSize, IN UINT16 DigestLen, IN UINT16 SaltLen, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: Crypto.c:5546
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacSha1SetKey(OUT VOID *HmacSha1Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: Crypto.c:1632
EFI_STATUS EFIAPI CryptoServiceTlsSetSessionId(IN VOID *Tls, IN UINT8 *SessionId, IN UINT16 SessionIdLen)
Definition: Crypto.c:4960
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacSha1Duplicate(IN CONST VOID *HmacSha1Context, OUT VOID *NewHmacSha1Context)
Definition: Crypto.c:1653
BOOLEAN EFIAPI CryptoServiceSha384HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: Crypto.c:1159
VOID EFIAPI CryptoServiceBigNumContextFree(IN VOID *BnCtx)
Definition: Crypto.c:6156
BOOLEAN EFIAPI DeprecatedCryptoServiceArc4Decrypt(IN OUT VOID *Arc4Context, IN UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output)
Definition: Crypto.c:2463
BOOLEAN EFIAPI CryptoServiceX509FormatDateTime(IN CONST CHAR8 *DateTimeStr, OUT VOID *DateTime, IN OUT UINTN *DateTimeSize)
Definition: Crypto.c:3335
VOID *EFIAPI CryptoServiceEcGroupInit(IN UINTN CryptoNid)
Definition: Crypto.c:6222
VOID EFIAPI CryptoServiceTlsGetClientRandom(IN VOID *Tls, IN OUT UINT8 *ClientRandom)
Definition: Crypto.c:5314
EFI_STATUS EFIAPI CryptoServiceTlsSetVerifyHost(IN VOID *Tls, IN UINT32 Flags, IN CHAR8 *HostName)
Definition: Crypto.c:4934
VOID *EFIAPI CryptoServiceBigNumCopy(OUT VOID *BnDst, IN CONST VOID *BnSrc)
Definition: Crypto.c:6048
BOOLEAN EFIAPI CryptoServiceHkdfSha384Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
Definition: Crypto.c:4417
BOOLEAN EFIAPI CryptoServiceHkdfSha384Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: Crypto.c:4445
UINTN EFIAPI CryptoServiceSha1GetContextSize(VOID)
Definition: Crypto.c:721
BOOLEAN EFIAPI CryptoServiceHmacSha384All(IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue)
Definition: Crypto.c:2051
EFI_STATUS EFIAPI CryptoServiceTlsSetCertRevocationList(IN VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:5098
VOID EFIAPI CryptoServiceTlsSetVerify(IN VOID *Tls, IN UINT32 VerifyMode)
Definition: Crypto.c:4912
UINTN EFIAPI CryptoServiceSha384GetContextSize(VOID)
Definition: Crypto.c:1027
VOID EFIAPI CryptoServicePkcs7FreeSigners(IN UINT8 *Certs)
Definition: Crypto.c:3767
VOID EFIAPI CryptoServiceRsaFree(IN VOID *RsaContext)
Definition: Crypto.c:2521
BOOLEAN EFIAPI CryptoServiceRsaGenerateKey(IN OUT VOID *RsaContext, IN UINTN ModulusLength, IN CONST UINT8 *PublicExponent, IN UINTN PublicExponentSize)
Definition: Crypto.c:2627
EFI_STATUS EFIAPI CryptoServiceTlsGetCaCertificate(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: Crypto.c:5385
BOOLEAN EFIAPI DeprecatedCryptoServiceMd4Update(IN OUT VOID *Md4Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:193
BOOLEAN EFIAPI CryptoServiceSm3Init(OUT VOID *Sm3Context)
Definition: Crypto.c:1346
BOOLEAN EFIAPI CryptoServicePkcs7GetCertificatesList(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT UINT8 **SignerChainCerts, OUT UINTN *ChainLength, OUT UINT8 **UnchainCerts, OUT UINTN *UnchainLength)
Definition: Crypto.c:3798
BOOLEAN EFIAPI CryptoServiceEcGetPrivateKeyFromPem(IN CONST UINT8 *PemData, IN UINTN PemSize, IN CONST CHAR8 *Password, OUT VOID **EcContext)
Definition: Crypto.c:6726
BOOLEAN EFIAPI CryptoServiceRsaGetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, OUT UINT8 *BigNumber, IN OUT UINTN *BnSize)
Definition: Crypto.c:2592
VOID *EFIAPI CryptoServiceEcPointInit(IN CONST VOID *EcGroup)
Definition: Crypto.c:6303
INTN EFIAPI CryptoServiceTlsCtrlTrafficIn(IN VOID *Tls, IN VOID *Buffer, IN UINTN BufferSize)
Definition: Crypto.c:4720
EFI_STATUS EFIAPI CryptoServiceTlsSetCompressionMethod(IN UINT8 CompMethod)
Definition: Crypto.c:4894
BOOLEAN EFIAPI DeprecatedCryptoServiceMd4HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: Crypto.c:237
BOOLEAN EFIAPI CryptoServiceTlsInitialize(VOID)
Definition: Crypto.c:4470
EFI_STATUS EFIAPI CryptoServiceTlsDoHandshake(IN VOID *Tls, IN UINT8 *BufferIn OPTIONAL, IN UINTN BufferInSize OPTIONAL, OUT UINT8 *BufferOut OPTIONAL, IN OUT UINTN *BufferOutSize)
Definition: Crypto.c:4601
BOOLEAN EFIAPI DeprecatedCryptoServiceTdesInit(OUT VOID *TdesContext, IN CONST UINT8 *Key, IN UINTN KeyLength)
Definition: Crypto.c:2095
BOOLEAN EFIAPI CryptoServiceX509GetCertFromCertChain(IN CONST UINT8 *CertChain, IN UINTN CertChainLength, IN CONST INT32 CertIndex, OUT CONST UINT8 **Cert, OUT UINTN *CertLength)
Definition: Crypto.c:3440
BOOLEAN EFIAPI CryptoServiceRsaOaepDecrypt(IN VOID *RsaContext, IN UINT8 *EncryptedData, IN UINTN EncryptedDataSize, IN UINT16 DigestLen OPTIONAL, OUT UINT8 **OutData, OUT UINTN *OutDataSize)
Definition: Crypto.c:3705
BOOLEAN EFIAPI DeprecatedCryptoServiceMd5Update(IN OUT VOID *Md5Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:329
BOOLEAN EFIAPI CryptoServiceSha1Init(OUT VOID *Sha1Context)
Definition: Crypto.c:744
BOOLEAN EFIAPI CryptoServiceEcPointEqual(IN CONST VOID *EcGroup, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: Crypto.c:6504
UINTN EFIAPI DeprecatedCryptoServiceMd4GetContextSize(VOID)
Definition: Crypto.c:135
VOID *EFIAPI CryptoServiceTlsCtxNew(IN UINT8 MajorVer, IN UINT8 MinorVer)
Definition: Crypto.c:4505
BOOLEAN EFIAPI CryptoServiceBigNumIsWord(IN CONST VOID *Bn, IN UINTN Num)
Definition: Crypto.c:6012
BOOLEAN EFIAPI DeprecatedCryptoServiceMd5HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: Crypto.c:386
BOOLEAN EFIAPI CryptoServiceSha1HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: Crypto.c:859
BOOLEAN EFIAPI CryptoServiceHmacSha384Update(IN OUT VOID *HmacSha384Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:1988
EFI_STATUS EFIAPI CryptoServiceTlsGetSessionId(IN VOID *Tls, IN OUT UINT8 *SessionId, IN OUT UINT16 *SessionIdLen)
Definition: Crypto.c:5292
VOID EFIAPI CryptoServiceTlsCtxFree(IN VOID *TlsCtx)
Definition: Crypto.c:4485
BOOLEAN EFIAPI DeprecatedCryptoServiceAesEcbEncrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output)
Definition: Crypto.c:2269
BOOLEAN EFIAPI CryptoServiceSha384Update(IN OUT VOID *Sha384Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:1100
BOOLEAN EFIAPI DeprecatedCryptoServiceTdesCbcDecrypt(IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: Crypto.c:2193
BOOLEAN EFIAPI DeprecatedCryptoServiceArc4Init(OUT VOID *Arc4Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: Crypto.c:2416
BOOLEAN EFIAPI DeprecatedCryptoServiceAesEcbDecrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output)
Definition: Crypto.c:2293
VOID EFIAPI CryptoServiceTlsFree(IN VOID *Tls)
Definition: Crypto.c:4524
BOOLEAN EFIAPI CryptoServiceX509ConstructCertificateStackV(IN OUT UINT8 **X509Stack, IN VA_LIST Args)
Definition: Crypto.c:2984
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacMd5Final(IN OUT VOID *HmacMd5Context, OUT UINT8 *HmacValue)
Definition: Crypto.c:1579
BOOLEAN EFIAPI CryptoServiceHmacSha256All(IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue)
Definition: Crypto.c:1872
BOOLEAN EFIAPI DeprecatedCryptoServiceTdesCbcEncrypt(IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: Crypto.c:2167
BOOLEAN EFIAPI CryptoServiceAesCbcDecrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: Crypto.c:2376
VOID *EFIAPI DeprecatedCryptoServiceHmacSha1New(VOID)
Definition: Crypto.c:1596
BOOLEAN EFIAPI CryptoServiceX509GetExtendedKeyUsage(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Usage, IN OUT UINTN *UsageSize)
Definition: Crypto.c:3265
VOID *EFIAPI CryptoServiceDhNew(VOID)
Definition: Crypto.c:4052
BOOLEAN EFIAPI CryptoServiceSm3Update(IN OUT VOID *Sm3Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:1398
BOOLEAN EFIAPI CryptoServiceHmacSha256SetKey(OUT VOID *HmacSha256Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: Crypto.c:1753
BOOLEAN EFIAPI CryptoServiceEcPointIsAtInfinity(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint)
Definition: Crypto.c:6483
UINT8 EFIAPI CryptoServiceTlsGetConnectionEnd(IN VOID *Tls)
Definition: Crypto.c:5196
BOOLEAN EFIAPI CryptoServiceX509GetIssuerName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *CertIssuer, IN OUT UINTN *CertIssuerSize)
Definition: Crypto.c:3172
BOOLEAN EFIAPI CryptoServiceRsaPkcs1Verify(IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
Definition: Crypto.c:2728
BOOLEAN EFIAPI CryptoServiceRsaPkcs1Sign(IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: Crypto.c:2696
BOOLEAN EFIAPI CryptoServiceSha384Final(IN OUT VOID *Sha384Context, OUT UINT8 *HashValue)
Definition: Crypto.c:1131
VOID *EFIAPI CryptoServiceRsaNew(VOID)
Definition: Crypto.c:2504
BOOLEAN EFIAPI CryptoServiceImageTimestampVerify(IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TsaCert, IN UINTN CertSize, OUT EFI_TIME *SigningTime)
Definition: Crypto.c:4027
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacMd5Duplicate(IN CONST VOID *HmacMd5Context, OUT VOID *NewHmacMd5Context)
Definition: Crypto.c:1536
BOOLEAN EFIAPI CryptoServicePkcs7GetAttachedContent(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT VOID **Content, OUT UINTN *ContentSize)
Definition: Crypto.c:3957
BOOLEAN EFIAPI CryptoServiceSm3HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: Crypto.c:1457
BOOLEAN EFIAPI CryptoServiceHkdfSha256ExtractAndExpand(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: Crypto.c:4299
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacMd5SetKey(OUT VOID *HmacMd5Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: Crypto.c:1515
BOOLEAN EFIAPI CryptoServiceX509GetSubjectName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *CertSubject, IN OUT UINTN *SubjectSize)
Definition: Crypto.c:2820
BOOLEAN EFIAPI CryptoServiceRandomSeed(IN CONST UINT8 *Seed OPTIONAL, IN UINTN SeedSize)
Definition: Crypto.c:4245
#define CALL_VOID_BASECRYPTLIB(Enable, Function, Args)
Definition: Crypto.c:61
BOOLEAN EFIAPI CryptoServiceEcDhComputeKey(IN OUT VOID *EcContext, IN CONST UINT8 *PeerPublic, IN UINTN PeerPublicSize, IN CONST INT32 *CompressFlag, OUT UINT8 *Key, IN OUT UINTN *KeySize)
Definition: Crypto.c:6668
BOOLEAN EFIAPI CryptoServiceSha256Init(OUT VOID *Sha256Context)
Definition: Crypto.c:899
VOID EFIAPI CryptoServiceEcGroupFree(IN VOID *EcGroup)
Definition: Crypto.c:6285
BOOLEAN EFIAPI CryptoServiceEcGenerateKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: Crypto.c:6607
BOOLEAN EFIAPI CryptoServiceEcPointSetAffineCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN CONST VOID *BnY, IN VOID *BnCtx)
Definition: Crypto.c:6368
EFI_STATUS EFIAPI CryptoServiceTlsSetEcCurve(IN VOID *Tls, IN UINT8 *Data, IN UINTN DataSize)
Definition: Crypto.c:5150
BOOLEAN EFIAPI CryptoServiceSm3Final(IN OUT VOID *Sm3Context, OUT UINT8 *HashValue)
Definition: Crypto.c:1429
UINTN EFIAPI DeprecatedCryptoServiceMd5GetContextSize(VOID)
Definition: Crypto.c:258
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacSha1Update(IN OUT VOID *HmacSha1Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:1674
VOID EFIAPI CryptoServiceEcPointDeInit(IN VOID *EcPoint, IN BOOLEAN Clear)
Definition: Crypto.c:6318
BOOLEAN EFIAPI CryptoServiceSha1Duplicate(IN CONST VOID *Sha1Context, OUT VOID *NewSha1Context)
Definition: Crypto.c:768
BOOLEAN EFIAPI DeprecatedCryptoServiceMd5Duplicate(IN CONST VOID *Md5Context, OUT VOID *NewMd5Context)
Definition: Crypto.c:301
BOOLEAN EFIAPI CryptoServiceSha1Update(IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:798
EFI_STATUS EFIAPI CryptoServiceTlsCloseNotify(IN VOID *Tls, IN OUT UINT8 *Buffer, IN OUT UINTN *BufferSize)
Definition: Crypto.c:4670
BOOLEAN EFIAPI CryptoServiceBigNumMulMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: Crypto.c:5939
EFI_STATUS EFIAPI CryptoServiceTlsSetCipherList(IN VOID *Tls, IN UINT16 *CipherId, IN UINTN CipherNum)
Definition: Crypto.c:4871
BOOLEAN EFIAPI CryptoServiceSha512HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: Crypto.c:1308
BOOLEAN EFIAPI CryptoServiceEcGroupGetCurve(IN CONST VOID *EcGroup, OUT VOID *BnPrime, OUT VOID *BnA, OUT VOID *BnB, IN VOID *BnCtx)
Definition: Crypto.c:6245
EFI_STATUS EFIAPI CryptoServiceTlsShutdown(IN VOID *Tls)
Definition: Crypto.c:4796
BOOLEAN EFIAPI DeprecatedCryptoServiceTdesEcbDecrypt(IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output)
Definition: Crypto.c:2142
BOOLEAN EFIAPI CryptoServiceX509ConstructCertificateStack(IN OUT UINT8 **X509Stack,...)
Definition: Crypto.c:3012
VOID EFIAPI CryptoServiceDhFree(IN VOID *DhContext)
Definition: Crypto.c:4069
VOID EFIAPI CryptoServiceBigNumConstTime(IN VOID *Bn)
Definition: Crypto.c:6103
BOOLEAN EFIAPI CryptoServicePkcs5HashPassword(IN UINTN PasswordLength, IN CONST CHAR8 *Password, IN UINTN SaltLength, IN CONST UINT8 *Salt, IN UINTN IterationCount, IN UINTN DigestSize, IN UINTN KeyLength, OUT UINT8 *OutKey)
Definition: Crypto.c:3533
UINTN EFIAPI CryptoServiceSha256GetContextSize(VOID)
Definition: Crypto.c:878
BOOLEAN EFIAPI CryptoServiceEcGetPublicKeyFromX509(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT VOID **EcContext)
Definition: Crypto.c:6698
BOOLEAN EFIAPI DeprecatedCryptoServiceMd5Init(OUT VOID *Md5Context)
Definition: Crypto.c:279
BOOLEAN EFIAPI DeprecatedCryptoServiceMd4Init(OUT VOID *Md4Context)
Definition: Crypto.c:153
RETURN_STATUS EFIAPI CryptoServiceVerifyEKUsInPkcs7Signature(IN CONST UINT8 *Pkcs7Signature, IN CONST UINT32 SignatureSize, IN CONST CHAR8 *RequiredEKUs[], IN CONST UINT32 RequiredEKUsSize, IN BOOLEAN RequireAllPresent)
Definition: Crypto.c:3924
BOOLEAN EFIAPI DeprecatedCryptoServiceMd4Duplicate(IN CONST VOID *Md4Context, OUT VOID *NewMd4Context)
Definition: Crypto.c:172
EFI_STATUS EFIAPI CryptoServiceTlsGetHostPrivateKey(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: Crypto.c:5440
BOOLEAN EFIAPI CryptoServiceHkdfSha384ExtractAndExpand(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: Crypto.c:4387
EFI_STATUS EFIAPI CryptoServiceTlsGetCertRevocationList(OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: Crypto.c:5466
BOOLEAN EFIAPI CryptoServicePkcs7GetSigners(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT UINT8 **CertStack, OUT UINTN *StackLength, OUT UINT8 **TrustedCert, OUT UINTN *CertLength)
Definition: Crypto.c:3745
VOID *EFIAPI CryptoServiceEcNewByNid(IN UINTN Nid)
Definition: Crypto.c:6558
BOOLEAN EFIAPI DeprecatedCryptoServiceMd4Final(IN OUT VOID *Md4Context, OUT UINT8 *HashValue)
Definition: Crypto.c:215
VOID EFIAPI CryptoServiceHmacSha384Free(IN VOID *HmacSha384Ctx)
Definition: Crypto.c:1907
BOOLEAN EFIAPI CryptoServiceSha256Update(IN OUT VOID *Sha256Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:951
BOOLEAN EFIAPI CryptoServiceSm3Duplicate(IN CONST VOID *Sm3Context, OUT VOID *NewSm3Context)
Definition: Crypto.c:1370
UINTN EFIAPI DeprecatedCryptoServiceArc4GetContextSize(VOID)
Definition: Crypto.c:2396
BOOLEAN EFIAPI CryptoServicePkcs7Sign(IN CONST UINT8 *PrivateKey, IN UINTN PrivateKeySize, IN CONST UINT8 *KeyPassword, IN UINT8 *InData, IN UINTN InDataSize, IN UINT8 *SignCert, IN UINT8 *OtherCerts OPTIONAL, OUT UINT8 **SignedData, OUT UINTN *SignedDataSize)
Definition: Crypto.c:3839
VOID *EFIAPI CryptoServiceHmacSha256New(VOID)
Definition: Crypto.c:1713
BOOLEAN EFIAPI CryptoServicePkcs1v2Decrypt(IN CONST UINT8 *PrivateKey, IN UINTN PrivateKeySize, IN UINT8 *EncryptedData, IN UINTN EncryptedDataSize, OUT UINT8 **OutData, OUT UINTN *OutDataSize)
Definition: Crypto.c:3664
VOID *EFIAPI DeprecatedCryptoServiceHmacMd5New(VOID)
Definition: Crypto.c:1479
BOOLEAN EFIAPI CryptoServicePkcs7Verify(IN CONST UINT8 *P7Data, IN UINTN P7Length, IN CONST UINT8 *TrustedCert, IN UINTN CertLength, IN CONST UINT8 *InData, IN UINTN DataLength)
Definition: Crypto.c:3878
BOOLEAN EFIAPI CryptoServiceX509GetSerialNumber(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *SerialNumber, OPTIONAL IN OUT UINTN *SerialNumberSize)
Definition: Crypto.c:3141
BOOLEAN EFIAPI CryptoServiceHmacSha384Duplicate(IN CONST VOID *HmacSha384Context, OUT VOID *NewHmacSha384Context)
Definition: Crypto.c:1958
BOOLEAN EFIAPI CryptoServiceEcPointSetCompressedCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN UINT8 YBit, IN VOID *BnCtx)
Definition: Crypto.c:6533
BOOLEAN EFIAPI CryptoServiceAesInit(OUT VOID *AesContext, IN CONST UINT8 *Key, IN UINTN KeyLength)
Definition: Crypto.c:2246
BOOLEAN EFIAPI CryptoServiceX509GetVersion(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Version)
Definition: Crypto.c:3107
VOID EFIAPI DeprecatedCryptoServiceHmacMd5Free(IN VOID *HmacMd5Ctx)
Definition: Crypto.c:1495
BOOLEAN EFIAPI CryptoServiceRsaPssVerify(IN VOID *RsaContext, IN CONST UINT8 *Message, IN UINTN MsgSize, IN CONST UINT8 *Signature, IN UINTN SigSize, IN UINT16 DigestLen, IN UINT16 SaltLen)
Definition: Crypto.c:5579
BOOLEAN EFIAPI CryptoServiceBigNumSub(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: Crypto.c:5821
INTN EFIAPI CryptoServiceTlsRead(IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
Definition: Crypto.c:4746
BOOLEAN EFIAPI CryptoServiceX509GetExtendedBasicConstraints(CONST UINT8 *Cert, UINTN CertSize, UINT8 *BasicConstraints, UINTN *BasicConstraintsSize)
Definition: Crypto.c:3494
VOID *EFIAPI CryptoServiceHmacSha384New(VOID)
Definition: Crypto.c:1892
BOOLEAN EFIAPI CryptoServiceX509ConstructCertificate(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **SingleX509Cert)
Definition: Crypto.c:2954
BOOLEAN EFIAPI CryptoServiceHmacSha384SetKey(OUT VOID *HmacSha384Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: Crypto.c:1932
UINT32 EFIAPI CryptoServiceTlsGetVerify(IN VOID *Tls)
Definition: Crypto.c:5268
UINTN EFIAPI CryptoServiceSha512GetContextSize(VOID)
Definition: Crypto.c:1176
BOOLEAN EFIAPI CryptoServiceHkdfSha256Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: Crypto.c:4357
BOOLEAN EFIAPI DeprecatedCryptoServiceArc4Reset(IN OUT VOID *Arc4Context)
Definition: Crypto.c:2484
EFI_STATUS EFIAPI CryptoServiceTlsSetHostPrivateKeyEx(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize, IN VOID *Password OPTIONAL)
Definition: Crypto.c:5045
BOOLEAN EFIAPI CryptoServiceBigNumAdd(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: Crypto.c:5798
BOOLEAN EFIAPI CryptoServiceBigNumInverseMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: Crypto.c:5892
VOID EFIAPI CryptoServiceEcFree(IN VOID *EcContext)
Definition: Crypto.c:6572
BOOLEAN EFIAPI CryptoServiceHmacSha256Update(IN OUT VOID *HmacSha256Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:1809
BOOLEAN EFIAPI CryptoServiceEcGetPubKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: Crypto.c:6632
BOOLEAN EFIAPI CryptoServiceSha512Duplicate(IN CONST VOID *Sha512Context, OUT VOID *NewSha512Context)
Definition: Crypto.c:1221
BOOLEAN EFIAPI CryptoServiceEcPointAdd(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: Crypto.c:6393
RETURN_STATUS EFIAPI CryptoServiceX509GetOrganizationName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT CHAR8 *NameBuffer OPTIONAL, IN OUT UINTN *NameBufferSize)
Definition: Crypto.c:2896
BOOLEAN EFIAPI DeprecatedCryptoServiceArc4Encrypt(IN OUT VOID *Arc4Context, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output)
Definition: Crypto.c:2439
UINTN EFIAPI CryptoServiceBigNumBits(IN CONST VOID *Bn)
Definition: Crypto.c:5978
VOID *EFIAPI CryptoServiceBigNumInit(VOID)
Definition: Crypto.c:5724
EFI_STATUS EFIAPI CryptoServiceTlsSetConnectionEnd(IN VOID *Tls, IN BOOLEAN IsServer)
Definition: Crypto.c:4843
BOOLEAN EFIAPI CryptoServiceSha256Duplicate(IN CONST VOID *Sha256Context, OUT VOID *NewSha256Context)
Definition: Crypto.c:923
BOOLEAN EFIAPI CryptoServiceBigNumExpMod(IN CONST VOID *BnA, IN CONST VOID *BnP, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: Crypto.c:5868
BOOLEAN EFIAPI CryptoServiceRsaCheckKey(IN VOID *RsaContext)
Definition: Crypto.c:2660
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacMd5Update(IN OUT VOID *HmacMd5Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:1557
BOOLEAN EFIAPI CryptoServiceRandomBytes(OUT UINT8 *Output, IN UINTN Size)
Definition: Crypto.c:4269
BOOLEAN EFIAPI CryptoServiceEcDsaVerify(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
Definition: Crypto.c:6804
VOID EFIAPI CryptoServiceHmacSha256Free(IN VOID *HmacSha256Ctx)
Definition: Crypto.c:1728
BOOLEAN EFIAPI CryptoServiceTlsInHandshake(IN VOID *Tls)
Definition: Crypto.c:4566
BOOLEAN EFIAPI CryptoServiceBigNumRShift(IN CONST VOID *Bn, IN UINTN N, OUT VOID *BnRes)
Definition: Crypto.c:6085
INTN EFIAPI CryptoServiceTlsWrite(IN VOID *Tls, IN VOID *Buffer, IN UINTN BufferSize)
Definition: Crypto.c:4772
BOOLEAN EFIAPI CryptoServiceEcGroupGetOrder(IN VOID *EcGroup, OUT VOID *BnOrder)
Definition: Crypto.c:6270
BOOLEAN EFIAPI CryptoServiceRsaGetPrivateKeyFromPem(IN CONST UINT8 *PemData, IN UINTN PemSize, IN CONST CHAR8 *Password, OUT VOID **RsaContext)
Definition: Crypto.c:2760
BOOLEAN EFIAPI DeprecatedCryptoServiceHmacSha1Final(IN OUT VOID *HmacSha1Context, OUT UINT8 *HmacValue)
Definition: Crypto.c:1696
BOOLEAN EFIAPI CryptoServiceSha384Init(OUT VOID *Sha384Context)
Definition: Crypto.c:1048
VOID EFIAPI CryptoServiceTlsGetServerRandom(IN VOID *Tls, IN OUT UINT8 *ServerRandom)
Definition: Crypto.c:5335
UINTN EFIAPI DeprecatedCryptoServiceTdesGetContextSize(VOID)
Definition: Crypto.c:2075
BOOLEAN EFIAPI CryptoServiceX509GetExtensionData(IN CONST UINT8 *Cert, IN UINTN CertSize, IN CONST UINT8 *Oid, IN UINTN OidSize, OUT UINT8 *ExtensionData, IN OUT UINTN *ExtensionDataSize)
Definition: Crypto.c:3234
BOOLEAN EFIAPI CryptoServiceHkdfSha256Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
Definition: Crypto.c:4329
BOOLEAN EFIAPI CryptoServiceSha512Init(OUT VOID *Sha512Context)
Definition: Crypto.c:1197
#define CALL_BASECRYPTLIB(Enable, Function, Args, ErrorReturnValue)
Definition: Crypto.c:41
EFI_STATUS EFIAPI CryptoServiceTlsGetExportKey(IN VOID *Tls, IN CONST VOID *Label, IN CONST VOID *Context, IN UINTN ContextLen, OUT VOID *KeyBuffer, IN UINTN KeyBufferLen)
Definition: Crypto.c:5494
VOID *EFIAPI CryptoServiceBigNumFromBin(IN CONST UINT8 *Buf, IN UINTN Len)
Definition: Crypto.c:5741
BOOLEAN EFIAPI CryptoServiceX509VerifyCert(IN CONST UINT8 *Cert, IN UINTN CertSize, IN CONST UINT8 *CACert, IN UINTN CACertSize)
Definition: Crypto.c:2926
RETURN_STATUS EFIAPI CryptoServiceX509GetCommonName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT CHAR8 *CommonName OPTIONAL, IN OUT UINTN *CommonNameSize)
Definition: Crypto.c:2858
BOOLEAN EFIAPI CryptoServiceX509GetValidity(IN CONST UINT8 *Cert, IN UINTN CertSize, IN UINT8 *From, IN OUT UINTN *FromSize, IN UINT8 *To, IN OUT UINTN *ToSize)
Definition: Crypto.c:3298
BOOLEAN EFIAPI CryptoServiceBigNumIsOdd(IN CONST VOID *Bn)
Definition: Crypto.c:6030
BOOLEAN EFIAPI DeprecatedCryptoServiceTdesEcbEncrypt(IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output)
Definition: Crypto.c:2118
BOOLEAN EFIAPI CryptoServiceBigNumDiv(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: Crypto.c:5915
BOOLEAN EFIAPI CryptoServiceDhGenerateParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, OUT UINT8 *Prime)
Definition: Crypto.c:4102
EFI_STATUS EFIAPI CryptoServiceTlsGetHostPublicCert(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: Crypto.c:5413
EFI_STATUS EFIAPI CryptoServiceTlsSetHostPrivateKey(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
Definition: Crypto.c:5073
BOOLEAN EFIAPI CryptoServiceAsn1GetTag(IN OUT UINT8 **Ptr, IN CONST UINT8 *End, OUT UINTN *Length, IN UINT32 Tag)
Definition: Crypto.c:3464
CONST VOID *EFIAPI CryptoServiceBigNumValueOne(VOID)
Definition: Crypto.c:6064
BOOLEAN EFIAPI CryptoServiceSha256HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: Crypto.c:1010
BOOLEAN EFIAPI DeprecatedCryptoServiceMd5Final(IN OUT VOID *Md5Context, OUT UINT8 *HashValue)
Definition: Crypto.c:360
UINTN EFIAPI CryptoServiceAesGetContextSize(VOID)
Definition: Crypto.c:2215
BOOLEAN EFIAPI CryptoServiceX509GetKeyUsage(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Usage)
Definition: Crypto.c:3383
BOOLEAN EFIAPI CryptoServiceAeadAesGcmDecrypt(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Iv, IN UINTN IvSize, IN CONST UINT8 *AData, IN UINTN ADataSize, IN CONST UINT8 *DataIn, IN UINTN DataInSize, IN CONST UINT8 *Tag, IN UINTN TagSize, OUT UINT8 *DataOut, OUT UINTN *DataOutSize)
Definition: Crypto.c:5695
BOOLEAN EFIAPI CryptoServiceEcPointInvert(IN CONST VOID *EcGroup, IN OUT VOID *EcPoint, IN VOID *BnCtx)
Definition: Crypto.c:6442
INTN EFIAPI CryptoServiceBigNumCmp(IN CONST VOID *BnA, IN CONST VOID *BnB)
Definition: Crypto.c:5961
BOOLEAN EFIAPI CryptoServiceEcDsaSign(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: Crypto.c:6767
BOOLEAN EFIAPI CryptoServiceSha256Final(IN OUT VOID *Sha256Context, OUT UINT8 *HashValue)
Definition: Crypto.c:982
BOOLEAN EFIAPI CryptoServiceHmacSha256Final(IN OUT VOID *HmacSha256Context, OUT UINT8 *HmacValue)
Definition: Crypto.c:1842
BOOLEAN EFIAPI CryptoServiceDhSetParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, IN CONST UINT8 *Prime)
Definition: Crypto.c:4137
VOID EFIAPI CryptoServiceBigNumFree(IN VOID *Bn, IN BOOLEAN Clear)
Definition: Crypto.c:5776
BOOLEAN EFIAPI CryptoServiceRsaOaepEncrypt(IN VOID *RsaContext, IN UINT8 *InData, IN UINTN InDataSize, IN CONST UINT8 *PrngSeed OPTIONAL, IN UINTN PrngSeedSize OPTIONAL, IN UINT16 DigestLen OPTIONAL, OUT UINT8 **EncryptedData, OUT UINTN *EncryptedDataSize)
Definition: Crypto.c:3627
BOOLEAN EFIAPI CryptoServiceRsaSetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, IN CONST UINT8 *BigNumber, IN UINTN BnSize)
Definition: Crypto.c:2552
VOID EFIAPI Input(IN CHAR16 *Prompt OPTIONAL, OUT CHAR16 *InStr, IN UINTN StrLen)
Definition: EdbSupportUI.c:187
BOOLEAN EFIAPI Md5Duplicate(IN CONST VOID *Md5Context, OUT VOID *NewMd5Context)
Definition: CryptMd5Null.c:65
BOOLEAN EFIAPI Md5Final(IN OUT VOID *Md5Context, OUT UINT8 *HashValue)
Definition: CryptMd5Null.c:126
BOOLEAN EFIAPI Md5Update(IN OUT VOID *Md5Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptMd5Null.c:94
BOOLEAN EFIAPI Md5Init(OUT VOID *Md5Context)
Definition: CryptMd5Null.c:42
BOOLEAN EFIAPI Md5HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptMd5Null.c:155
UINTN EFIAPI Md5GetContextSize(VOID)
Definition: CryptMd5Null.c:20
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define RETURN_UNSUPPORTED
Definition: Base.h:1081
#define VA_START(Marker, Parameter)
Definition: Base.h:661
#define FALSE
Definition: Base.h:307
CHAR8 * VA_LIST
Definition: Base.h:643
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define VA_END(Marker)
Definition: Base.h:691
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define EDKII_CRYPTO_VERSION
Definition: Crypto.h:24
VOID EFIAPI TlsGetServerRandom(IN VOID *Tls, IN OUT UINT8 *ServerRandom)
Definition: CryptLib.c:4560
EFI_STATUS EFIAPI TlsGetHostPublicCert(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: CryptLib.c:4638
EFI_STATUS EFIAPI TlsDoHandshake(IN VOID *Tls, IN UINT8 *BufferIn OPTIONAL, IN UINTN BufferInSize OPTIONAL, OUT UINT8 *BufferOut OPTIONAL, IN OUT UINTN *BufferOutSize)
Definition: CryptLib.c:3826
EFI_STATUS EFIAPI TlsSetVerifyHost(IN VOID *Tls, IN UINT32 Flags, IN CHAR8 *HostName)
Definition: CryptLib.c:4159
INTN EFIAPI TlsCtrlTrafficIn(IN VOID *Tls, IN VOID *Buffer, IN UINTN BufferSize)
Definition: CryptLib.c:3945
EFI_STATUS EFIAPI TlsGetKeyMaterial(IN VOID *Tls, IN OUT UINT8 *KeyMaterial)
Definition: CryptLib.c:4584
UINT32 EFIAPI TlsGetVerify(IN VOID *Tls)
Definition: CryptLib.c:4493
EFI_STATUS EFIAPI TlsGetCurrentCipher(IN VOID *Tls, IN OUT UINT16 *CipherId)
Definition: CryptLib.c:4444
EFI_STATUS EFIAPI TlsSetCertRevocationList(IN VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:4323
VOID *EFIAPI TlsCtxNew(IN UINT8 MajorVer, IN UINT8 MinorVer)
Definition: CryptLib.c:3730
EFI_STATUS EFIAPI TlsGetCertRevocationList(OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: CryptLib.c:4691
INTN EFIAPI TlsCtrlTrafficOut(IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
Definition: CryptLib.c:3920
EFI_STATUS EFIAPI TlsSetCompressionMethod(IN UINT8 CompMethod)
Definition: CryptLib.c:4119
VOID EFIAPI TlsFree(IN VOID *Tls)
Definition: CryptLib.c:3749
EFI_STATUS EFIAPI TlsSetCaCertificate(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:4213
EFI_STATUS EFIAPI TlsSetCipherList(IN VOID *Tls, IN UINT16 *CipherId, IN UINTN CipherNum)
Definition: CryptLib.c:4096
VOID *EFIAPI TlsNew(IN VOID *TlsCtx)
Definition: CryptLib.c:3771
EFI_STATUS EFIAPI TlsGetCurrentCompressionId(IN VOID *Tls, IN OUT UINT8 *CompressionId)
Definition: CryptLib.c:4470
EFI_STATUS EFIAPI TlsSetConnectionEnd(IN VOID *Tls, IN BOOLEAN IsServer)
Definition: CryptLib.c:4068
EFI_STATUS EFIAPI TlsSetSessionId(IN VOID *Tls, IN UINT8 *SessionId, IN UINT16 SessionIdLen)
Definition: CryptLib.c:4185
EFI_STATUS EFIAPI TlsSetHostPrivateKey(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:4298
EFI_STATUS EFIAPI TlsSetHostPublicCert(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:4241
UINT8 EFIAPI TlsGetConnectionEnd(IN VOID *Tls)
Definition: CryptLib.c:4421
VOID EFIAPI TlsSetVerify(IN VOID *Tls, IN UINT32 VerifyMode)
Definition: CryptLib.c:4137
VOID EFIAPI TlsCtxFree(IN VOID *TlsCtx)
Definition: CryptLib.c:3710
VOID EFIAPI TlsGetClientRandom(IN VOID *Tls, IN OUT UINT8 *ClientRandom)
Definition: CryptLib.c:4539
INTN EFIAPI TlsRead(IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
Definition: CryptLib.c:3971
EFI_STATUS EFIAPI TlsShutdown(IN VOID *Tls)
Definition: CryptLib.c:4021
BOOLEAN EFIAPI TlsInHandshake(IN VOID *Tls)
Definition: CryptLib.c:3791
EFI_STATUS EFIAPI TlsSetVersion(IN VOID *Tls, IN UINT8 MajorVer, IN UINT8 MinorVer)
Definition: CryptLib.c:4044
EFI_STATUS EFIAPI TlsSetHostPrivateKeyEx(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize, IN VOID *Password OPTIONAL)
Definition: CryptLib.c:4270
EFI_STATUS EFIAPI TlsHandleAlert(IN VOID *Tls, IN UINT8 *BufferIn OPTIONAL, IN UINTN BufferInSize OPTIONAL, OUT UINT8 *BufferOut OPTIONAL, IN OUT UINTN *BufferOutSize)
Definition: CryptLib.c:3864
EFI_STATUS EFIAPI TlsCloseNotify(IN VOID *Tls, IN OUT UINT8 *Buffer, IN OUT UINTN *BufferSize)
Definition: CryptLib.c:3895
BOOLEAN EFIAPI TlsInitialize(VOID)
Definition: CryptLib.c:3695
EFI_STATUS EFIAPI TlsGetSessionId(IN VOID *Tls, IN OUT UINT8 *SessionId, IN OUT UINT16 *SessionIdLen)
Definition: CryptLib.c:4517
UINT16 EFIAPI TlsGetVersion(IN VOID *Tls)
Definition: CryptLib.c:4399
EFI_STATUS EFIAPI TlsSetEcCurve(IN VOID *Tls, IN UINT8 *Data, IN UINTN DataSize)
Definition: CryptLib.c:4375
EFI_STATUS EFIAPI TlsGetExportKey(IN VOID *Tls, IN CONST VOID *Label, IN CONST VOID *Context, IN UINTN ContextLen, OUT VOID *KeyBuffer, IN UINTN KeyBufferLen)
Definition: CryptLib.c:4719
INTN EFIAPI TlsWrite(IN VOID *Tls, IN VOID *Buffer, IN UINTN BufferSize)
Definition: CryptLib.c:3997
EFI_STATUS EFIAPI TlsGetCaCertificate(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: CryptLib.c:4610
EFI_STATUS EFIAPI TlsGetHostPrivateKey(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: CryptLib.c:4665
EFI_STATUS EFIAPI TlsSetSignatureAlgoList(IN VOID *Tls, IN UINT8 *Data, IN UINTN DataSize)
Definition: CryptLib.c:4350
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29