-/**\r
- Completes computation of the HMAC-SHA1 digest value.\r
-\r
- This function completes HMAC-SHA1 hash computation and retrieves the digest value into\r
- the specified memory. After this function has been called, the HMAC-SHA1 context cannot\r
- be used again.\r
- HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should\r
- not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.\r
-\r
- If HmacSha1Context is NULL, then return FALSE.\r
- If HmacValue is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context.\r
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA1 digest\r
- value (20 bytes).\r
-\r
- @retval TRUE HMAC-SHA1 digest computation succeeded.\r
- @retval FALSE HMAC-SHA1 digest computation failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-HmacSha1Final (\r
- IN OUT VOID *HmacSha1Context,\r
- OUT UINT8 *HmacValue\r
- );\r
-\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r
- (NOTE: This API is deprecated.\r
- Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context 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 HMAC-SHA256 operations.\r
- @retval 0 This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-HmacSha256GetContextSize (\r
- VOID\r
- );\r
-\r
-/**\r
- Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.\r
-\r
- @return Pointer to the HMAC_CTX context that has been initialized.\r
- If the allocations fails, HmacSha256New() returns NULL.\r
-\r
-**/\r
-VOID *\r
-EFIAPI\r
-HmacSha256New (\r
- VOID\r
- );\r
-\r
-/**\r
- Release the specified HMAC_CTX context.\r
-\r
- @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-HmacSha256Free (\r
- IN VOID *HmacSha256Ctx\r
- );\r
-\r
-/**\r
- Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for\r
- subsequent use.\r
-\r
- If HmacSha256Context is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.\r
- @param[in] Key Pointer to the user-supplied key.\r
- @param[in] KeySize Key size in bytes.\r
-\r
- @retval TRUE HMAC-SHA256 context initialization succeeded.\r
- @retval FALSE HMAC-SHA256 context initialization failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-HmacSha256Init (\r
- OUT VOID *HmacSha256Context,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeySize\r
- );\r
-\r
-/**\r
- Makes a copy of an existing HMAC-SHA256 context.\r
-\r
- If HmacSha256Context is NULL, then return FALSE.\r
- If NewHmacSha256Context is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.\r
- @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.\r
-\r
- @retval TRUE HMAC-SHA256 context copy succeeded.\r
- @retval FALSE HMAC-SHA256 context copy failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-HmacSha256Duplicate (\r
- IN CONST VOID *HmacSha256Context,\r
- OUT VOID *NewHmacSha256Context\r
- );\r
-\r
-/**\r
- Digests the input data and updates HMAC-SHA256 context.\r
-\r
- This function performs HMAC-SHA256 digest on a data buffer of the specified size.\r
- It can be called multiple times to compute the digest of long or discontinuous data streams.\r
- HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not\r
- be finalized by HmacSha256Final(). Behavior with invalid context is undefined.\r
-\r
- If HmacSha256Context is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.\r
- @param[in] Data Pointer to the buffer containing the data to be digested.\r
- @param[in] DataSize Size of Data buffer in bytes.\r
-\r
- @retval TRUE HMAC-SHA256 data digest succeeded.\r
- @retval FALSE HMAC-SHA256 data digest failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-HmacSha256Update (\r
- IN OUT VOID *HmacSha256Context,\r
- IN CONST VOID *Data,\r
- IN UINTN DataSize\r
- );\r
-\r
-/**\r
- Completes computation of the HMAC-SHA256 digest value.\r
-\r
- This function completes HMAC-SHA256 hash computation and retrieves the digest value into\r
- the specified memory. After this function has been called, the HMAC-SHA256 context cannot\r
- be used again.\r
- HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should\r
- not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.\r
-\r
- If HmacSha256Context is NULL, then return FALSE.\r
- If HmacValue is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.\r
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest\r
- value (32 bytes).\r
-\r
- @retval TRUE HMAC-SHA256 digest computation succeeded.\r
- @retval FALSE HMAC-SHA256 digest computation failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-HmacSha256Final (\r
- IN OUT VOID *HmacSha256Context,\r
- OUT UINT8 *HmacValue\r
- );\r
-\r
-//=====================================================================================\r
-// Symmetric Cryptography Primitive\r
-//=====================================================================================\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
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-TdesGetContextSize (\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
-BOOLEAN\r
-EFIAPI\r
-TdesInit (\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
-BOOLEAN\r
-EFIAPI\r
-TdesEcbEncrypt (\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
-BOOLEAN\r
-EFIAPI\r
-TdesEcbDecrypt (\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
-BOOLEAN\r
-EFIAPI\r
-TdesCbcEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- 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
-BOOLEAN\r
-EFIAPI\r
-TdesCbcDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for AES 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 AES operations.\r
- @retval 0 This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AesGetContextSize (\r
- VOID\r
- );\r
-\r
-/**\r
- Initializes user-supplied memory as AES context for subsequent use.\r
-\r
- This function initializes user-supplied memory pointed by AesContext as AES context.\r
- In addition, it sets up all AES key materials for subsequent encryption and decryption\r
- operations.\r
- There are 3 options for key length, 128 bits, 192 bits, and 256 bits.\r
-\r
- If AesContext 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] AesContext Pointer to AES context being initialized.\r
- @param[in] Key Pointer to the user-supplied AES key.\r
- @param[in] KeyLength Length of AES key in bits.\r
-\r
- @retval TRUE AES context initialization succeeded.\r
- @retval FALSE AES context initialization failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-AesInit (\r
- OUT VOID *AesContext,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeyLength\r
- );\r
-\r
-/**\r
- Performs AES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs AES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (16 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- AesContext should be already correctly initialized by AesInit(). Behavior with\r
- invalid AES context is undefined.\r
-\r
- If AesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (16 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] AesContext Pointer to the AES 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 AES encryption output.\r
-\r
- @retval TRUE AES encryption succeeded.\r
- @retval FALSE AES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-AesEcbEncrypt (\r
- IN VOID *AesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Performs AES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs AES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (16 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- AesContext should be already correctly initialized by AesInit(). Behavior with\r
- invalid AES context is undefined.\r
-\r
- If AesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (16 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] AesContext Pointer to the AES 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 AES decryption output.\r
-\r
- @retval TRUE AES decryption succeeded.\r
- @retval FALSE AES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-AesEcbDecrypt (\r
- IN VOID *AesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Performs AES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs AES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (16 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 (16 bytes).\r
- AesContext should be already correctly initialized by AesInit(). Behavior with\r
- invalid AES context is undefined.\r
-\r
- If AesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (16 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] AesContext Pointer to the AES 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 AES encryption output.\r
-\r
- @retval TRUE AES encryption succeeded.\r
- @retval FALSE AES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-AesCbcEncrypt (\r
- IN VOID *AesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Performs AES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs AES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (16 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 (16 bytes).\r
- AesContext should be already correctly initialized by AesInit(). Behavior with\r
- invalid AES context is undefined.\r
-\r
- If AesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (16 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] AesContext Pointer to the AES 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 AES encryption output.\r
-\r
- @retval TRUE AES decryption succeeded.\r
- @retval FALSE AES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-AesCbcDecrypt (\r
- IN VOID *AesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for ARC4 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 ARC4 operations.\r
- @retval 0 This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-Arc4GetContextSize (\r
- VOID\r
- );\r
-\r
-/**\r
- Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
- This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.\r
- In addition, it sets up all ARC4 key materials for subsequent encryption and decryption\r
- operations.\r
-\r
- If Arc4Context is NULL, then return FALSE.\r
- If Key is NULL, then return FALSE.\r
- If KeySize does not in the range of [5, 256] bytes, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[out] Arc4Context Pointer to ARC4 context being initialized.\r
- @param[in] Key Pointer to the user-supplied ARC4 key.\r
- @param[in] KeySize Size of ARC4 key in bytes.\r
-\r
- @retval TRUE ARC4 context initialization succeeded.\r
- @retval FALSE ARC4 context initialization failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Init (\r
- OUT VOID *Arc4Context,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeySize\r
- );\r
-\r
-/**\r
- Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
- This function performs ARC4 encryption on data buffer pointed by Input, of specified\r
- size of InputSize.\r
- Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
- invalid ARC4 context is undefined.\r
-\r
- If Arc4Context is NULL, then return FALSE.\r
- If Input 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, out] Arc4Context Pointer to the ARC4 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 ARC4 encryption output.\r
-\r
- @retval TRUE ARC4 encryption succeeded.\r
- @retval FALSE ARC4 encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Encrypt (\r
- IN OUT VOID *Arc4Context,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Performs ARC4 decryption on a data buffer of the specified size.\r
-\r
- This function performs ARC4 decryption on data buffer pointed by Input, of specified\r
- size of InputSize.\r
- Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
- invalid ARC4 context is undefined.\r
-\r
- If Arc4Context is NULL, then return FALSE.\r
- If Input 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, out] Arc4Context Pointer to the ARC4 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 ARC4 decryption output.\r
-\r
- @retval TRUE ARC4 decryption succeeded.\r
- @retval FALSE ARC4 decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Decrypt (\r
- IN OUT VOID *Arc4Context,\r
- IN UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Resets the ARC4 context to the initial state.\r
-\r
- The function resets the ARC4 context to the state it had immediately after the\r
- ARC4Init() function call.\r
- Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context\r
- should be already correctly initialized by ARC4Init().\r
-\r
- If Arc4Context is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in, out] Arc4Context Pointer to the ARC4 context.\r
-\r
- @retval TRUE ARC4 reset succeeded.\r
- @retval FALSE ARC4 reset failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Reset (\r
- IN OUT VOID *Arc4Context\r
- );\r
-\r
-//=====================================================================================\r
-// Asymmetric Cryptography Primitive\r
-//=====================================================================================\r