• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   AES Wrapper Implementation which does not provide real capabilities.
3 
4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #include "InternalCryptLib.h"
16 
17 /**
18   Retrieves the size, in bytes, of the context buffer required for AES operations.
19 
20   Return zero to indicate this interface is not supported.
21 
22   @retval  0   This interface is not supported.
23 
24 **/
25 UINTN
26 EFIAPI
AesGetContextSize(VOID)27 AesGetContextSize (
28   VOID
29   )
30 {
31   ASSERT (FALSE);
32   return 0;
33 }
34 
35 /**
36   Initializes user-supplied memory as AES context for subsequent use.
37 
38   Return FALSE to indicate this interface is not supported.
39 
40   @param[out]  AesContext  Pointer to AES context being initialized.
41   @param[in]   Key         Pointer to the user-supplied AES key.
42   @param[in]   KeyLength   Length of AES key in bits.
43 
44   @retval FALSE  This interface is not supported.
45 
46 **/
47 BOOLEAN
48 EFIAPI
AesInit(OUT VOID * AesContext,IN CONST UINT8 * Key,IN UINTN KeyLength)49 AesInit (
50   OUT  VOID         *AesContext,
51   IN   CONST UINT8  *Key,
52   IN   UINTN        KeyLength
53   )
54 {
55   ASSERT (FALSE);
56   return FALSE;
57 }
58 
59 /**
60   Performs AES encryption on a data buffer of the specified size in ECB mode.
61 
62   Return FALSE to indicate this interface is not supported.
63 
64   @param[in]   AesContext  Pointer to the AES context.
65   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.
66   @param[in]   InputSize   Size of the Input buffer in bytes.
67   @param[out]  Output      Pointer to a buffer that receives the AES encryption output.
68 
69   @retval FALSE  This interface is not supported.
70 
71 **/
72 BOOLEAN
73 EFIAPI
AesEcbEncrypt(IN VOID * AesContext,IN CONST UINT8 * Input,IN UINTN InputSize,OUT UINT8 * Output)74 AesEcbEncrypt (
75   IN   VOID         *AesContext,
76   IN   CONST UINT8  *Input,
77   IN   UINTN        InputSize,
78   OUT  UINT8        *Output
79   )
80 {
81   ASSERT (FALSE);
82   return FALSE;
83 }
84 
85 /**
86   Performs AES decryption on a data buffer of the specified size in ECB mode.
87 
88   Return FALSE to indicate this interface is not supported.
89 
90   @param[in]   AesContext  Pointer to the AES context.
91   @param[in]   Input       Pointer to the buffer containing the data to be decrypted.
92   @param[in]   InputSize   Size of the Input buffer in bytes.
93   @param[out]  Output      Pointer to a buffer that receives the AES decryption output.
94 
95   @retval FALSE  This interface is not supported.
96 
97 **/
98 BOOLEAN
99 EFIAPI
AesEcbDecrypt(IN VOID * AesContext,IN CONST UINT8 * Input,IN UINTN InputSize,OUT UINT8 * Output)100 AesEcbDecrypt (
101   IN   VOID         *AesContext,
102   IN   CONST UINT8  *Input,
103   IN   UINTN        InputSize,
104   OUT  UINT8        *Output
105   )
106 {
107   ASSERT (FALSE);
108   return FALSE;
109 }
110 
111 /**
112   Performs AES encryption on a data buffer of the specified size in CBC mode.
113 
114   Return FALSE to indicate this interface is not supported.
115 
116   @param[in]   AesContext  Pointer to the AES context.
117   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.
118   @param[in]   InputSize   Size of the Input buffer in bytes.
119   @param[in]   Ivec        Pointer to initialization vector.
120   @param[out]  Output      Pointer to a buffer that receives the AES encryption output.
121 
122   @retval FALSE  This interface is not supported.
123 
124 **/
125 BOOLEAN
126 EFIAPI
AesCbcEncrypt(IN VOID * AesContext,IN CONST UINT8 * Input,IN UINTN InputSize,IN CONST UINT8 * Ivec,OUT UINT8 * Output)127 AesCbcEncrypt (
128   IN   VOID         *AesContext,
129   IN   CONST UINT8  *Input,
130   IN   UINTN        InputSize,
131   IN   CONST UINT8  *Ivec,
132   OUT  UINT8        *Output
133   )
134 {
135   ASSERT (FALSE);
136   return FALSE;
137 }
138 
139 /**
140   Performs AES decryption on a data buffer of the specified size in CBC mode.
141 
142   Return FALSE to indicate this interface is not supported.
143 
144   @param[in]   AesContext  Pointer to the AES context.
145   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.
146   @param[in]   InputSize   Size of the Input buffer in bytes.
147   @param[in]   Ivec        Pointer to initialization vector.
148   @param[out]  Output      Pointer to a buffer that receives the AES encryption output.
149 
150   @retval FALSE  This interface is not supported.
151 
152 **/
153 BOOLEAN
154 EFIAPI
AesCbcDecrypt(IN VOID * AesContext,IN CONST UINT8 * Input,IN UINTN InputSize,IN CONST UINT8 * Ivec,OUT UINT8 * Output)155 AesCbcDecrypt (
156   IN   VOID         *AesContext,
157   IN   CONST UINT8  *Input,
158   IN   UINTN        InputSize,
159   IN   CONST UINT8  *Ivec,
160   OUT  UINT8        *Output
161   )
162 {
163   ASSERT (FALSE);
164   return FALSE;
165 }
166