]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLibNull/Cipher/CryptAesNull.c
CryptoPkg: Add Null instance of the BaseCryptLib class
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibNull / Cipher / CryptAesNull.c
1 /** @file
2 AES Wrapper Implementation which does not provide real capabilities.
3
4 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "InternalCryptLib.h"
10
11 /**
12 Retrieves the size, in bytes, of the context buffer required for AES operations.
13
14 Return zero to indicate this interface is not supported.
15
16 @retval 0 This interface is not supported.
17
18 **/
19 UINTN
20 EFIAPI
21 AesGetContextSize (
22 VOID
23 )
24 {
25 ASSERT (FALSE);
26 return 0;
27 }
28
29 /**
30 Initializes user-supplied memory as AES context for subsequent use.
31
32 Return FALSE to indicate this interface is not supported.
33
34 @param[out] AesContext Pointer to AES context being initialized.
35 @param[in] Key Pointer to the user-supplied AES key.
36 @param[in] KeyLength Length of AES key in bits.
37
38 @retval FALSE This interface is not supported.
39
40 **/
41 BOOLEAN
42 EFIAPI
43 AesInit (
44 OUT VOID *AesContext,
45 IN CONST UINT8 *Key,
46 IN UINTN KeyLength
47 )
48 {
49 ASSERT (FALSE);
50 return FALSE;
51 }
52
53 /**
54 Performs AES encryption on a data buffer of the specified size in ECB mode.
55
56 Return FALSE to indicate this interface is not supported.
57
58 @param[in] AesContext Pointer to the AES context.
59 @param[in] Input Pointer to the buffer containing the data to be encrypted.
60 @param[in] InputSize Size of the Input buffer in bytes.
61 @param[out] Output Pointer to a buffer that receives the AES encryption output.
62
63 @retval FALSE This interface is not supported.
64
65 **/
66 BOOLEAN
67 EFIAPI
68 AesEcbEncrypt (
69 IN VOID *AesContext,
70 IN CONST UINT8 *Input,
71 IN UINTN InputSize,
72 OUT UINT8 *Output
73 )
74 {
75 ASSERT (FALSE);
76 return FALSE;
77 }
78
79 /**
80 Performs AES decryption on a data buffer of the specified size in ECB mode.
81
82 Return FALSE to indicate this interface is not supported.
83
84 @param[in] AesContext Pointer to the AES context.
85 @param[in] Input Pointer to the buffer containing the data to be decrypted.
86 @param[in] InputSize Size of the Input buffer in bytes.
87 @param[out] Output Pointer to a buffer that receives the AES decryption output.
88
89 @retval FALSE This interface is not supported.
90
91 **/
92 BOOLEAN
93 EFIAPI
94 AesEcbDecrypt (
95 IN VOID *AesContext,
96 IN CONST UINT8 *Input,
97 IN UINTN InputSize,
98 OUT UINT8 *Output
99 )
100 {
101 ASSERT (FALSE);
102 return FALSE;
103 }
104
105 /**
106 Performs AES encryption on a data buffer of the specified size in CBC mode.
107
108 Return FALSE to indicate this interface is not supported.
109
110 @param[in] AesContext Pointer to the AES context.
111 @param[in] Input Pointer to the buffer containing the data to be encrypted.
112 @param[in] InputSize Size of the Input buffer in bytes.
113 @param[in] Ivec Pointer to initialization vector.
114 @param[out] Output Pointer to a buffer that receives the AES encryption output.
115
116 @retval FALSE This interface is not supported.
117
118 **/
119 BOOLEAN
120 EFIAPI
121 AesCbcEncrypt (
122 IN VOID *AesContext,
123 IN CONST UINT8 *Input,
124 IN UINTN InputSize,
125 IN CONST UINT8 *Ivec,
126 OUT UINT8 *Output
127 )
128 {
129 ASSERT (FALSE);
130 return FALSE;
131 }
132
133 /**
134 Performs AES decryption on a data buffer of the specified size in CBC mode.
135
136 Return FALSE to indicate this interface is not supported.
137
138 @param[in] AesContext Pointer to the AES context.
139 @param[in] Input Pointer to the buffer containing the data to be encrypted.
140 @param[in] InputSize Size of the Input buffer in bytes.
141 @param[in] Ivec Pointer to initialization vector.
142 @param[out] Output Pointer to a buffer that receives the AES encryption output.
143
144 @retval FALSE This interface is not supported.
145
146 **/
147 BOOLEAN
148 EFIAPI
149 AesCbcDecrypt (
150 IN VOID *AesContext,
151 IN CONST UINT8 *Input,
152 IN UINTN InputSize,
153 IN CONST UINT8 *Ivec,
154 OUT UINT8 *Output
155 )
156 {
157 ASSERT (FALSE);
158 return FALSE;
159 }