TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptLib.c
Go to the documentation of this file.
1
11#include <Base.h>
12#include <Library/BaseLib.h>
13#include <Library/DebugLib.h>
15#include <Library/TlsLib.h>
16#include <Protocol/Crypto.h>
17
29#define CALL_CRYPTO_SERVICE(Function, Args, ErrorReturnValue) \
30 do { \
31 EDKII_CRYPTO_PROTOCOL *CryptoServices; \
32 \
33 CryptoServices = (EDKII_CRYPTO_PROTOCOL *)GetCryptoServices (); \
34 if (CryptoServices != NULL && CryptoServices->Function != NULL) { \
35 return (CryptoServices->Function) Args; \
36 } \
37 CryptoServiceNotAvailable (#Function); \
38 return ErrorReturnValue; \
39 } while (FALSE);
40
50#define CALL_VOID_CRYPTO_SERVICE(Function, Args) \
51 do { \
52 EDKII_CRYPTO_PROTOCOL *CryptoServices; \
53 \
54 CryptoServices = (EDKII_CRYPTO_PROTOCOL *)GetCryptoServices (); \
55 if (CryptoServices != NULL && CryptoServices->Function != NULL) { \
56 (CryptoServices->Function) Args; \
57 return; \
58 } \
59 CryptoServiceNotAvailable (#Function); \
60 return; \
61 } while (FALSE);
62
70VOID *
72 VOID
73 );
74
88static
89VOID
90CryptoServiceNotAvailable (
91 IN CONST CHAR8 *FunctionName
92 )
93{
94 DEBUG ((DEBUG_ERROR, "[%a] Function %a is not available\n", gEfiCallerBaseName, FunctionName));
95 ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
96}
97
98// =====================================================================================
99// One-Way Cryptographic Hash Primitives
100// =====================================================================================
101
102#ifdef ENABLE_MD5_DEPRECATED_INTERFACES
103
113UINTN
114EFIAPI
116 VOID
117 )
118{
120}
121
136BOOLEAN
137EFIAPI
138Md5Init (
139 OUT VOID *Md5Context
140 )
141{
142 CALL_CRYPTO_SERVICE (Md5Init, (Md5Context), FALSE);
143}
144
160BOOLEAN
161EFIAPI
163 IN CONST VOID *Md5Context,
164 OUT VOID *NewMd5Context
165 )
166{
167 CALL_CRYPTO_SERVICE (Md5Duplicate, (Md5Context, NewMd5Context), FALSE);
168}
169
190BOOLEAN
191EFIAPI
192Md5Update (
193 IN OUT VOID *Md5Context,
194 IN CONST VOID *Data,
195 IN UINTN DataSize
196 )
197{
198 CALL_CRYPTO_SERVICE (Md5Update, (Md5Context, Data, DataSize), FALSE);
199}
200
223BOOLEAN
224EFIAPI
225Md5Final (
226 IN OUT VOID *Md5Context,
227 OUT UINT8 *HashValue
228 )
229{
230 CALL_CRYPTO_SERVICE (Md5Final, (Md5Context, HashValue), FALSE);
231}
232
251BOOLEAN
252EFIAPI
254 IN CONST VOID *Data,
255 IN UINTN DataSize,
256 OUT UINT8 *HashValue
257 )
258{
259 CALL_CRYPTO_SERVICE (Md5HashAll, (Data, DataSize, HashValue), FALSE);
260}
261
262#endif
263
264#ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
265
275UINTN
276EFIAPI
278 VOID
279 )
280{
282}
283
298BOOLEAN
299EFIAPI
301 OUT VOID *Sha1Context
302 )
303{
304 CALL_CRYPTO_SERVICE (Sha1Init, (Sha1Context), FALSE);
305}
306
322BOOLEAN
323EFIAPI
325 IN CONST VOID *Sha1Context,
326 OUT VOID *NewSha1Context
327 )
328{
329 CALL_CRYPTO_SERVICE (Sha1Duplicate, (Sha1Context, NewSha1Context), FALSE);
330}
331
352BOOLEAN
353EFIAPI
355 IN OUT VOID *Sha1Context,
356 IN CONST VOID *Data,
357 IN UINTN DataSize
358 )
359{
360 CALL_CRYPTO_SERVICE (Sha1Update, (Sha1Context, Data, DataSize), FALSE);
361}
362
385BOOLEAN
386EFIAPI
388 IN OUT VOID *Sha1Context,
389 OUT UINT8 *HashValue
390 )
391{
392 CALL_CRYPTO_SERVICE (Sha1Final, (Sha1Context, HashValue), FALSE);
393}
394
413BOOLEAN
414EFIAPI
416 IN CONST VOID *Data,
417 IN UINTN DataSize,
418 OUT UINT8 *HashValue
419 )
420{
421 CALL_CRYPTO_SERVICE (Sha1HashAll, (Data, DataSize, HashValue), FALSE);
422}
423
424#endif
425
432UINTN
433EFIAPI
435 VOID
436 )
437{
439}
440
453BOOLEAN
454EFIAPI
456 OUT VOID *Sha256Context
457 )
458{
459 CALL_CRYPTO_SERVICE (Sha256Init, (Sha256Context), FALSE);
460}
461
477BOOLEAN
478EFIAPI
480 IN CONST VOID *Sha256Context,
481 OUT VOID *NewSha256Context
482 )
483{
484 CALL_CRYPTO_SERVICE (Sha256Duplicate, (Sha256Context, NewSha256Context), FALSE);
485}
486
505BOOLEAN
506EFIAPI
508 IN OUT VOID *Sha256Context,
509 IN CONST VOID *Data,
510 IN UINTN DataSize
511 )
512{
513 CALL_CRYPTO_SERVICE (Sha256Update, (Sha256Context, Data, DataSize), FALSE);
514}
515
536BOOLEAN
537EFIAPI
539 IN OUT VOID *Sha256Context,
540 OUT UINT8 *HashValue
541 )
542{
543 CALL_CRYPTO_SERVICE (Sha256Final, (Sha256Context, HashValue), FALSE);
544}
545
564BOOLEAN
565EFIAPI
567 IN CONST VOID *Data,
568 IN UINTN DataSize,
569 OUT UINT8 *HashValue
570 )
571{
572 CALL_CRYPTO_SERVICE (Sha256HashAll, (Data, DataSize, HashValue), FALSE);
573}
574
581UINTN
582EFIAPI
584 VOID
585 )
586{
588}
589
602BOOLEAN
603EFIAPI
605 OUT VOID *Sha384Context
606 )
607{
608 CALL_CRYPTO_SERVICE (Sha384Init, (Sha384Context), FALSE);
609}
610
626BOOLEAN
627EFIAPI
629 IN CONST VOID *Sha384Context,
630 OUT VOID *NewSha384Context
631 )
632{
633 CALL_CRYPTO_SERVICE (Sha384Duplicate, (Sha384Context, NewSha384Context), FALSE);
634}
635
654BOOLEAN
655EFIAPI
657 IN OUT VOID *Sha384Context,
658 IN CONST VOID *Data,
659 IN UINTN DataSize
660 )
661{
662 CALL_CRYPTO_SERVICE (Sha384Update, (Sha384Context, Data, DataSize), FALSE);
663}
664
685BOOLEAN
686EFIAPI
688 IN OUT VOID *Sha384Context,
689 OUT UINT8 *HashValue
690 )
691{
692 CALL_CRYPTO_SERVICE (Sha384Final, (Sha384Context, HashValue), FALSE);
693}
694
713BOOLEAN
714EFIAPI
716 IN CONST VOID *Data,
717 IN UINTN DataSize,
718 OUT UINT8 *HashValue
719 )
720{
721 CALL_CRYPTO_SERVICE (Sha384HashAll, (Data, DataSize, HashValue), FALSE);
722}
723
730UINTN
731EFIAPI
733 VOID
734 )
735{
737}
738
751BOOLEAN
752EFIAPI
754 OUT VOID *Sha512Context
755 )
756{
757 CALL_CRYPTO_SERVICE (Sha512Init, (Sha512Context), FALSE);
758}
759
775BOOLEAN
776EFIAPI
778 IN CONST VOID *Sha512Context,
779 OUT VOID *NewSha512Context
780 )
781{
782 CALL_CRYPTO_SERVICE (Sha512Duplicate, (Sha512Context, NewSha512Context), FALSE);
783}
784
803BOOLEAN
804EFIAPI
806 IN OUT VOID *Sha512Context,
807 IN CONST VOID *Data,
808 IN UINTN DataSize
809 )
810{
811 CALL_CRYPTO_SERVICE (Sha512Update, (Sha512Context, Data, DataSize), FALSE);
812}
813
834BOOLEAN
835EFIAPI
837 IN OUT VOID *Sha512Context,
838 OUT UINT8 *HashValue
839 )
840{
841 CALL_CRYPTO_SERVICE (Sha512Final, (Sha512Context, HashValue), FALSE);
842}
843
862BOOLEAN
863EFIAPI
865 IN CONST VOID *Data,
866 IN UINTN DataSize,
867 OUT UINT8 *HashValue
868 )
869{
870 CALL_CRYPTO_SERVICE (Sha512HashAll, (Data, DataSize, HashValue), FALSE);
871}
872
890BOOLEAN
891EFIAPI
893 IN CONST VOID *Input,
894 IN UINTN InputByteLen,
895 IN UINTN BlockSize,
896 OUT VOID *Output,
897 IN UINTN OutputByteLen,
898 IN CONST VOID *Customization,
899 IN UINTN CustomByteLen
900 )
901{
902 CALL_CRYPTO_SERVICE (ParallelHash256HashAll, (Input, InputByteLen, BlockSize, Output, OutputByteLen, Customization, CustomByteLen), FALSE);
903}
904
911UINTN
912EFIAPI
914 VOID
915 )
916{
918}
919
932BOOLEAN
933EFIAPI
935 OUT VOID *Sm3Context
936 )
937{
938 CALL_CRYPTO_SERVICE (Sm3Init, (Sm3Context), FALSE);
939}
940
956BOOLEAN
957EFIAPI
959 IN CONST VOID *Sm3Context,
960 OUT VOID *NewSm3Context
961 )
962{
963 CALL_CRYPTO_SERVICE (Sm3Duplicate, (Sm3Context, NewSm3Context), FALSE);
964}
965
984BOOLEAN
985EFIAPI
987 IN OUT VOID *Sm3Context,
988 IN CONST VOID *Data,
989 IN UINTN DataSize
990 )
991{
992 CALL_CRYPTO_SERVICE (Sm3Update, (Sm3Context, Data, DataSize), FALSE);
993}
994
1015BOOLEAN
1016EFIAPI
1018 IN OUT VOID *Sm3Context,
1019 OUT UINT8 *HashValue
1020 )
1021{
1022 CALL_CRYPTO_SERVICE (Sm3Final, (Sm3Context, HashValue), FALSE);
1023}
1024
1043BOOLEAN
1044EFIAPI
1046 IN CONST VOID *Data,
1047 IN UINTN DataSize,
1048 OUT UINT8 *HashValue
1049 )
1050{
1051 CALL_CRYPTO_SERVICE (Sm3HashAll, (Data, DataSize, HashValue), FALSE);
1052}
1053
1054// =====================================================================================
1055// MAC (Message Authentication Code) Primitive
1056// =====================================================================================
1057
1065VOID *
1066EFIAPI
1068 VOID
1069 )
1070{
1072}
1073
1080VOID
1081EFIAPI
1083 IN VOID *HmacSha256Ctx
1084 )
1085{
1086 CALL_VOID_CRYPTO_SERVICE (HmacSha256Free, (HmacSha256Ctx));
1087}
1088
1105BOOLEAN
1106EFIAPI
1108 OUT VOID *HmacSha256Context,
1109 IN CONST UINT8 *Key,
1110 IN UINTN KeySize
1111 )
1112{
1113 CALL_CRYPTO_SERVICE (HmacSha256SetKey, (HmacSha256Context, Key, KeySize), FALSE);
1114}
1115
1131BOOLEAN
1132EFIAPI
1134 IN CONST VOID *HmacSha256Context,
1135 OUT VOID *NewHmacSha256Context
1136 )
1137{
1138 CALL_CRYPTO_SERVICE (HmacSha256Duplicate, (HmacSha256Context, NewHmacSha256Context), FALSE);
1139}
1140
1161BOOLEAN
1162EFIAPI
1164 IN OUT VOID *HmacSha256Context,
1165 IN CONST VOID *Data,
1166 IN UINTN DataSize
1167 )
1168{
1169 CALL_CRYPTO_SERVICE (HmacSha256Update, (HmacSha256Context, Data, DataSize), FALSE);
1170}
1171
1194BOOLEAN
1195EFIAPI
1197 IN OUT VOID *HmacSha256Context,
1198 OUT UINT8 *HmacValue
1199 )
1200{
1201 CALL_CRYPTO_SERVICE (HmacSha256Final, (HmacSha256Context, HmacValue), FALSE);
1202}
1203
1224BOOLEAN
1225EFIAPI
1227 IN CONST VOID *Data,
1228 IN UINTN DataSize,
1229 IN CONST UINT8 *Key,
1230 IN UINTN KeySize,
1231 OUT UINT8 *HmacValue
1232 )
1233{
1234 CALL_CRYPTO_SERVICE (HmacSha256All, (Data, DataSize, Key, KeySize, HmacValue), FALSE);
1235}
1236
1244VOID *
1245EFIAPI
1247 VOID
1248 )
1249{
1251}
1252
1259VOID
1260EFIAPI
1262 IN VOID *HmacSha384Ctx
1263 )
1264{
1265 CALL_VOID_CRYPTO_SERVICE (HmacSha384Free, (HmacSha384Ctx));
1266}
1267
1284BOOLEAN
1285EFIAPI
1287 OUT VOID *HmacSha384Context,
1288 IN CONST UINT8 *Key,
1289 IN UINTN KeySize
1290 )
1291{
1292 CALL_CRYPTO_SERVICE (HmacSha384SetKey, (HmacSha384Context, Key, KeySize), FALSE);
1293}
1294
1310BOOLEAN
1311EFIAPI
1313 IN CONST VOID *HmacSha384Context,
1314 OUT VOID *NewHmacSha384Context
1315 )
1316{
1317 CALL_CRYPTO_SERVICE (HmacSha384Duplicate, (HmacSha384Context, NewHmacSha384Context), FALSE);
1318}
1319
1340BOOLEAN
1341EFIAPI
1343 IN OUT VOID *HmacSha384Context,
1344 IN CONST VOID *Data,
1345 IN UINTN DataSize
1346 )
1347{
1348 CALL_CRYPTO_SERVICE (HmacSha384Update, (HmacSha384Context, Data, DataSize), FALSE);
1349}
1350
1373BOOLEAN
1374EFIAPI
1376 IN OUT VOID *HmacSha384Context,
1377 OUT UINT8 *HmacValue
1378 )
1379{
1380 CALL_CRYPTO_SERVICE (HmacSha384Final, (HmacSha384Context, HmacValue), FALSE);
1381}
1382
1403BOOLEAN
1404EFIAPI
1406 IN CONST VOID *Data,
1407 IN UINTN DataSize,
1408 IN CONST UINT8 *Key,
1409 IN UINTN KeySize,
1410 OUT UINT8 *HmacValue
1411 )
1412{
1413 CALL_CRYPTO_SERVICE (HmacSha384All, (Data, DataSize, Key, KeySize, HmacValue), FALSE);
1414}
1415
1416// =====================================================================================
1417// Symmetric Cryptography Primitive
1418// =====================================================================================
1419
1429UINTN
1430EFIAPI
1432 VOID
1433 )
1434{
1436}
1437
1460BOOLEAN
1461EFIAPI
1463 OUT VOID *AesContext,
1464 IN CONST UINT8 *Key,
1465 IN UINTN KeyLength
1466 )
1467{
1468 CALL_CRYPTO_SERVICE (AesInit, (AesContext, Key, KeyLength), FALSE);
1469}
1470
1500BOOLEAN
1501EFIAPI
1503 IN VOID *AesContext,
1504 IN CONST UINT8 *Input,
1505 IN UINTN InputSize,
1506 IN CONST UINT8 *Ivec,
1507 OUT UINT8 *Output
1508 )
1509{
1510 CALL_CRYPTO_SERVICE (AesCbcEncrypt, (AesContext, Input, InputSize, Ivec, Output), FALSE);
1511}
1512
1542BOOLEAN
1543EFIAPI
1545 IN VOID *AesContext,
1546 IN CONST UINT8 *Input,
1547 IN UINTN InputSize,
1548 IN CONST UINT8 *Ivec,
1549 OUT UINT8 *Output
1550 )
1551{
1552 CALL_CRYPTO_SERVICE (AesCbcDecrypt, (AesContext, Input, InputSize, Ivec, Output), FALSE);
1553}
1554
1555// =====================================================================================
1556// Authenticated Encryption with Associated Data (AEAD) Cryptography Primitive
1557// =====================================================================================
1558
1583BOOLEAN
1584EFIAPI
1586 IN CONST UINT8 *Key,
1587 IN UINTN KeySize,
1588 IN CONST UINT8 *Iv,
1589 IN UINTN IvSize,
1590 IN CONST UINT8 *AData,
1591 IN UINTN ADataSize,
1592 IN CONST UINT8 *DataIn,
1593 IN UINTN DataInSize,
1594 OUT UINT8 *TagOut,
1595 IN UINTN TagSize,
1596 OUT UINT8 *DataOut,
1597 OUT UINTN *DataOutSize
1598 )
1599{
1600 CALL_CRYPTO_SERVICE (AeadAesGcmEncrypt, (Key, KeySize, Iv, IvSize, AData, ADataSize, DataIn, DataInSize, TagOut, TagSize, DataOut, DataOutSize), FALSE);
1601}
1602
1628BOOLEAN
1629EFIAPI
1631 IN CONST UINT8 *Key,
1632 IN UINTN KeySize,
1633 IN CONST UINT8 *Iv,
1634 IN UINTN IvSize,
1635 IN CONST UINT8 *AData,
1636 IN UINTN ADataSize,
1637 IN CONST UINT8 *DataIn,
1638 IN UINTN DataInSize,
1639 IN CONST UINT8 *Tag,
1640 IN UINTN TagSize,
1641 OUT UINT8 *DataOut,
1642 OUT UINTN *DataOutSize
1643 )
1644{
1645 CALL_CRYPTO_SERVICE (AeadAesGcmDecrypt, (Key, KeySize, Iv, IvSize, AData, ADataSize, DataIn, DataInSize, Tag, TagSize, DataOut, DataOutSize), FALSE);
1646}
1647
1648// =====================================================================================
1649// Asymmetric Cryptography Primitive
1650// =====================================================================================
1651
1659VOID *
1660EFIAPI
1662 VOID
1663 )
1664{
1666}
1667
1676VOID
1677EFIAPI
1679 IN VOID *RsaContext
1680 )
1681{
1682 CALL_VOID_CRYPTO_SERVICE (RsaFree, (RsaContext));
1683}
1684
1707BOOLEAN
1708EFIAPI
1710 IN OUT VOID *RsaContext,
1711 IN RSA_KEY_TAG KeyTag,
1712 IN CONST UINT8 *BigNumber,
1713 IN UINTN BnSize
1714 )
1715{
1716 CALL_CRYPTO_SERVICE (RsaSetKey, (RsaContext, KeyTag, BigNumber, BnSize), FALSE);
1717}
1718
1747BOOLEAN
1748EFIAPI
1750 IN OUT VOID *RsaContext,
1751 IN RSA_KEY_TAG KeyTag,
1752 OUT UINT8 *BigNumber,
1753 IN OUT UINTN *BnSize
1754 )
1755{
1756 CALL_CRYPTO_SERVICE (RsaGetKey, (RsaContext, KeyTag, BigNumber, BnSize), FALSE);
1757}
1758
1782BOOLEAN
1783EFIAPI
1785 IN OUT VOID *RsaContext,
1786 IN UINTN ModulusLength,
1787 IN CONST UINT8 *PublicExponent,
1788 IN UINTN PublicExponentSize
1789 )
1790{
1791 CALL_CRYPTO_SERVICE (RsaGenerateKey, (RsaContext, ModulusLength, PublicExponent, PublicExponentSize), FALSE);
1792}
1793
1815BOOLEAN
1816EFIAPI
1818 IN VOID *RsaContext
1819 )
1820{
1821 CALL_CRYPTO_SERVICE (RsaCheckKey, (RsaContext), FALSE);
1822}
1823
1851BOOLEAN
1852EFIAPI
1854 IN VOID *RsaContext,
1855 IN CONST UINT8 *MessageHash,
1856 IN UINTN HashSize,
1857 OUT UINT8 *Signature,
1858 IN OUT UINTN *SigSize
1859 )
1860{
1861 CALL_CRYPTO_SERVICE (RsaPkcs1Sign, (RsaContext, MessageHash, HashSize, Signature, SigSize), FALSE);
1862}
1863
1883BOOLEAN
1884EFIAPI
1886 IN VOID *RsaContext,
1887 IN CONST UINT8 *MessageHash,
1888 IN UINTN HashSize,
1889 IN CONST UINT8 *Signature,
1890 IN UINTN SigSize
1891 )
1892{
1893 CALL_CRYPTO_SERVICE (RsaPkcs1Verify, (RsaContext, MessageHash, HashSize, Signature, SigSize), FALSE);
1894}
1895
1914BOOLEAN
1915EFIAPI
1917 IN VOID *RsaContext,
1918 IN CONST UINT8 *Message,
1919 IN UINTN MsgSize,
1920 IN CONST UINT8 *Signature,
1921 IN UINTN SigSize,
1922 IN UINT16 DigestLen,
1923 IN UINT16 SaltLen
1924 )
1925{
1926 CALL_CRYPTO_SERVICE (RsaPssVerify, (RsaContext, Message, MsgSize, Signature, SigSize, DigestLen, SaltLen), FALSE);
1927}
1928
1959BOOLEAN
1960EFIAPI
1962 IN VOID *RsaContext,
1963 IN CONST UINT8 *Message,
1964 IN UINTN MsgSize,
1965 IN UINT16 DigestLen,
1966 IN UINT16 SaltLen,
1967 OUT UINT8 *Signature,
1968 IN OUT UINTN *SigSize
1969 )
1970{
1971 CALL_CRYPTO_SERVICE (RsaPssSign, (RsaContext, Message, MsgSize, DigestLen, SaltLen, Signature, SigSize), FALSE);
1972}
1973
1993BOOLEAN
1994EFIAPI
1996 IN CONST UINT8 *PemData,
1997 IN UINTN PemSize,
1998 IN CONST CHAR8 *Password,
1999 OUT VOID **RsaContext
2000 )
2001{
2002 CALL_CRYPTO_SERVICE (RsaGetPrivateKeyFromPem, (PemData, PemSize, Password, RsaContext), FALSE);
2003}
2004
2023BOOLEAN
2024EFIAPI
2026 IN CONST UINT8 *Cert,
2027 IN UINTN CertSize,
2028 OUT VOID **RsaContext
2029 )
2030{
2031 CALL_CRYPTO_SERVICE (RsaGetPublicKeyFromX509, (Cert, CertSize, RsaContext), FALSE);
2032}
2033
2053BOOLEAN
2054EFIAPI
2056 IN CONST UINT8 *Cert,
2057 IN UINTN CertSize,
2058 OUT UINT8 *CertSubject,
2059 IN OUT UINTN *SubjectSize
2060 )
2061{
2062 CALL_CRYPTO_SERVICE (X509GetSubjectName, (Cert, CertSize, CertSubject, SubjectSize), FALSE);
2063}
2064
2091RETURN_STATUS
2092EFIAPI
2094 IN CONST UINT8 *Cert,
2095 IN UINTN CertSize,
2096 OUT CHAR8 *CommonName OPTIONAL,
2097 IN OUT UINTN *CommonNameSize
2098 )
2099{
2100 CALL_CRYPTO_SERVICE (X509GetCommonName, (Cert, CertSize, CommonName, CommonNameSize), RETURN_UNSUPPORTED);
2101}
2102
2129RETURN_STATUS
2130EFIAPI
2132 IN CONST UINT8 *Cert,
2133 IN UINTN CertSize,
2134 OUT CHAR8 *NameBuffer OPTIONAL,
2135 IN OUT UINTN *NameBufferSize
2136 )
2137{
2138 CALL_CRYPTO_SERVICE (X509GetOrganizationName, (Cert, CertSize, NameBuffer, NameBufferSize), RETURN_UNSUPPORTED);
2139}
2140
2159BOOLEAN
2160EFIAPI
2162 IN CONST UINT8 *Cert,
2163 IN UINTN CertSize,
2164 IN CONST UINT8 *CACert,
2165 IN UINTN CACertSize
2166 )
2167{
2168 CALL_CRYPTO_SERVICE (X509VerifyCert, (Cert, CertSize, CACert, CACertSize), FALSE);
2169}
2170
2187BOOLEAN
2188EFIAPI
2190 IN CONST UINT8 *Cert,
2191 IN UINTN CertSize,
2192 OUT UINT8 **SingleX509Cert
2193 )
2194{
2195 CALL_CRYPTO_SERVICE (X509ConstructCertificate, (Cert, CertSize, SingleX509Cert), FALSE);
2196}
2197
2217BOOLEAN
2218EFIAPI
2220 IN OUT UINT8 **X509Stack,
2221 ...
2222 )
2223{
2224 VA_LIST Args;
2225 BOOLEAN Result;
2226
2227 VA_START (Args, X509Stack);
2228 Result = X509ConstructCertificateStackV (X509Stack, Args);
2229 VA_END (Args);
2230 return Result;
2231}
2232
2252BOOLEAN
2253EFIAPI
2255 IN OUT UINT8 **X509Stack,
2256 IN VA_LIST Args
2257 )
2258{
2260}
2261
2270VOID
2271EFIAPI
2273 IN VOID *X509Cert
2274 )
2275{
2276 CALL_VOID_CRYPTO_SERVICE (X509Free, (X509Cert));
2277}
2278
2287VOID
2288EFIAPI
2290 IN VOID *X509Stack
2291 )
2292{
2294}
2295
2313BOOLEAN
2314EFIAPI
2316 IN CONST UINT8 *Cert,
2317 IN UINTN CertSize,
2318 OUT UINT8 **TBSCert,
2319 OUT UINTN *TBSCertSize
2320 )
2321{
2322 CALL_CRYPTO_SERVICE (X509GetTBSCert, (Cert, CertSize, TBSCert, TBSCertSize), FALSE);
2323}
2324
2341BOOLEAN
2342EFIAPI
2344 IN CONST UINT8 *Cert,
2345 IN UINTN CertSize,
2346 OUT UINTN *Version
2347 )
2348{
2349 CALL_CRYPTO_SERVICE (X509GetVersion, (Cert, CertSize, Version), FALSE);
2350}
2351
2375BOOLEAN
2376EFIAPI
2378 IN CONST UINT8 *Cert,
2379 IN UINTN CertSize,
2380 OUT UINT8 *SerialNumber, OPTIONAL
2381 IN OUT UINTN *SerialNumberSize
2382 )
2383{
2384 CALL_CRYPTO_SERVICE (X509GetSerialNumber, (Cert, CertSize, SerialNumber, SerialNumberSize), FALSE);
2385}
2386
2406BOOLEAN
2407EFIAPI
2409 IN CONST UINT8 *Cert,
2410 IN UINTN CertSize,
2411 OUT UINT8 *CertIssuer,
2412 IN OUT UINTN *CertIssuerSize
2413 )
2414{
2415 CALL_CRYPTO_SERVICE (X509GetIssuerName, (Cert, CertSize, CertIssuer, CertIssuerSize), FALSE);
2416}
2417
2436BOOLEAN
2437EFIAPI
2439 IN CONST UINT8 *Cert,
2440 IN UINTN CertSize,
2441 OUT UINT8 *Oid, OPTIONAL
2442 IN OUT UINTN *OidSize
2443 )
2444{
2445 CALL_CRYPTO_SERVICE (X509GetSignatureAlgorithm, (Cert, CertSize, Oid, OidSize), FALSE);
2446}
2447
2468BOOLEAN
2469EFIAPI
2471 IN CONST UINT8 *Cert,
2472 IN UINTN CertSize,
2473 IN CONST UINT8 *Oid,
2474 IN UINTN OidSize,
2475 OUT UINT8 *ExtensionData,
2476 IN OUT UINTN *ExtensionDataSize
2477 )
2478{
2479 CALL_CRYPTO_SERVICE (X509GetExtensionData, (Cert, CertSize, Oid, OidSize, ExtensionData, ExtensionDataSize), FALSE);
2480}
2481
2499BOOLEAN
2500EFIAPI
2502 IN CONST UINT8 *Cert,
2503 IN UINTN CertSize,
2504 OUT UINT8 *Usage,
2505 IN OUT UINTN *UsageSize
2506 )
2507{
2508 CALL_CRYPTO_SERVICE (X509GetExtendedKeyUsage, (Cert, CertSize, Usage, UsageSize), FALSE);
2509}
2510
2532BOOLEAN
2533EFIAPI
2535 IN CONST UINT8 *Cert,
2536 IN UINTN CertSize,
2537 IN UINT8 *From,
2538 IN OUT UINTN *FromSize,
2539 IN UINT8 *To,
2540 IN OUT UINTN *ToSize
2541 )
2542{
2543 CALL_CRYPTO_SERVICE (X509GetValidity, (Cert, CertSize, From, FromSize, To, ToSize), FALSE);
2544}
2545
2569BOOLEAN
2570EFIAPI
2572 IN CONST CHAR8 *DateTimeStr,
2573 OUT VOID *DateTime,
2574 IN OUT UINTN *DateTimeSize
2575 )
2576{
2577 CALL_CRYPTO_SERVICE (X509FormatDateTime, (DateTimeStr, DateTime, DateTimeSize), FALSE);
2578}
2579
2596INT32
2597EFIAPI
2599 IN CONST VOID *DateTime1,
2600 IN CONST VOID *DateTime2
2601 )
2602{
2603 CALL_CRYPTO_SERVICE (X509CompareDateTime, (DateTime1, DateTime2), FALSE);
2604}
2605
2617BOOLEAN
2618EFIAPI
2620 IN CONST UINT8 *Cert,
2621 IN UINTN CertSize,
2622 OUT UINTN *Usage
2623 )
2624{
2625 CALL_CRYPTO_SERVICE (X509GetKeyUsage, (Cert, CertSize, Usage), FALSE);
2626}
2627
2644BOOLEAN
2645EFIAPI
2647 IN CONST UINT8 *RootCert,
2648 IN UINTN RootCertLength,
2649 IN CONST UINT8 *CertChain,
2650 IN UINTN CertChainLength
2651 )
2652{
2653 CALL_CRYPTO_SERVICE (X509VerifyCertChain, (RootCert, RootCertLength, CertChain, CertChainLength), FALSE);
2654}
2655
2674BOOLEAN
2675EFIAPI
2677 IN CONST UINT8 *CertChain,
2678 IN UINTN CertChainLength,
2679 IN CONST INT32 CertIndex,
2680 OUT CONST UINT8 **Cert,
2681 OUT UINTN *CertLength
2682 )
2683{
2684 CALL_CRYPTO_SERVICE (X509GetCertFromCertChain, (CertChain, CertChainLength, CertIndex, Cert, CertLength), FALSE);
2685}
2686
2698BOOLEAN
2699EFIAPI
2701 IN OUT UINT8 **Ptr,
2702 IN CONST UINT8 *End,
2703 OUT UINTN *Length,
2704 IN UINT32 Tag
2705 )
2706{
2707 CALL_CRYPTO_SERVICE (Asn1GetTag, (Ptr, End, Length, Tag), FALSE);
2708}
2709
2728BOOLEAN
2729EFIAPI
2731 CONST UINT8 *Cert,
2732 UINTN CertSize,
2733 UINT8 *BasicConstraints,
2734 UINTN *BasicConstraintsSize
2735 )
2736{
2737 CALL_CRYPTO_SERVICE (X509GetExtendedBasicConstraints, (Cert, CertSize, BasicConstraints, BasicConstraintsSize), FALSE);
2738}
2739
2767BOOLEAN
2768EFIAPI
2770 IN UINTN PasswordLength,
2771 IN CONST CHAR8 *Password,
2772 IN UINTN SaltLength,
2773 IN CONST UINT8 *Salt,
2774 IN UINTN IterationCount,
2775 IN UINTN DigestSize,
2776 IN UINTN KeyLength,
2777 OUT UINT8 *OutKey
2778 )
2779{
2780 CALL_CRYPTO_SERVICE (Pkcs5HashPassword, (PasswordLength, Password, SaltLength, Salt, IterationCount, DigestSize, KeyLength, OutKey), FALSE);
2781}
2782
2812BOOLEAN
2813EFIAPI
2815 IN CONST UINT8 *PublicKey,
2816 IN UINTN PublicKeySize,
2817 IN UINT8 *InData,
2818 IN UINTN InDataSize,
2819 IN CONST UINT8 *PrngSeed OPTIONAL,
2820 IN UINTN PrngSeedSize OPTIONAL,
2821 OUT UINT8 **EncryptedData,
2822 OUT UINTN *EncryptedDataSize
2823 )
2824{
2825 CALL_CRYPTO_SERVICE (Pkcs1v2Encrypt, (PublicKey, PublicKeySize, InData, InDataSize, PrngSeed, PrngSeedSize, EncryptedData, EncryptedDataSize), FALSE);
2826}
2827
2845BOOLEAN
2846EFIAPI
2848 IN CONST UINT8 *PrivateKey,
2849 IN UINTN PrivateKeySize,
2850 IN UINT8 *EncryptedData,
2851 IN UINTN EncryptedDataSize,
2852 OUT UINT8 **OutData,
2853 OUT UINTN *OutDataSize
2854 )
2855{
2856 CALL_CRYPTO_SERVICE (Pkcs1v2Decrypt, (PrivateKey, PrivateKeySize, EncryptedData, EncryptedDataSize, OutData, OutDataSize), FALSE);
2857}
2858
2888BOOLEAN
2889EFIAPI
2891 IN VOID *RsaContext,
2892 IN UINT8 *InData,
2893 IN UINTN InDataSize,
2894 IN CONST UINT8 *PrngSeed OPTIONAL,
2895 IN UINTN PrngSeedSize OPTIONAL,
2896 IN UINT16 DigestLen OPTIONAL,
2897 OUT UINT8 **EncryptedData,
2898 OUT UINTN *EncryptedDataSize
2899 )
2900{
2901 CALL_CRYPTO_SERVICE (RsaOaepEncrypt, (RsaContext, InData, InDataSize, PrngSeed, PrngSeedSize, DigestLen, EncryptedData, EncryptedDataSize), FALSE);
2902}
2903
2927BOOLEAN
2928EFIAPI
2930 IN VOID *RsaContext,
2931 IN UINT8 *EncryptedData,
2932 IN UINTN EncryptedDataSize,
2933 IN UINT16 DigestLen OPTIONAL,
2934 OUT UINT8 **OutData,
2935 OUT UINTN *OutDataSize
2936 )
2937{
2938 CALL_CRYPTO_SERVICE (RsaOaepDecrypt, (RsaContext, EncryptedData, EncryptedDataSize, DigestLen, OutData, OutDataSize), FALSE);
2939}
2940
2968BOOLEAN
2969EFIAPI
2971 IN CONST UINT8 *P7Data,
2972 IN UINTN P7Length,
2973 OUT UINT8 **CertStack,
2974 OUT UINTN *StackLength,
2975 OUT UINT8 **TrustedCert,
2976 OUT UINTN *CertLength
2977 )
2978{
2979 CALL_CRYPTO_SERVICE (Pkcs7GetSigners, (P7Data, P7Length, CertStack, StackLength, TrustedCert, CertLength), FALSE);
2980}
2981
2990VOID
2991EFIAPI
2993 IN UINT8 *Certs
2994 )
2995{
2997}
2998
3021BOOLEAN
3022EFIAPI
3024 IN CONST UINT8 *P7Data,
3025 IN UINTN P7Length,
3026 OUT UINT8 **SignerChainCerts,
3027 OUT UINTN *ChainLength,
3028 OUT UINT8 **UnchainCerts,
3029 OUT UINTN *UnchainLength
3030 )
3031{
3032 CALL_CRYPTO_SERVICE (Pkcs7GetCertificatesList, (P7Data, P7Length, SignerChainCerts, ChainLength, UnchainCerts, UnchainLength), FALSE);
3033}
3034
3062BOOLEAN
3063EFIAPI
3065 IN CONST UINT8 *PrivateKey,
3066 IN UINTN PrivateKeySize,
3067 IN CONST UINT8 *KeyPassword,
3068 IN UINT8 *InData,
3069 IN UINTN InDataSize,
3070 IN UINT8 *SignCert,
3071 IN UINT8 *OtherCerts OPTIONAL,
3072 OUT UINT8 **SignedData,
3073 OUT UINTN *SignedDataSize
3074 )
3075{
3076 CALL_CRYPTO_SERVICE (Pkcs7Sign, (PrivateKey, PrivateKeySize, KeyPassword, InData, InDataSize, SignCert, OtherCerts, SignedData, SignedDataSize), FALSE);
3077}
3078
3101BOOLEAN
3102EFIAPI
3104 IN CONST UINT8 *P7Data,
3105 IN UINTN P7Length,
3106 IN CONST UINT8 *TrustedCert,
3107 IN UINTN CertLength,
3108 IN CONST UINT8 *InData,
3109 IN UINTN DataLength
3110 )
3111{
3112 CALL_CRYPTO_SERVICE (Pkcs7Verify, (P7Data, P7Length, TrustedCert, CertLength, InData, DataLength), FALSE);
3113}
3114
3147RETURN_STATUS
3148EFIAPI
3150 IN CONST UINT8 *Pkcs7Signature,
3151 IN CONST UINT32 SignatureSize,
3152 IN CONST CHAR8 *RequiredEKUs[],
3153 IN CONST UINT32 RequiredEKUsSize,
3154 IN BOOLEAN RequireAllPresent
3155 )
3156{
3157 CALL_CRYPTO_SERVICE (VerifyEKUsInPkcs7Signature, (Pkcs7Signature, SignatureSize, RequiredEKUs, RequiredEKUsSize, RequireAllPresent), FALSE);
3158}
3159
3180BOOLEAN
3181EFIAPI
3183 IN CONST UINT8 *P7Data,
3184 IN UINTN P7Length,
3185 OUT VOID **Content,
3186 OUT UINTN *ContentSize
3187 )
3188{
3189 CALL_CRYPTO_SERVICE (Pkcs7GetAttachedContent, (P7Data, P7Length, Content, ContentSize), FALSE);
3190}
3191
3216BOOLEAN
3217EFIAPI
3219 IN CONST UINT8 *AuthData,
3220 IN UINTN DataSize,
3221 IN CONST UINT8 *TrustedCert,
3222 IN UINTN CertSize,
3223 IN CONST UINT8 *ImageHash,
3224 IN UINTN HashSize
3225 )
3226{
3227 CALL_CRYPTO_SERVICE (AuthenticodeVerify, (AuthData, DataSize, TrustedCert, CertSize, ImageHash, HashSize), FALSE);
3228}
3229
3250BOOLEAN
3251EFIAPI
3253 IN CONST UINT8 *AuthData,
3254 IN UINTN DataSize,
3255 IN CONST UINT8 *TsaCert,
3256 IN UINTN CertSize,
3257 OUT EFI_TIME *SigningTime
3258 )
3259{
3260 CALL_CRYPTO_SERVICE (ImageTimestampVerify, (AuthData, DataSize, TsaCert, CertSize, SigningTime), FALSE);
3261}
3262
3263// =====================================================================================
3264// DH Key Exchange Primitive
3265// =====================================================================================
3266
3275VOID *
3276EFIAPI
3278 VOID
3279 )
3280{
3282}
3283
3292VOID
3293EFIAPI
3295 IN VOID *DhContext
3296 )
3297{
3298 CALL_VOID_CRYPTO_SERVICE (DhFree, (DhContext));
3299}
3300
3325BOOLEAN
3326EFIAPI
3328 IN OUT VOID *DhContext,
3330 IN UINTN PrimeLength,
3331 OUT UINT8 *Prime
3332 )
3333{
3334 CALL_CRYPTO_SERVICE (DhGenerateParameter, (DhContext, Generator, PrimeLength, Prime), FALSE);
3335}
3336
3360BOOLEAN
3361EFIAPI
3363 IN OUT VOID *DhContext,
3365 IN UINTN PrimeLength,
3366 IN CONST UINT8 *Prime
3367 )
3368{
3369 CALL_CRYPTO_SERVICE (DhSetParameter, (DhContext, Generator, PrimeLength, Prime), FALSE);
3370}
3371
3396BOOLEAN
3397EFIAPI
3399 IN OUT VOID *DhContext,
3400 OUT UINT8 *PublicKey,
3401 IN OUT UINTN *PublicKeySize
3402 )
3403{
3404 CALL_CRYPTO_SERVICE (DhGenerateKey, (DhContext, PublicKey, PublicKeySize), FALSE);
3405}
3406
3433BOOLEAN
3434EFIAPI
3436 IN OUT VOID *DhContext,
3437 IN CONST UINT8 *PeerPublicKey,
3438 IN UINTN PeerPublicKeySize,
3439 OUT UINT8 *Key,
3440 IN OUT UINTN *KeySize
3441 )
3442{
3443 CALL_CRYPTO_SERVICE (DhComputeKey, (DhContext, PeerPublicKey, PeerPublicKeySize, Key, KeySize), FALSE);
3444}
3445
3446// =====================================================================================
3447// Pseudo-Random Generation Primitive
3448// =====================================================================================
3449
3468BOOLEAN
3469EFIAPI
3471 IN CONST UINT8 *Seed OPTIONAL,
3472 IN UINTN SeedSize
3473 )
3474{
3475 CALL_CRYPTO_SERVICE (RandomSeed, (Seed, SeedSize), FALSE);
3476}
3477
3492BOOLEAN
3493EFIAPI
3495 OUT UINT8 *Output,
3496 IN UINTN Size
3497 )
3498{
3499 CALL_CRYPTO_SERVICE (RandomBytes, (Output, Size), FALSE);
3500}
3501
3502// =====================================================================================
3503// Key Derivation Function Primitive
3504// =====================================================================================
3505
3522BOOLEAN
3523EFIAPI
3525 IN CONST UINT8 *Key,
3526 IN UINTN KeySize,
3527 IN CONST UINT8 *Salt,
3528 IN UINTN SaltSize,
3529 IN CONST UINT8 *Info,
3530 IN UINTN InfoSize,
3531 OUT UINT8 *Out,
3532 IN UINTN OutSize
3533 )
3534{
3535 CALL_CRYPTO_SERVICE (HkdfSha256ExtractAndExpand, (Key, KeySize, Salt, SaltSize, Info, InfoSize, Out, OutSize), FALSE);
3536}
3537
3552BOOLEAN
3553EFIAPI
3555 IN CONST UINT8 *Key,
3556 IN UINTN KeySize,
3557 IN CONST UINT8 *Salt,
3558 IN UINTN SaltSize,
3559 OUT UINT8 *PrkOut,
3560 UINTN PrkOutSize
3561 )
3562{
3563 CALL_CRYPTO_SERVICE (HkdfSha256Extract, (Key, KeySize, Salt, SaltSize, PrkOut, PrkOutSize), FALSE);
3564}
3565
3580BOOLEAN
3581EFIAPI
3583 IN CONST UINT8 *Prk,
3584 IN UINTN PrkSize,
3585 IN CONST UINT8 *Info,
3586 IN UINTN InfoSize,
3587 OUT UINT8 *Out,
3588 IN UINTN OutSize
3589 )
3590{
3591 CALL_CRYPTO_SERVICE (HkdfSha256Expand, (Prk, PrkSize, Info, InfoSize, Out, OutSize), FALSE);
3592}
3593
3610BOOLEAN
3611EFIAPI
3613 IN CONST UINT8 *Key,
3614 IN UINTN KeySize,
3615 IN CONST UINT8 *Salt,
3616 IN UINTN SaltSize,
3617 IN CONST UINT8 *Info,
3618 IN UINTN InfoSize,
3619 OUT UINT8 *Out,
3620 IN UINTN OutSize
3621 )
3622{
3623 CALL_CRYPTO_SERVICE (HkdfSha384ExtractAndExpand, (Key, KeySize, Salt, SaltSize, Info, InfoSize, Out, OutSize), FALSE);
3624}
3625
3640BOOLEAN
3641EFIAPI
3643 IN CONST UINT8 *Key,
3644 IN UINTN KeySize,
3645 IN CONST UINT8 *Salt,
3646 IN UINTN SaltSize,
3647 OUT UINT8 *PrkOut,
3648 UINTN PrkOutSize
3649 )
3650{
3651 CALL_CRYPTO_SERVICE (HkdfSha384Extract, (Key, KeySize, Salt, SaltSize, PrkOut, PrkOutSize), FALSE);
3652}
3653
3668BOOLEAN
3669EFIAPI
3671 IN CONST UINT8 *Prk,
3672 IN UINTN PrkSize,
3673 IN CONST UINT8 *Info,
3674 IN UINTN InfoSize,
3675 OUT UINT8 *Out,
3676 IN UINTN OutSize
3677 )
3678{
3679 CALL_CRYPTO_SERVICE (HkdfSha384Expand, (Prk, PrkSize, Info, InfoSize, Out, OutSize), FALSE);
3680}
3681
3693BOOLEAN
3694EFIAPI
3696 VOID
3697 )
3698{
3700}
3701
3708VOID
3709EFIAPI
3711 IN VOID *TlsCtx
3712 )
3713{
3715}
3716
3728VOID *
3729EFIAPI
3731 IN UINT8 MajorVer,
3732 IN UINT8 MinorVer
3733 )
3734{
3735 CALL_CRYPTO_SERVICE (TlsCtxNew, (MajorVer, MinorVer), NULL);
3736}
3737
3747VOID
3748EFIAPI
3750 IN VOID *Tls
3751 )
3752{
3754}
3755
3769VOID *
3770EFIAPI
3772 IN VOID *TlsCtx
3773 )
3774{
3775 CALL_CRYPTO_SERVICE (TlsNew, (TlsCtx), NULL);
3776}
3777
3789BOOLEAN
3790EFIAPI
3792 IN VOID *Tls
3793 )
3794{
3796}
3797
3825EFIAPI
3827 IN VOID *Tls,
3828 IN UINT8 *BufferIn OPTIONAL,
3829 IN UINTN BufferInSize OPTIONAL,
3830 OUT UINT8 *BufferOut OPTIONAL,
3831 IN OUT UINTN *BufferOutSize
3832 )
3833{
3834 CALL_CRYPTO_SERVICE (TlsDoHandshake, (Tls, BufferIn, BufferInSize, BufferOut, BufferOutSize), EFI_UNSUPPORTED);
3835}
3836
3863EFIAPI
3865 IN VOID *Tls,
3866 IN UINT8 *BufferIn OPTIONAL,
3867 IN UINTN BufferInSize OPTIONAL,
3868 OUT UINT8 *BufferOut OPTIONAL,
3869 IN OUT UINTN *BufferOutSize
3870 )
3871{
3872 CALL_CRYPTO_SERVICE (TlsHandleAlert, (Tls, BufferIn, BufferInSize, BufferOut, BufferOutSize), EFI_UNSUPPORTED);
3873}
3874
3894EFIAPI
3896 IN VOID *Tls,
3897 IN OUT UINT8 *Buffer,
3898 IN OUT UINTN *BufferSize
3899 )
3900{
3901 CALL_CRYPTO_SERVICE (TlsCloseNotify, (Tls, Buffer, BufferSize), EFI_UNSUPPORTED);
3902}
3903
3918INTN
3919EFIAPI
3921 IN VOID *Tls,
3922 IN OUT VOID *Buffer,
3923 IN UINTN BufferSize
3924 )
3925{
3926 CALL_CRYPTO_SERVICE (TlsCtrlTrafficOut, (Tls, Buffer, BufferSize), 0);
3927}
3928
3943INTN
3944EFIAPI
3946 IN VOID *Tls,
3947 IN VOID *Buffer,
3948 IN UINTN BufferSize
3949 )
3950{
3951 CALL_CRYPTO_SERVICE (TlsCtrlTrafficIn, (Tls, Buffer, BufferSize), 0);
3952}
3953
3969INTN
3970EFIAPI
3972 IN VOID *Tls,
3973 IN OUT VOID *Buffer,
3974 IN UINTN BufferSize
3975 )
3976{
3977 CALL_CRYPTO_SERVICE (TlsRead, (Tls, Buffer, BufferSize), 0);
3978}
3979
3995INTN
3996EFIAPI
3998 IN VOID *Tls,
3999 IN VOID *Buffer,
4000 IN UINTN BufferSize
4001 )
4002{
4003 CALL_CRYPTO_SERVICE (TlsWrite, (Tls, Buffer, BufferSize), 0);
4004}
4005
4020EFIAPI
4022 IN VOID *Tls
4023 )
4024{
4025 CALL_CRYPTO_SERVICE (TlsShutdown, (Tls), EFI_UNSUPPORTED);
4026}
4027
4043EFIAPI
4045 IN VOID *Tls,
4046 IN UINT8 MajorVer,
4047 IN UINT8 MinorVer
4048 )
4049{
4050 CALL_CRYPTO_SERVICE (TlsSetVersion, (Tls, MajorVer, MinorVer), EFI_UNSUPPORTED);
4051}
4052
4067EFIAPI
4069 IN VOID *Tls,
4070 IN BOOLEAN IsServer
4071 )
4072{
4073 CALL_CRYPTO_SERVICE (TlsSetConnectionEnd, (Tls, IsServer), EFI_UNSUPPORTED);
4074}
4075
4095EFIAPI
4097 IN VOID *Tls,
4098 IN UINT16 *CipherId,
4099 IN UINTN CipherNum
4100 )
4101{
4102 CALL_CRYPTO_SERVICE (TlsSetCipherList, (Tls, CipherId, CipherNum), EFI_UNSUPPORTED);
4103}
4104
4118EFIAPI
4120 IN UINT8 CompMethod
4121 )
4122{
4123 CALL_CRYPTO_SERVICE (TlsSetCompressionMethod, (CompMethod), EFI_UNSUPPORTED);
4124}
4125
4135VOID
4136EFIAPI
4138 IN VOID *Tls,
4139 IN UINT32 VerifyMode
4140 )
4141{
4142 CALL_VOID_CRYPTO_SERVICE (TlsSetVerify, (Tls, VerifyMode));
4143}
4144
4158EFIAPI
4160 IN VOID *Tls,
4161 IN UINT32 Flags,
4162 IN CHAR8 *HostName
4163 )
4164{
4165 CALL_CRYPTO_SERVICE (TlsSetVerifyHost, (Tls, Flags, HostName), EFI_UNSUPPORTED);
4166}
4167
4184EFIAPI
4186 IN VOID *Tls,
4187 IN UINT8 *SessionId,
4188 IN UINT16 SessionIdLen
4189 )
4190{
4191 CALL_CRYPTO_SERVICE (TlsSetSessionId, (Tls, SessionId, SessionIdLen), EFI_UNSUPPORTED);
4192}
4193
4212EFIAPI
4214 IN VOID *Tls,
4215 IN VOID *Data,
4216 IN UINTN DataSize
4217 )
4218{
4219 CALL_CRYPTO_SERVICE (TlsSetCaCertificate, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4220}
4221
4240EFIAPI
4242 IN VOID *Tls,
4243 IN VOID *Data,
4244 IN UINTN DataSize
4245 )
4246{
4247 CALL_CRYPTO_SERVICE (TlsSetHostPublicCert, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4248}
4249
4269EFIAPI
4271 IN VOID *Tls,
4272 IN VOID *Data,
4273 IN UINTN DataSize,
4274 IN VOID *Password OPTIONAL
4275 )
4276{
4277 CALL_CRYPTO_SERVICE (TlsSetHostPrivateKeyEx, (Tls, Data, DataSize, Password), EFI_UNSUPPORTED);
4278}
4279
4297EFIAPI
4299 IN VOID *Tls,
4300 IN VOID *Data,
4301 IN UINTN DataSize
4302 )
4303{
4304 CALL_CRYPTO_SERVICE (TlsSetHostPrivateKey, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4305}
4306
4322EFIAPI
4324 IN VOID *Data,
4325 IN UINTN DataSize
4326 )
4327{
4328 CALL_CRYPTO_SERVICE (TlsSetCertRevocationList, (Data, DataSize), EFI_UNSUPPORTED);
4329}
4330
4349EFIAPI
4351 IN VOID *Tls,
4352 IN UINT8 *Data,
4353 IN UINTN DataSize
4354 )
4355{
4356 CALL_CRYPTO_SERVICE (TlsSetSignatureAlgoList, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4357}
4358
4374EFIAPI
4376 IN VOID *Tls,
4377 IN UINT8 *Data,
4378 IN UINTN DataSize
4379 )
4380{
4381 CALL_CRYPTO_SERVICE (TlsSetSignatureAlgoList, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4382}
4383
4397UINT16
4398EFIAPI
4400 IN VOID *Tls
4401 )
4402{
4404}
4405
4419UINT8
4420EFIAPI
4422 IN VOID *Tls
4423 )
4424{
4426}
4427
4443EFIAPI
4445 IN VOID *Tls,
4446 IN OUT UINT16 *CipherId
4447 )
4448{
4449 CALL_CRYPTO_SERVICE (TlsGetCurrentCipher, (Tls, CipherId), EFI_UNSUPPORTED);
4450}
4451
4469EFIAPI
4471 IN VOID *Tls,
4472 IN OUT UINT8 *CompressionId
4473 )
4474{
4475 CALL_CRYPTO_SERVICE (TlsGetCurrentCompressionId, (Tls, CompressionId), EFI_UNSUPPORTED);
4476}
4477
4491UINT32
4492EFIAPI
4494 IN VOID *Tls
4495 )
4496{
4498}
4499
4516EFIAPI
4518 IN VOID *Tls,
4519 IN OUT UINT8 *SessionId,
4520 IN OUT UINT16 *SessionIdLen
4521 )
4522{
4523 CALL_CRYPTO_SERVICE (TlsGetSessionId, (Tls, SessionId, SessionIdLen), EFI_UNSUPPORTED);
4524}
4525
4537VOID
4538EFIAPI
4540 IN VOID *Tls,
4541 IN OUT UINT8 *ClientRandom
4542 )
4543{
4544 CALL_VOID_CRYPTO_SERVICE (TlsGetClientRandom, (Tls, ClientRandom));
4545}
4546
4558VOID
4559EFIAPI
4561 IN VOID *Tls,
4562 IN OUT UINT8 *ServerRandom
4563 )
4564{
4565 CALL_VOID_CRYPTO_SERVICE (TlsGetServerRandom, (Tls, ServerRandom));
4566}
4567
4583EFIAPI
4585 IN VOID *Tls,
4586 IN OUT UINT8 *KeyMaterial
4587 )
4588{
4589 CALL_CRYPTO_SERVICE (TlsGetKeyMaterial, (Tls, KeyMaterial), EFI_UNSUPPORTED);
4590}
4591
4609EFIAPI
4611 IN VOID *Tls,
4612 OUT VOID *Data,
4613 IN OUT UINTN *DataSize
4614 )
4615{
4616 CALL_CRYPTO_SERVICE (TlsGetCaCertificate, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4617}
4618
4637EFIAPI
4639 IN VOID *Tls,
4640 OUT VOID *Data,
4641 IN OUT UINTN *DataSize
4642 )
4643{
4644 CALL_CRYPTO_SERVICE (TlsGetHostPublicCert, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4645}
4646
4664EFIAPI
4666 IN VOID *Tls,
4667 OUT VOID *Data,
4668 IN OUT UINTN *DataSize
4669 )
4670{
4671 CALL_CRYPTO_SERVICE (TlsGetHostPrivateKey, (Tls, Data, DataSize), EFI_UNSUPPORTED);
4672}
4673
4690EFIAPI
4692 OUT VOID *Data,
4693 IN OUT UINTN *DataSize
4694 )
4695{
4696 CALL_CRYPTO_SERVICE (TlsGetCertRevocationList, (Data, DataSize), EFI_UNSUPPORTED);
4697}
4698
4718EFIAPI
4720 IN VOID *Tls,
4721 IN CONST VOID *Label,
4722 IN CONST VOID *Context,
4723 IN UINTN ContextLen,
4724 OUT VOID *KeyBuffer,
4725 IN UINTN KeyBufferLen
4726 )
4727{
4730 (Tls, Label, Context, ContextLen,
4731 KeyBuffer, KeyBufferLen),
4732 EFI_UNSUPPORTED
4733 );
4734}
4735
4736// =====================================================================================
4737// Big number primitive
4738// =====================================================================================
4739
4745VOID *
4746EFIAPI
4748 VOID
4749 )
4750{
4752}
4753
4762VOID *
4763EFIAPI
4765 IN CONST UINT8 *Buf,
4766 IN UINTN Len
4767 )
4768{
4769 CALL_CRYPTO_SERVICE (BigNumFromBin, (Buf, Len), NULL);
4770}
4771
4781INTN
4782EFIAPI
4784 IN CONST VOID *Bn,
4785 OUT UINT8 *Buf
4786 )
4787{
4788 CALL_CRYPTO_SERVICE (BigNumToBin, (Bn, Buf), -1);
4789}
4790
4797VOID
4798EFIAPI
4800 IN VOID *Bn,
4801 IN BOOLEAN Clear
4802 )
4803{
4804 CALL_VOID_CRYPTO_SERVICE (BigNumFree, (Bn, Clear));
4805}
4806
4819BOOLEAN
4820EFIAPI
4822 IN CONST VOID *BnA,
4823 IN CONST VOID *BnB,
4824 OUT VOID *BnRes
4825 )
4826{
4827 CALL_CRYPTO_SERVICE (BigNumAdd, (BnA, BnB, BnRes), FALSE);
4828}
4829
4842BOOLEAN
4843EFIAPI
4845 IN CONST VOID *BnA,
4846 IN CONST VOID *BnB,
4847 OUT VOID *BnRes
4848 )
4849{
4850 CALL_CRYPTO_SERVICE (BigNumSub, (BnA, BnB, BnRes), FALSE);
4851}
4852
4865BOOLEAN
4866EFIAPI
4868 IN CONST VOID *BnA,
4869 IN CONST VOID *BnB,
4870 OUT VOID *BnRes
4871 )
4872{
4873 CALL_CRYPTO_SERVICE (BigNumMod, (BnA, BnB, BnRes), FALSE);
4874}
4875
4889BOOLEAN
4890EFIAPI
4892 IN CONST VOID *BnA,
4893 IN CONST VOID *BnP,
4894 IN CONST VOID *BnM,
4895 OUT VOID *BnRes
4896 )
4897{
4898 CALL_CRYPTO_SERVICE (BigNumExpMod, (BnA, BnP, BnM, BnRes), FALSE);
4899}
4900
4913BOOLEAN
4914EFIAPI
4916 IN CONST VOID *BnA,
4917 IN CONST VOID *BnM,
4918 OUT VOID *BnRes
4919 )
4920{
4921 CALL_CRYPTO_SERVICE (BigNumInverseMod, (BnA, BnM, BnRes), FALSE);
4922}
4923
4936BOOLEAN
4937EFIAPI
4939 IN CONST VOID *BnA,
4940 IN CONST VOID *BnB,
4941 OUT VOID *BnRes
4942 )
4943{
4944 CALL_CRYPTO_SERVICE (BigNumDiv, (BnA, BnB, BnRes), FALSE);
4945}
4946
4960BOOLEAN
4961EFIAPI
4963 IN CONST VOID *BnA,
4964 IN CONST VOID *BnB,
4965 IN CONST VOID *BnM,
4966 OUT VOID *BnRes
4967 )
4968{
4969 CALL_CRYPTO_SERVICE (BigNumMulMod, (BnA, BnB, BnM, BnRes), FALSE);
4970}
4971
4982INTN
4983EFIAPI
4985 IN CONST VOID *BnA,
4986 IN CONST VOID *BnB
4987 )
4988{
4989 CALL_CRYPTO_SERVICE (BigNumCmp, (BnA, BnB), 0);
4990}
4991
4999UINTN
5000EFIAPI
5002 IN CONST VOID *Bn
5003 )
5004{
5006}
5007
5015UINTN
5016EFIAPI
5018 IN CONST VOID *Bn
5019 )
5020{
5022}
5023
5033BOOLEAN
5034EFIAPI
5036 IN CONST VOID *Bn,
5037 IN UINTN Num
5038 )
5039{
5041}
5042
5051BOOLEAN
5052EFIAPI
5054 IN CONST VOID *Bn
5055 )
5056{
5058}
5059
5069VOID *
5070EFIAPI
5072 OUT VOID *BnDst,
5073 IN CONST VOID *BnSrc
5074 )
5075{
5076 CALL_CRYPTO_SERVICE (BigNumCopy, (BnDst, BnSrc), NULL);
5077}
5078
5085CONST VOID *
5086EFIAPI
5088 VOID
5089 )
5090{
5092}
5093
5106BOOLEAN
5107EFIAPI
5109 IN CONST VOID *Bn,
5110 IN UINTN N,
5111 OUT VOID *BnRes
5112 )
5113{
5114 CALL_CRYPTO_SERVICE (BigNumRShift, (Bn, N, BnRes), FALSE);
5115}
5116
5124VOID
5125EFIAPI
5127 IN VOID *Bn
5128 )
5129{
5131}
5132
5145BOOLEAN
5146EFIAPI
5148 IN CONST VOID *BnA,
5149 IN CONST VOID *BnM,
5150 OUT VOID *BnRes
5151 )
5152{
5153 CALL_CRYPTO_SERVICE (BigNumSqrMod, (BnA, BnM, BnRes), FALSE);
5154}
5155
5163VOID *
5164EFIAPI
5166 VOID
5167 )
5168{
5170}
5171
5177VOID
5178EFIAPI
5180 IN VOID *BnCtx
5181 )
5182{
5184}
5185
5195BOOLEAN
5196EFIAPI
5198 IN VOID *Bn,
5199 IN UINTN Val
5200 )
5201{
5203}
5204
5216BOOLEAN
5217EFIAPI
5219 IN CONST VOID *BnA,
5220 IN CONST VOID *BnB,
5221 IN CONST VOID *BnM,
5222 OUT VOID *BnRes
5223 )
5224{
5225 CALL_CRYPTO_SERVICE (BigNumAddMod, (BnA, BnB, BnM, BnRes), FALSE);
5226}
5227
5239VOID *
5240EFIAPI
5242 IN UINTN CryptoNid
5243 )
5244{
5245 CALL_CRYPTO_SERVICE (EcGroupInit, (CryptoNid), NULL);
5246}
5247
5263BOOLEAN
5264EFIAPI
5266 IN CONST VOID *EcGroup,
5267 OUT VOID *BnPrime,
5268 OUT VOID *BnA,
5269 OUT VOID *BnB,
5270 IN VOID *BnCtx
5271 )
5272{
5273 CALL_CRYPTO_SERVICE (EcGroupGetCurve, (EcGroup, BnPrime, BnA, BnB, BnCtx), FALSE);
5274}
5275
5288BOOLEAN
5289EFIAPI
5291 IN VOID *EcGroup,
5292 OUT VOID *BnOrder
5293 )
5294{
5295 CALL_CRYPTO_SERVICE (EcGroupGetOrder, (EcGroup, BnOrder), FALSE);
5296}
5297
5303VOID
5304EFIAPI
5306 IN VOID *EcGroup
5307 )
5308{
5310}
5311
5321VOID *
5322EFIAPI
5324 IN CONST VOID *EcGroup
5325 )
5326{
5327 CALL_CRYPTO_SERVICE (EcPointInit, (EcGroup), NULL);
5328}
5329
5336VOID
5337EFIAPI
5339 IN VOID *EcPoint,
5340 IN BOOLEAN Clear
5341 )
5342{
5343 CALL_VOID_CRYPTO_SERVICE (EcPointDeInit, (EcPoint, Clear));
5344}
5345
5361BOOLEAN
5362EFIAPI
5364 IN CONST VOID *EcGroup,
5365 IN CONST VOID *EcPoint,
5366 OUT VOID *BnX,
5367 OUT VOID *BnY,
5368 IN VOID *BnCtx
5369 )
5370{
5371 CALL_CRYPTO_SERVICE (EcPointGetAffineCoordinates, (EcGroup, EcPoint, BnX, BnY, BnCtx), FALSE);
5372}
5373
5386BOOLEAN
5387EFIAPI
5389 IN CONST VOID *EcGroup,
5390 IN VOID *EcPoint,
5391 IN CONST VOID *BnX,
5392 IN CONST VOID *BnY,
5393 IN VOID *BnCtx
5394 )
5395{
5396 CALL_CRYPTO_SERVICE (EcPointSetAffineCoordinates, (EcGroup, EcPoint, BnX, BnY, BnCtx), FALSE);
5397}
5398
5412BOOLEAN
5413EFIAPI
5415 IN CONST VOID *EcGroup,
5416 OUT VOID *EcPointResult,
5417 IN CONST VOID *EcPointA,
5418 IN CONST VOID *EcPointB,
5419 IN VOID *BnCtx
5420 )
5421{
5422 CALL_CRYPTO_SERVICE (EcPointAdd, (EcGroup, EcPointResult, EcPointA, EcPointB, BnCtx), FALSE);
5423}
5424
5438BOOLEAN
5439EFIAPI
5441 IN CONST VOID *EcGroup,
5442 OUT VOID *EcPointResult,
5443 IN CONST VOID *EcPoint,
5444 IN CONST VOID *BnPScalar,
5445 IN VOID *BnCtx
5446 )
5447{
5448 CALL_CRYPTO_SERVICE (EcPointMul, (EcGroup, EcPointResult, EcPoint, BnPScalar, BnCtx), FALSE);
5449}
5450
5461BOOLEAN
5462EFIAPI
5464 IN CONST VOID *EcGroup,
5465 IN OUT VOID *EcPoint,
5466 IN VOID *BnCtx
5467 )
5468{
5469 CALL_CRYPTO_SERVICE (EcPointInvert, (EcGroup, EcPoint, BnCtx), FALSE);
5470}
5471
5482BOOLEAN
5483EFIAPI
5485 IN CONST VOID *EcGroup,
5486 IN CONST VOID *EcPoint,
5487 IN VOID *BnCtx
5488 )
5489{
5490 CALL_CRYPTO_SERVICE (EcPointIsOnCurve, (EcGroup, EcPoint, BnCtx), FALSE);
5491}
5492
5502BOOLEAN
5503EFIAPI
5505 IN CONST VOID *EcGroup,
5506 IN CONST VOID *EcPoint
5507 )
5508{
5509 CALL_CRYPTO_SERVICE (EcPointIsAtInfinity, (EcGroup, EcPoint), FALSE);
5510}
5511
5523BOOLEAN
5524EFIAPI
5526 IN CONST VOID *EcGroup,
5527 IN CONST VOID *EcPointA,
5528 IN CONST VOID *EcPointB,
5529 IN VOID *BnCtx
5530 )
5531{
5532 CALL_CRYPTO_SERVICE (EcPointEqual, (EcGroup, EcPointA, EcPointB, BnCtx), FALSE);
5533}
5534
5552BOOLEAN
5553EFIAPI
5555 IN CONST VOID *EcGroup,
5556 IN VOID *EcPoint,
5557 IN CONST VOID *BnX,
5558 IN UINT8 YBit,
5559 IN VOID *BnCtx
5560 )
5561{
5562 CALL_CRYPTO_SERVICE (EcPointSetCompressedCoordinates, (EcGroup, EcPoint, BnX, YBit, BnCtx), FALSE);
5563}
5564
5573VOID *
5574EFIAPI
5576 IN UINTN Nid
5577 )
5578{
5580}
5581
5587VOID
5588EFIAPI
5590 IN VOID *EcContext
5591 )
5592{
5593 CALL_VOID_CRYPTO_SERVICE (EcFree, (EcContext));
5594}
5595
5622BOOLEAN
5623EFIAPI
5625 IN OUT VOID *EcContext,
5626 OUT UINT8 *PublicKey,
5627 IN OUT UINTN *PublicKeySize
5628 )
5629{
5630 CALL_CRYPTO_SERVICE (EcGenerateKey, (EcContext, PublicKey, PublicKeySize), FALSE);
5631}
5632
5647BOOLEAN
5648EFIAPI
5650 IN OUT VOID *EcContext,
5651 OUT UINT8 *PublicKey,
5652 IN OUT UINTN *PublicKeySize
5653 )
5654{
5655 CALL_CRYPTO_SERVICE (EcGetPubKey, (EcContext, PublicKey, PublicKeySize), FALSE);
5656}
5657
5683BOOLEAN
5684EFIAPI
5686 IN OUT VOID *EcContext,
5687 IN CONST UINT8 *PeerPublic,
5688 IN UINTN PeerPublicSize,
5689 IN CONST INT32 *CompressFlag,
5690 OUT UINT8 *Key,
5691 IN OUT UINTN *KeySize
5692 )
5693{
5694 CALL_CRYPTO_SERVICE (EcDhComputeKey, (EcContext, PeerPublic, PeerPublicSize, CompressFlag, Key, KeySize), FALSE);
5695}
5696
5713BOOLEAN
5714EFIAPI
5716 IN CONST UINT8 *Cert,
5717 IN UINTN CertSize,
5718 OUT VOID **EcContext
5719 )
5720{
5721 CALL_CRYPTO_SERVICE (EcGetPublicKeyFromX509, (Cert, CertSize, EcContext), FALSE);
5722}
5723
5741BOOLEAN
5742EFIAPI
5744 IN CONST UINT8 *PemData,
5745 IN UINTN PemSize,
5746 IN CONST CHAR8 *Password,
5747 OUT VOID **EcContext
5748 )
5749{
5750 CALL_CRYPTO_SERVICE (EcGetPrivateKeyFromPem, (PemData, PemSize, Password, EcContext), FALSE);
5751}
5752
5782BOOLEAN
5783EFIAPI
5785 IN VOID *EcContext,
5786 IN UINTN HashNid,
5787 IN CONST UINT8 *MessageHash,
5788 IN UINTN HashSize,
5789 OUT UINT8 *Signature,
5790 IN OUT UINTN *SigSize
5791 )
5792{
5793 CALL_CRYPTO_SERVICE (EcDsaSign, (EcContext, HashNid, MessageHash, HashSize, Signature, SigSize), FALSE);
5794}
5795
5819BOOLEAN
5820EFIAPI
5822 IN VOID *EcContext,
5823 IN UINTN HashNid,
5824 IN CONST UINT8 *MessageHash,
5825 IN UINTN HashSize,
5826 IN CONST UINT8 *Signature,
5827 IN UINTN SigSize
5828 )
5829{
5830 CALL_CRYPTO_SERVICE (EcDsaVerify, (EcContext, HashNid, MessageHash, HashSize, Signature, SigSize), FALSE);
5831}
UINT64 UINTN
INT64 INTN
RSA_KEY_TAG
Definition: BaseCryptLib.h:74
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)
Definition: CryptLib.c:1961
BOOLEAN EFIAPI X509GetSerialNumber(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *SerialNumber, OPTIONAL IN OUT UINTN *SerialNumberSize)
Definition: CryptLib.c:2377
BOOLEAN EFIAPI HmacSha384Update(IN OUT VOID *HmacSha384Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:1342
BOOLEAN EFIAPI EcPointInvert(IN CONST VOID *EcGroup, IN OUT VOID *EcPoint, IN VOID *BnCtx)
Definition: CryptLib.c:5463
BOOLEAN EFIAPI RsaCheckKey(IN VOID *RsaContext)
Definition: CryptLib.c:1817
VOID EFIAPI TlsGetServerRandom(IN VOID *Tls, IN OUT UINT8 *ServerRandom)
Definition: CryptLib.c:4560
BOOLEAN EFIAPI EcPointSetCompressedCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN UINT8 YBit, IN VOID *BnCtx)
Definition: CryptLib.c:5554
BOOLEAN EFIAPI BigNumExpMod(IN CONST VOID *BnA, IN CONST VOID *BnP, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptLib.c:4891
INT32 EFIAPI X509CompareDateTime(IN CONST VOID *DateTime1, IN CONST VOID *DateTime2)
Definition: CryptLib.c:2598
BOOLEAN EFIAPI AesInit(OUT VOID *AesContext, IN CONST UINT8 *Key, IN UINTN KeyLength)
Definition: CryptLib.c:1462
BOOLEAN EFIAPI EcPointMul(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPoint, IN CONST VOID *BnPScalar, IN VOID *BnCtx)
Definition: CryptLib.c:5440
UINTN EFIAPI Sha256GetContextSize(VOID)
Definition: CryptLib.c:434
BOOLEAN EFIAPI HmacSha384SetKey(OUT VOID *HmacSha384Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: CryptLib.c:1286
BOOLEAN EFIAPI HkdfSha256Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
Definition: CryptLib.c:3554
BOOLEAN EFIAPI EcPointAdd(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: CryptLib.c:5414
BOOLEAN EFIAPI EcGenerateKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptLib.c:5624
#define CALL_VOID_CRYPTO_SERVICE(Function, Args)
Definition: CryptLib.c:50
BOOLEAN EFIAPI EcPointIsOnCurve(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, IN VOID *BnCtx)
Definition: CryptLib.c:5484
EFI_STATUS EFIAPI TlsGetHostPublicCert(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: CryptLib.c:4638
BOOLEAN EFIAPI DhGenerateParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, OUT UINT8 *Prime)
Definition: CryptLib.c:3327
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)
Definition: CryptLib.c:2769
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
VOID *EFIAPI HmacSha256New(VOID)
Definition: CryptLib.c:1067
BOOLEAN EFIAPI BigNumMulMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptLib.c:4962
UINTN EFIAPI Sha384GetContextSize(VOID)
Definition: CryptLib.c:583
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
BOOLEAN EFIAPI Sha512HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptLib.c:864
BOOLEAN EFIAPI Sm3Duplicate(IN CONST VOID *Sm3Context, OUT VOID *NewSm3Context)
Definition: CryptLib.c:958
BOOLEAN EFIAPI HmacSha256Duplicate(IN CONST VOID *HmacSha256Context, OUT VOID *NewHmacSha256Context)
Definition: CryptLib.c:1133
BOOLEAN EFIAPI Sha512Final(IN OUT VOID *Sha512Context, OUT UINT8 *HashValue)
Definition: CryptLib.c:836
EFI_STATUS EFIAPI TlsGetKeyMaterial(IN VOID *Tls, IN OUT UINT8 *KeyMaterial)
Definition: CryptLib.c:4584
BOOLEAN EFIAPI BigNumInverseMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptLib.c:4915
VOID *EFIAPI HmacSha384New(VOID)
Definition: CryptLib.c:1246
VOID *EFIAPI BigNumFromBin(IN CONST UINT8 *Buf, IN UINTN Len)
Definition: CryptLib.c:4764
BOOLEAN EFIAPI X509GetVersion(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Version)
Definition: CryptLib.c:2343
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: CryptLib.c:2470
BOOLEAN EFIAPI BigNumDiv(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptLib.c:4938
UINT32 EFIAPI TlsGetVerify(IN VOID *Tls)
Definition: CryptLib.c:4493
BOOLEAN EFIAPI EcPointIsAtInfinity(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint)
Definition: CryptLib.c:5504
BOOLEAN EFIAPI EcGetPubKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptLib.c:5649
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)
Definition: CryptLib.c:3064
BOOLEAN EFIAPI Sha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context)
Definition: CryptLib.c:628
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
BOOLEAN EFIAPI X509ConstructCertificateStack(IN OUT UINT8 **X509Stack,...)
Definition: CryptLib.c:2219
BOOLEAN EFIAPI HmacSha384All(IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue)
Definition: CryptLib.c:1405
VOID *EFIAPI DhNew(VOID)
Definition: CryptLib.c:3277
UINTN EFIAPI Sm3GetContextSize(VOID)
Definition: CryptLib.c:913
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
BOOLEAN EFIAPI X509GetIssuerName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *CertIssuer, IN OUT UINTN *CertIssuerSize)
Definition: CryptLib.c:2408
VOID *EFIAPI RsaNew(VOID)
Definition: CryptLib.c:1661
INTN EFIAPI TlsCtrlTrafficOut(IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
Definition: CryptLib.c:3920
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)
Definition: CryptLib.c:1630
BOOLEAN EFIAPI RsaGetPrivateKeyFromPem(IN CONST UINT8 *PemData, IN UINTN PemSize, IN CONST CHAR8 *Password, OUT VOID **RsaContext)
Definition: CryptLib.c:1995
BOOLEAN EFIAPI BigNumSqrMod(IN CONST VOID *BnA, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptLib.c:5147
UINTN EFIAPI BigNumBits(IN CONST VOID *Bn)
Definition: CryptLib.c:5001
UINTN EFIAPI Sha512GetContextSize(VOID)
Definition: CryptLib.c:732
BOOLEAN EFIAPI Sha1Final(IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
Definition: CryptLib.c:387
BOOLEAN EFIAPI Sm3Update(IN OUT VOID *Sm3Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:986
BOOLEAN EFIAPI EcDsaSign(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: CryptLib.c:5784
VOID EFIAPI HmacSha384Free(IN VOID *HmacSha384Ctx)
Definition: CryptLib.c:1261
BOOLEAN EFIAPI DhGenerateKey(IN OUT VOID *DhContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptLib.c:3398
BOOLEAN EFIAPI X509FormatDateTime(IN CONST CHAR8 *DateTimeStr, OUT VOID *DateTime, IN OUT UINTN *DateTimeSize)
Definition: CryptLib.c:2571
BOOLEAN EFIAPI X509VerifyCert(IN CONST UINT8 *Cert, IN UINTN CertSize, IN CONST UINT8 *CACert, IN UINTN CACertSize)
Definition: CryptLib.c:2161
VOID EFIAPI HmacSha256Free(IN VOID *HmacSha256Ctx)
Definition: CryptLib.c:1082
EFI_STATUS EFIAPI TlsSetCompressionMethod(IN UINT8 CompMethod)
Definition: CryptLib.c:4119
VOID EFIAPI TlsFree(IN VOID *Tls)
Definition: CryptLib.c:3749
VOID EFIAPI DhFree(IN VOID *DhContext)
Definition: CryptLib.c:3294
BOOLEAN EFIAPI Sha512Init(OUT VOID *Sha512Context)
Definition: CryptLib.c:753
BOOLEAN EFIAPI DhSetParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, IN CONST UINT8 *Prime)
Definition: CryptLib.c:3362
BOOLEAN EFIAPI Sm3Final(IN OUT VOID *Sm3Context, OUT UINT8 *HashValue)
Definition: CryptLib.c:1017
EFI_STATUS EFIAPI TlsSetCaCertificate(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:4213
BOOLEAN EFIAPI HmacSha384Duplicate(IN CONST VOID *HmacSha384Context, OUT VOID *NewHmacSha384Context)
Definition: CryptLib.c:1312
BOOLEAN EFIAPI RandomBytes(OUT UINT8 *Output, IN UINTN Size)
Definition: CryptLib.c:3494
EFI_STATUS EFIAPI TlsSetCipherList(IN VOID *Tls, IN UINT16 *CipherId, IN UINTN CipherNum)
Definition: CryptLib.c:4096
UINTN EFIAPI AesGetContextSize(VOID)
Definition: CryptLib.c:1431
VOID *EFIAPI TlsNew(IN VOID *TlsCtx)
Definition: CryptLib.c:3771
BOOLEAN EFIAPI Sha256Init(OUT VOID *Sha256Context)
Definition: CryptLib.c:455
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
VOID *EFIAPI BigNumNewContext(VOID)
Definition: CryptLib.c:5165
BOOLEAN EFIAPI X509GetSignatureAlgorithm(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Oid, OPTIONAL IN OUT UINTN *OidSize)
Definition: CryptLib.c:2438
BOOLEAN EFIAPI RsaGetPublicKeyFromX509(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT VOID **RsaContext)
Definition: CryptLib.c:2025
RETURN_STATUS EFIAPI X509GetOrganizationName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT CHAR8 *NameBuffer OPTIONAL, IN OUT UINTN *NameBufferSize)
Definition: CryptLib.c:2131
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
VOID EFIAPI X509StackFree(IN VOID *X509Stack)
Definition: CryptLib.c:2289
VOID EFIAPI BigNumFree(IN VOID *Bn, IN BOOLEAN Clear)
Definition: CryptLib.c:4799
BOOLEAN EFIAPI Pkcs7GetSigners(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT UINT8 **CertStack, OUT UINTN *StackLength, OUT UINT8 **TrustedCert, OUT UINTN *CertLength)
Definition: CryptLib.c:2970
BOOLEAN EFIAPI Sha1Duplicate(IN CONST VOID *Sha1Context, OUT VOID *NewSha1Context)
Definition: CryptLib.c:324
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)
Definition: CryptLib.c:892
BOOLEAN EFIAPI AuthenticodeVerify(IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN CONST UINT8 *ImageHash, IN UINTN HashSize)
Definition: CryptLib.c:3218
BOOLEAN EFIAPI X509GetExtendedKeyUsage(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Usage, IN OUT UINTN *UsageSize)
Definition: CryptLib.c:2501
BOOLEAN EFIAPI Sha384HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptLib.c:715
VOID *EFIAPI EcNewByNid(IN UINTN Nid)
Definition: CryptLib.c:5575
BOOLEAN EFIAPI Sha256Final(IN OUT VOID *Sha256Context, OUT UINT8 *HashValue)
Definition: CryptLib.c:538
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: CryptLib.c:3612
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)
Definition: CryptLib.c:2814
UINT8 EFIAPI TlsGetConnectionEnd(IN VOID *Tls)
Definition: CryptLib.c:4421
VOID EFIAPI TlsSetVerify(IN VOID *Tls, IN UINT32 VerifyMode)
Definition: CryptLib.c:4137
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: CryptLib.c:2534
BOOLEAN EFIAPI HmacSha384Final(IN OUT VOID *HmacSha384Context, OUT UINT8 *HmacValue)
Definition: CryptLib.c:1375
BOOLEAN EFIAPI Sm3HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptLib.c:1045
VOID EFIAPI TlsCtxFree(IN VOID *TlsCtx)
Definition: CryptLib.c:3710
BOOLEAN EFIAPI BigNumIsWord(IN CONST VOID *Bn, IN UINTN Num)
Definition: CryptLib.c:5035
INTN EFIAPI BigNumCmp(IN CONST VOID *BnA, IN CONST VOID *BnB)
Definition: CryptLib.c:4984
#define CALL_CRYPTO_SERVICE(Function, Args, ErrorReturnValue)
Definition: CryptLib.c:29
VOID *EFIAPI EcPointInit(IN CONST VOID *EcGroup)
Definition: CryptLib.c:5323
VOID *EFIAPI EcGroupInit(IN UINTN CryptoNid)
Definition: CryptLib.c:5241
BOOLEAN EFIAPI Sha384Update(IN OUT VOID *Sha384Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:656
BOOLEAN EFIAPI BigNumAdd(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptLib.c:4821
BOOLEAN EFIAPI Sha256Duplicate(IN CONST VOID *Sha256Context, OUT VOID *NewSha256Context)
Definition: CryptLib.c:479
BOOLEAN EFIAPI HmacSha256SetKey(OUT VOID *HmacSha256Context, IN CONST UINT8 *Key, IN UINTN KeySize)
Definition: CryptLib.c:1107
VOID EFIAPI TlsGetClientRandom(IN VOID *Tls, IN OUT UINT8 *ClientRandom)
Definition: CryptLib.c:4539
BOOLEAN EFIAPI EcGetPrivateKeyFromPem(IN CONST UINT8 *PemData, IN UINTN PemSize, IN CONST CHAR8 *Password, OUT VOID **EcContext)
Definition: CryptLib.c:5743
BOOLEAN EFIAPI Sm3Init(OUT VOID *Sm3Context)
Definition: CryptLib.c:934
BOOLEAN EFIAPI HmacSha256Update(IN OUT VOID *HmacSha256Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:1163
BOOLEAN EFIAPI DhComputeKey(IN OUT VOID *DhContext, IN CONST UINT8 *PeerPublicKey, IN UINTN PeerPublicKeySize, OUT UINT8 *Key, IN OUT UINTN *KeySize)
Definition: CryptLib.c:3435
BOOLEAN EFIAPI Sha1Init(OUT VOID *Sha1Context)
Definition: CryptLib.c:300
INTN EFIAPI TlsRead(IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
Definition: CryptLib.c:3971
BOOLEAN EFIAPI HkdfSha384Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
Definition: CryptLib.c:3642
BOOLEAN EFIAPI Sha256HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptLib.c:566
VOID EFIAPI BigNumConstTime(IN VOID *Bn)
Definition: CryptLib.c:5126
CONST VOID *EFIAPI BigNumValueOne(VOID)
Definition: CryptLib.c:5087
EFI_STATUS EFIAPI TlsShutdown(IN VOID *Tls)
Definition: CryptLib.c:4021
BOOLEAN EFIAPI Sha512Duplicate(IN CONST VOID *Sha512Context, OUT VOID *NewSha512Context)
Definition: CryptLib.c:777
BOOLEAN EFIAPI TlsInHandshake(IN VOID *Tls)
Definition: CryptLib.c:3791
BOOLEAN EFIAPI Asn1GetTag(IN OUT UINT8 **Ptr, IN CONST UINT8 *End, OUT UINTN *Length, IN UINT32 Tag)
Definition: CryptLib.c:2700
BOOLEAN EFIAPI RsaGetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, OUT UINT8 *BigNumber, IN OUT UINTN *BnSize)
Definition: CryptLib.c:1749
BOOLEAN EFIAPI BigNumSetUint(IN VOID *Bn, IN UINTN Val)
Definition: CryptLib.c:5197
EFI_STATUS EFIAPI TlsSetVersion(IN VOID *Tls, IN UINT8 MajorVer, IN UINT8 MinorVer)
Definition: CryptLib.c:4044
VOID EFIAPI BigNumContextFree(IN VOID *BnCtx)
Definition: CryptLib.c:5179
EFI_STATUS EFIAPI TlsSetHostPrivateKeyEx(IN VOID *Tls, IN VOID *Data, IN UINTN DataSize, IN VOID *Password OPTIONAL)
Definition: CryptLib.c:4270
BOOLEAN EFIAPI EcPointEqual(IN CONST VOID *EcGroup, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: CryptLib.c:5525
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
BOOLEAN EFIAPI BigNumIsOdd(IN CONST VOID *Bn)
Definition: CryptLib.c:5053
BOOLEAN EFIAPI BigNumSub(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptLib.c:4844
BOOLEAN EFIAPI RandomSeed(IN CONST UINT8 *Seed OPTIONAL, IN UINTN SeedSize)
Definition: CryptLib.c:3470
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)
Definition: CryptLib.c:2890
BOOLEAN EFIAPI RsaOaepDecrypt(IN VOID *RsaContext, IN UINT8 *EncryptedData, IN UINTN EncryptedDataSize, IN UINT16 DigestLen OPTIONAL, OUT UINT8 **OutData, OUT UINTN *OutDataSize)
Definition: CryptLib.c:2929
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
BOOLEAN EFIAPI RsaSetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, IN CONST UINT8 *BigNumber, IN UINTN BnSize)
Definition: CryptLib.c:1709
BOOLEAN EFIAPI Pkcs7Verify(IN CONST UINT8 *P7Data, IN UINTN P7Length, IN CONST UINT8 *TrustedCert, IN UINTN CertLength, IN CONST UINT8 *InData, IN UINTN DataLength)
Definition: CryptLib.c:3103
RETURN_STATUS EFIAPI VerifyEKUsInPkcs7Signature(IN CONST UINT8 *Pkcs7Signature, IN CONST UINT32 SignatureSize, IN CONST CHAR8 *RequiredEKUs[], IN CONST UINT32 RequiredEKUsSize, IN BOOLEAN RequireAllPresent)
Definition: CryptLib.c:3149
BOOLEAN EFIAPI Sha256Update(IN OUT VOID *Sha256Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:507
VOID *EFIAPI BigNumCopy(OUT VOID *BnDst, IN CONST VOID *BnSrc)
Definition: CryptLib.c:5071
BOOLEAN EFIAPI EcGroupGetCurve(IN CONST VOID *EcGroup, OUT VOID *BnPrime, OUT VOID *BnA, OUT VOID *BnB, IN VOID *BnCtx)
Definition: CryptLib.c:5265
BOOLEAN EFIAPI HmacSha256All(IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue)
Definition: CryptLib.c:1226
BOOLEAN EFIAPI BigNumAddMod(IN CONST VOID *BnA, IN CONST VOID *BnB, IN CONST VOID *BnM, OUT VOID *BnRes)
Definition: CryptLib.c:5218
BOOLEAN EFIAPI EcGetPublicKeyFromX509(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT VOID **EcContext)
Definition: CryptLib.c:5715
BOOLEAN EFIAPI HkdfSha256Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: CryptLib.c:3582
EFI_STATUS EFIAPI TlsGetSessionId(IN VOID *Tls, IN OUT UINT8 *SessionId, IN OUT UINT16 *SessionIdLen)
Definition: CryptLib.c:4517
VOID EFIAPI RsaFree(IN VOID *RsaContext)
Definition: CryptLib.c:1678
UINT16 EFIAPI TlsGetVersion(IN VOID *Tls)
Definition: CryptLib.c:4399
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: CryptLib.c:3524
VOID EFIAPI Pkcs7FreeSigners(IN UINT8 *Certs)
Definition: CryptLib.c:2992
EFI_STATUS EFIAPI TlsSetEcCurve(IN VOID *Tls, IN UINT8 *Data, IN UINTN DataSize)
Definition: CryptLib.c:4375
BOOLEAN EFIAPI BigNumMod(IN CONST VOID *BnA, IN CONST VOID *BnB, OUT VOID *BnRes)
Definition: CryptLib.c:4867
BOOLEAN EFIAPI Pkcs7GetAttachedContent(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT VOID **Content, OUT UINTN *ContentSize)
Definition: CryptLib.c:3182
VOID EFIAPI EcPointDeInit(IN VOID *EcPoint, IN BOOLEAN Clear)
Definition: CryptLib.c:5338
BOOLEAN EFIAPI EcDsaVerify(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
Definition: CryptLib.c:5821
BOOLEAN EFIAPI Sha1HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
Definition: CryptLib.c:415
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
BOOLEAN EFIAPI ImageTimestampVerify(IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TsaCert, IN UINTN CertSize, OUT EFI_TIME *SigningTime)
Definition: CryptLib.c:3252
VOID EFIAPI X509Free(IN VOID *X509Cert)
Definition: CryptLib.c:2272
VOID *EFIAPI BigNumInit(VOID)
Definition: CryptLib.c:4747
UINTN EFIAPI Sha1GetContextSize(VOID)
Definition: CryptLib.c:277
BOOLEAN EFIAPI BigNumRShift(IN CONST VOID *Bn, IN UINTN N, OUT VOID *BnRes)
Definition: CryptLib.c:5108
BOOLEAN EFIAPI Sha384Final(IN OUT VOID *Sha384Context, OUT UINT8 *HashValue)
Definition: CryptLib.c:687
BOOLEAN EFIAPI X509ConstructCertificateStackV(IN OUT UINT8 **X509Stack, IN VA_LIST Args)
Definition: CryptLib.c:2254
BOOLEAN EFIAPI Pkcs1v2Decrypt(IN CONST UINT8 *PrivateKey, IN UINTN PrivateKeySize, IN UINT8 *EncryptedData, IN UINTN EncryptedDataSize, OUT UINT8 **OutData, OUT UINTN *OutDataSize)
Definition: CryptLib.c:2847
BOOLEAN EFIAPI X509GetCertFromCertChain(IN CONST UINT8 *CertChain, IN UINTN CertChainLength, IN CONST INT32 CertIndex, OUT CONST UINT8 **Cert, OUT UINTN *CertLength)
Definition: CryptLib.c:2676
BOOLEAN EFIAPI EcGroupGetOrder(IN VOID *EcGroup, OUT VOID *BnOrder)
Definition: CryptLib.c:5290
UINTN EFIAPI BigNumBytes(IN CONST VOID *Bn)
Definition: CryptLib.c:5017
BOOLEAN EFIAPI X509GetSubjectName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *CertSubject, IN OUT UINTN *SubjectSize)
Definition: CryptLib.c:2055
INTN EFIAPI TlsWrite(IN VOID *Tls, IN VOID *Buffer, IN UINTN BufferSize)
Definition: CryptLib.c:3997
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)
Definition: CryptLib.c:1585
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: CryptLib.c:1916
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: CryptLib.c:5685
BOOLEAN EFIAPI Sha384Init(OUT VOID *Sha384Context)
Definition: CryptLib.c:604
BOOLEAN EFIAPI X509GetKeyUsage(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Usage)
Definition: CryptLib.c:2619
EFI_STATUS EFIAPI TlsGetCaCertificate(IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
Definition: CryptLib.c:4610
BOOLEAN EFIAPI Pkcs7GetCertificatesList(IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT UINT8 **SignerChainCerts, OUT UINTN *ChainLength, OUT UINT8 **UnchainCerts, OUT UINTN *UnchainLength)
Definition: CryptLib.c:3023
VOID EFIAPI EcGroupFree(IN VOID *EcGroup)
Definition: CryptLib.c:5305
BOOLEAN EFIAPI AesCbcEncrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: CryptLib.c:1502
BOOLEAN EFIAPI RsaPkcs1Verify(IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
Definition: CryptLib.c:1885
BOOLEAN EFIAPI X509GetTBSCert(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **TBSCert, OUT UINTN *TBSCertSize)
Definition: CryptLib.c:2315
BOOLEAN EFIAPI X509GetExtendedBasicConstraints(CONST UINT8 *Cert, UINTN CertSize, UINT8 *BasicConstraints, UINTN *BasicConstraintsSize)
Definition: CryptLib.c:2730
BOOLEAN EFIAPI Sha512Update(IN OUT VOID *Sha512Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:805
RETURN_STATUS EFIAPI X509GetCommonName(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT CHAR8 *CommonName OPTIONAL, IN OUT UINTN *CommonNameSize)
Definition: CryptLib.c:2093
BOOLEAN EFIAPI HmacSha256Final(IN OUT VOID *HmacSha256Context, OUT UINT8 *HmacValue)
Definition: CryptLib.c:1196
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
BOOLEAN EFIAPI HkdfSha384Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
Definition: CryptLib.c:3670
BOOLEAN EFIAPI EcPointGetAffineCoordinates(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, OUT VOID *BnX, OUT VOID *BnY, IN VOID *BnCtx)
Definition: CryptLib.c:5363
BOOLEAN EFIAPI Sha1Update(IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptLib.c:354
BOOLEAN EFIAPI EcPointSetAffineCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN CONST VOID *BnY, IN VOID *BnCtx)
Definition: CryptLib.c:5388
INTN EFIAPI BigNumToBin(IN CONST VOID *Bn, OUT UINT8 *Buf)
Definition: CryptLib.c:4783
BOOLEAN EFIAPI RsaGenerateKey(IN OUT VOID *RsaContext, IN UINTN ModulusLength, IN CONST UINT8 *PublicExponent, IN UINTN PublicExponentSize)
Definition: CryptLib.c:1784
BOOLEAN EFIAPI X509VerifyCertChain(IN CONST UINT8 *RootCert, IN UINTN RootCertLength, IN CONST UINT8 *CertChain, IN UINTN CertChainLength)
Definition: CryptLib.c:2646
VOID * GetCryptoServices(VOID)
Definition: DxeCryptLib.c:28
BOOLEAN EFIAPI X509ConstructCertificate(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **SingleX509Cert)
Definition: CryptLib.c:2189
BOOLEAN EFIAPI RsaPkcs1Sign(IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: CryptLib.c:1853
VOID EFIAPI EcFree(IN VOID *EcContext)
Definition: CryptLib.c:5589
BOOLEAN EFIAPI AesCbcDecrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
Definition: CryptLib.c:1544
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
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29