| 1 |
/** @file |
| 2 |
TDES 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 TDES 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 |
| 27 |
TdesGetContextSize ( |
| 28 |
VOID |
| 29 |
) |
| 30 |
{ |
| 31 |
ASSERT (FALSE); |
| 32 |
return 0; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
Initializes user-supplied memory as TDES context for subsequent use. |
| 37 |
|
| 38 |
Return FALSE to indicate this interface is not supported. |
| 39 |
|
| 40 |
@param[out] TdesContext Pointer to TDES context being initialized. |
| 41 |
@param[in] Key Pointer to the user-supplied TDES key. |
| 42 |
@param[in] KeyLength Length of TDES key in bits. |
| 43 |
|
| 44 |
@retval FALSE This interface is not supported. |
| 45 |
|
| 46 |
**/ |
| 47 |
BOOLEAN |
| 48 |
EFIAPI |
| 49 |
TdesInit ( |
| 50 |
OUT VOID *TdesContext, |
| 51 |
IN CONST UINT8 *Key, |
| 52 |
IN UINTN KeyLength |
| 53 |
) |
| 54 |
{ |
| 55 |
ASSERT (FALSE); |
| 56 |
return FALSE; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
Performs TDES 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] TdesContext Pointer to the TDES 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 TDES encryption output. |
| 68 |
|
| 69 |
@retval FALSE This interface is not supported. |
| 70 |
|
| 71 |
**/ |
| 72 |
BOOLEAN |
| 73 |
EFIAPI |
| 74 |
TdesEcbEncrypt ( |
| 75 |
IN VOID *TdesContext, |
| 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 TDES 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] TdesContext Pointer to the TDES 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 TDES decryption output. |
| 94 |
|
| 95 |
@retval FALSE This interface is not supported. |
| 96 |
|
| 97 |
**/ |
| 98 |
BOOLEAN |
| 99 |
EFIAPI |
| 100 |
TdesEcbDecrypt ( |
| 101 |
IN VOID *TdesContext, |
| 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 TDES 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] TdesContext Pointer to the TDES 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 TDES encryption output. |
| 121 |
|
| 122 |
@retval FALSE This interface is not supported. |
| 123 |
|
| 124 |
**/ |
| 125 |
BOOLEAN |
| 126 |
EFIAPI |
| 127 |
TdesCbcEncrypt ( |
| 128 |
IN VOID *TdesContext, |
| 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 TDES 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] TdesContext Pointer to the TDES 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 TDES encryption output. |
| 149 |
|
| 150 |
@retval FALSE This interface is not supported. |
| 151 |
|
| 152 |
**/ |
| 153 |
BOOLEAN |
| 154 |
EFIAPI |
| 155 |
TdesCbcDecrypt ( |
| 156 |
IN VOID *TdesContext, |
| 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 |
|