]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Private/Protocol/Crypto.h
CryptoPkg/BaseCryptLib: Retire the TDES algorithm
[mirror_edk2.git] / CryptoPkg / Private / Protocol / Crypto.h
index f36c5c1aff4dbe8a1ba84c312e03bd23bcdd82bb..a30660c1920ab4d5fedff1f1a6578d7221994f17 100644 (file)
@@ -2396,155 +2396,45 @@ BOOLEAN
 //=====================================================================================\r
 \r
 /**\r
-  Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
-  If this interface is not supported, then return zero.\r
-\r
-  @return  The size, in bytes, of the context buffer required for TDES operations.\r
-  @retval  0   This interface is not supported.\r
+  TDES is deprecated and unsupported any longer.\r
+  Keep the function field for binary compability.\r
 \r
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE) (\r
   VOID\r
   );\r
 \r
-/**\r
-  Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
-  This function initializes user-supplied memory pointed by TdesContext as TDES context.\r
-  In addition, it sets up all TDES key materials for subsequent encryption and decryption\r
-  operations.\r
-  There are 3 key options as follows:\r
-  KeyLength = 64,  Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)\r
-  KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)\r
-  KeyLength = 192  Keying option 3: K1 != K2 != K3 (Strongest)\r
-\r
-  If TdesContext is NULL, then return FALSE.\r
-  If Key is NULL, then return FALSE.\r
-  If KeyLength is not valid, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[out]  TdesContext  Pointer to TDES context being initialized.\r
-  @param[in]   Key          Pointer to the user-supplied TDES key.\r
-  @param[in]   KeyLength    Length of TDES key in bits.\r
-\r
-  @retval TRUE   TDES context initialization succeeded.\r
-  @retval FALSE  TDES context initialization failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_INIT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_INIT) (\r
   OUT  VOID         *TdesContext,\r
   IN   CONST UINT8  *Key,\r
   IN   UINTN        KeyLength\r
   );\r
 \r
-/**\r
-  Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
-  This function performs TDES encryption on data buffer pointed by Input, of specified\r
-  size of InputSize, in ECB mode.\r
-  InputSize must be multiple of block size (8 bytes). This function does not perform\r
-  padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
-  TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
-  invalid TDES context is undefined.\r
-\r
-  If TdesContext is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[in]   TdesContext  Pointer to the TDES context.\r
-  @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
-  @param[in]   InputSize    Size of the Input buffer in bytes.\r
-  @param[out]  Output       Pointer to a buffer that receives the TDES encryption output.\r
-\r
-  @retval TRUE   TDES encryption succeeded.\r
-  @retval FALSE  TDES encryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_ECB_ENCRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_ECB_ENCRYPT) (\r
   IN   VOID         *TdesContext,\r
   IN   CONST UINT8  *Input,\r
   IN   UINTN        InputSize,\r
   OUT  UINT8        *Output\r
   );\r
 \r
-/**\r
-  Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
-  This function performs TDES decryption on data buffer pointed by Input, of specified\r
-  size of InputSize, in ECB mode.\r
-  InputSize must be multiple of block size (8 bytes). This function does not perform\r
-  padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
-  TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
-  invalid TDES context is undefined.\r
-\r
-  If TdesContext is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[in]   TdesContext  Pointer to the TDES context.\r
-  @param[in]   Input        Pointer to the buffer containing the data to be decrypted.\r
-  @param[in]   InputSize    Size of the Input buffer in bytes.\r
-  @param[out]  Output       Pointer to a buffer that receives the TDES decryption output.\r
-\r
-  @retval TRUE   TDES decryption succeeded.\r
-  @retval FALSE  TDES decryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_ECB_DECRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_ECB_DECRYPT) (\r
   IN   VOID         *TdesContext,\r
   IN   CONST UINT8  *Input,\r
   IN   UINTN        InputSize,\r
   OUT  UINT8        *Output\r
   );\r
 \r
-/**\r
-  Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
-  This function performs TDES encryption on data buffer pointed by Input, of specified\r
-  size of InputSize, in CBC mode.\r
-  InputSize must be multiple of block size (8 bytes). This function does not perform\r
-  padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
-  Initialization vector should be one block size (8 bytes).\r
-  TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
-  invalid TDES context is undefined.\r
-\r
-  If TdesContext is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
-  If Ivec is NULL, then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[in]   TdesContext  Pointer to the TDES context.\r
-  @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
-  @param[in]   InputSize    Size of the Input buffer in bytes.\r
-  @param[in]   Ivec         Pointer to initialization vector.\r
-  @param[out]  Output       Pointer to a buffer that receives the TDES encryption output.\r
-\r
-  @retval TRUE   TDES encryption succeeded.\r
-  @retval FALSE  TDES encryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_CBC_ENCRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_CBC_ENCRYPT) (\r
   IN   VOID         *TdesContext,\r
   IN   CONST UINT8  *Input,\r
   IN   UINTN        InputSize,\r
@@ -2552,38 +2442,9 @@ BOOLEAN
   OUT  UINT8        *Output\r
   );\r
 \r
-/**\r
-  Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
-  This function performs TDES decryption on data buffer pointed by Input, of specified\r
-  size of InputSize, in CBC mode.\r
-  InputSize must be multiple of block size (8 bytes). This function does not perform\r
-  padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
-  Initialization vector should be one block size (8 bytes).\r
-  TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
-  invalid TDES context is undefined.\r
-\r
-  If TdesContext is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
-  If Ivec is NULL, then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[in]   TdesContext  Pointer to the TDES context.\r
-  @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
-  @param[in]   InputSize    Size of the Input buffer in bytes.\r
-  @param[in]   Ivec         Pointer to initialization vector.\r
-  @param[out]  Output       Pointer to a buffer that receives the TDES encryption output.\r
-\r
-  @retval TRUE   TDES decryption succeeded.\r
-  @retval FALSE  TDES decryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_CBC_DECRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_CBC_DECRYPT) (\r
   IN   VOID         *TdesContext,\r
   IN   CONST UINT8  *Input,\r
   IN   UINTN        InputSize,\r
@@ -3911,13 +3772,13 @@ struct _EDKII_CRYPTO_PROTOCOL {
   EDKII_CRYPTO_X509_FREE                          X509Free;\r
   EDKII_CRYPTO_X509_STACK_FREE                    X509StackFree;\r
   EDKII_CRYPTO_X509_GET_TBS_CERT                  X509GetTBSCert;\r
-  /// TDES\r
-  EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE              TdesGetContextSize;\r
-  EDKII_CRYPTO_TDES_INIT                          TdesInit;\r
-  EDKII_CRYPTO_TDES_ECB_ENCRYPT                   TdesEcbEncrypt;\r
-  EDKII_CRYPTO_TDES_ECB_DECRYPT                   TdesEcbDecrypt;\r
-  EDKII_CRYPTO_TDES_CBC_ENCRYPT                   TdesCbcEncrypt;\r
-  EDKII_CRYPTO_TDES_CBC_DECRYPT                   TdesCbcDecrypt;\r
+  /// TDES - deprecated and unsupported\r
+  DEPRECATED_EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE   DeprecatedTdesGetContextSize;\r
+  DEPRECATED_EDKII_CRYPTO_TDES_INIT               DeprecatedTdesInit;\r
+  DEPRECATED_EDKII_CRYPTO_TDES_ECB_ENCRYPT        DeprecatedTdesEcbEncrypt;\r
+  DEPRECATED_EDKII_CRYPTO_TDES_ECB_DECRYPT        DeprecatedTdesEcbDecrypt;\r
+  DEPRECATED_EDKII_CRYPTO_TDES_CBC_ENCRYPT        DeprecatedTdesCbcEncrypt;\r
+  DEPRECATED_EDKII_CRYPTO_TDES_CBC_DECRYPT        DeprecatedTdesCbcDecrypt;\r
   /// AES\r
   EDKII_CRYPTO_AES_GET_CONTEXT_SIZE               AesGetContextSize;\r
   EDKII_CRYPTO_AES_INIT                           AesInit;\r