]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Include/Library/BaseCryptLib.h
Fix several issues in BaseCryptLib:
[mirror_edk2.git] / CryptoPkg / Include / Library / BaseCryptLib.h
index ffd83ada66855cffd77f7c519bd56a0fffd520e8..4564d7be6542d959101a7a26d5fc58c442c64907 100644 (file)
@@ -69,7 +69,10 @@ typedef enum {
 /**\r
   Retrieves the size, in bytes, of the context buffer required for MD4 hash 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 MD4 hash operations.\r
+  @retval  0   This interface is not supported.\r
 \r
 **/\r
 UINTN\r
@@ -83,11 +86,13 @@ Md4GetContextSize (
   subsequent use.\r
 \r
   If Md4Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[out]  Md4Context  Pointer to MD4 context being initialized.\r
 \r
   @retval TRUE   MD4 context initialization succeeded.\r
   @retval FALSE  MD4 context initialization failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -101,12 +106,14 @@ Md4Init (
 \r
   If Md4Context is NULL, then return FALSE.\r
   If NewMd4Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  Md4Context     Pointer to MD4 context being copied.\r
   @param[out] NewMd4Context  Pointer to new MD4 context.\r
 \r
   @retval TRUE   MD4 context copy succeeded.\r
   @retval FALSE  MD4 context copy failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -125,6 +132,7 @@ Md4Duplicate (
   by Md4Final(). Behavior with invalid context is undefined.\r
 \r
   If Md4Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  Md4Context  Pointer to the MD4 context.\r
   @param[in]       Data        Pointer to the buffer containing the data to be hashed.\r
@@ -132,6 +140,7 @@ Md4Duplicate (
 \r
   @retval TRUE   MD4 data digest succeeded.\r
   @retval FALSE  MD4 data digest failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -153,6 +162,7 @@ Md4Update (
 \r
   If Md4Context is NULL, then return FALSE.\r
   If HashValue is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  Md4Context  Pointer to the MD4 context.\r
   @param[out]      HashValue   Pointer to a buffer that receives the MD4 digest\r
@@ -160,6 +170,7 @@ Md4Update (
 \r
   @retval TRUE   MD4 digest computation succeeded.\r
   @retval FALSE  MD4 digest computation failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -172,7 +183,10 @@ Md4Final (
 /**\r
   Retrieves the size, in bytes, of the context buffer required for MD5 hash 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 MD5 hash operations.\r
+  @retval  0   This interface is not supported.\r
 \r
 **/\r
 UINTN\r
@@ -186,11 +200,13 @@ Md5GetContextSize (
   subsequent use.\r
 \r
   If Md5Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[out]  Md5Context  Pointer to MD5 context being initialized.\r
 \r
   @retval TRUE   MD5 context initialization succeeded.\r
   @retval FALSE  MD5 context initialization failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -204,12 +220,14 @@ Md5Init (
 \r
   If Md5Context is NULL, then return FALSE.\r
   If NewMd5Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  Md5Context     Pointer to MD5 context being copied.\r
   @param[out] NewMd5Context  Pointer to new MD5 context.\r
 \r
   @retval TRUE   MD5 context copy succeeded.\r
   @retval FALSE  MD5 context copy failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -228,6 +246,7 @@ Md5Duplicate (
   by Md5Final(). Behavior with invalid context is undefined.\r
 \r
   If Md5Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  Md5Context  Pointer to the MD5 context.\r
   @param[in]       Data        Pointer to the buffer containing the data to be hashed.\r
@@ -235,6 +254,7 @@ Md5Duplicate (
 \r
   @retval TRUE   MD5 data digest succeeded.\r
   @retval FALSE  MD5 data digest failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -256,6 +276,7 @@ Md5Update (
 \r
   If Md5Context is NULL, then return FALSE.\r
   If HashValue is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  Md5Context  Pointer to the MD5 context.\r
   @param[out]      HashValue   Pointer to a buffer that receives the MD5 digest\r
@@ -263,6 +284,7 @@ Md5Update (
 \r
   @retval TRUE   MD5 digest computation succeeded.\r
   @retval FALSE  MD5 digest computation failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -275,7 +297,10 @@ Md5Final (
 /**\r
   Retrieves the size, in bytes, of the context buffer required for SHA-1 hash 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 SHA-1 hash operations.\r
+  @retval  0   This interface is not supported.\r
 \r
 **/\r
 UINTN\r
@@ -289,11 +314,13 @@ Sha1GetContextSize (
   subsequent use.\r
 \r
   If Sha1Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[out]  Sha1Context  Pointer to SHA-1 context being initialized.\r
 \r
   @retval TRUE   SHA-1 context initialization succeeded.\r
   @retval FALSE  SHA-1 context initialization failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -307,12 +334,14 @@ Sha1Init (
 \r
   If Sha1Context is NULL, then return FALSE.\r
   If NewSha1Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  Sha1Context     Pointer to SHA-1 context being copied.\r
   @param[out] NewSha1Context  Pointer to new SHA-1 context.\r
 \r
   @retval TRUE   SHA-1 context copy succeeded.\r
   @retval FALSE  SHA-1 context copy failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -331,6 +360,7 @@ Sha1Duplicate (
   by Sha1Final(). Behavior with invalid context is undefined.\r
 \r
   If Sha1Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  Sha1Context  Pointer to the SHA-1 context.\r
   @param[in]       Data         Pointer to the buffer containing the data to be hashed.\r
@@ -338,6 +368,7 @@ Sha1Duplicate (
 \r
   @retval TRUE   SHA-1 data digest succeeded.\r
   @retval FALSE  SHA-1 data digest failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -359,6 +390,7 @@ Sha1Update (
 \r
   If Sha1Context is NULL, then return FALSE.\r
   If HashValue is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  Sha1Context  Pointer to the SHA-1 context.\r
   @param[out]      HashValue    Pointer to a buffer that receives the SHA-1 digest\r
@@ -366,6 +398,7 @@ Sha1Update (
 \r
   @retval TRUE   SHA-1 digest computation succeeded.\r
   @retval FALSE  SHA-1 digest computation failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -410,12 +443,14 @@ Sha256Init (
 \r
   If Sha256Context is NULL, then return FALSE.\r
   If NewSha256Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  Sha256Context     Pointer to SHA-256 context being copied.\r
   @param[out] NewSha256Context  Pointer to new SHA-256 context.\r
 \r
   @retval TRUE   SHA-256 context copy succeeded.\r
   @retval FALSE  SHA-256 context copy failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -486,7 +521,10 @@ Sha256Final (
 /**\r
   Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 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-MD5 operations.\r
+  @retval  0   This interface is not supported.\r
 \r
 **/\r
 UINTN\r
@@ -500,6 +538,7 @@ HmacMd5GetContextSize (
   subsequent use.\r
 \r
   If HmacMd5Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[out]  HmacMd5Context  Pointer to HMAC-MD5 context being initialized.\r
   @param[in]   Key             Pointer to the user-supplied key.\r
@@ -507,6 +546,7 @@ HmacMd5GetContextSize (
 \r
   @retval TRUE   HMAC-MD5 context initialization succeeded.\r
   @retval FALSE  HMAC-MD5 context initialization failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -522,12 +562,14 @@ HmacMd5Init (
 \r
   If HmacMd5Context is NULL, then return FALSE.\r
   If NewHmacMd5Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  HmacMd5Context     Pointer to HMAC-MD5 context being copied.\r
   @param[out] NewHmacMd5Context  Pointer to new HMAC-MD5 context.\r
 \r
   @retval TRUE   HMAC-MD5 context copy succeeded.\r
   @retval FALSE  HMAC-MD5 context copy failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -546,6 +588,7 @@ HmacMd5Duplicate (
   finalized by HmacMd5Final(). Behavior with invalid context is undefined.\r
 \r
   If HmacMd5Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  HmacMd5Context  Pointer to the HMAC-MD5 context.\r
   @param[in]       Data            Pointer to the buffer containing the data to be digested.\r
@@ -553,6 +596,7 @@ HmacMd5Duplicate (
 \r
   @retval TRUE   HMAC-MD5 data digest succeeded.\r
   @retval FALSE  HMAC-MD5 data digest failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -574,6 +618,7 @@ HmacMd5Update (
 \r
   If HmacMd5Context is NULL, then return FALSE.\r
   If HashValue is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  HmacMd5Context  Pointer to the HMAC-MD5 context.\r
   @param[out]      HashValue       Pointer to a buffer that receives the HMAC-MD5 digest\r
@@ -581,6 +626,7 @@ HmacMd5Update (
 \r
   @retval TRUE   HMAC-MD5 digest computation succeeded.\r
   @retval FALSE  HMAC-MD5 digest computation failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -593,7 +639,10 @@ HmacMd5Final (
 /**\r
   Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 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-SHA1 operations.\r
+  @retval  0   This interface is not supported.\r
 \r
 **/\r
 UINTN\r
@@ -607,6 +656,7 @@ HmacSha1GetContextSize (
   subsequent use.\r
 \r
   If HmacSha1Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[out]  HmacSha1Context  Pointer to HMAC-SHA1 context being initialized.\r
   @param[in]   Key              Pointer to the user-supplied key.\r
@@ -614,6 +664,7 @@ HmacSha1GetContextSize (
 \r
   @retval TRUE   HMAC-SHA1 context initialization succeeded.\r
   @retval FALSE  HMAC-SHA1 context initialization failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -629,12 +680,14 @@ HmacSha1Init (
 \r
   If HmacSha1Context is NULL, then return FALSE.\r
   If NewHmacSha1Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  HmacSha1Context     Pointer to HMAC-SHA1 context being copied.\r
   @param[out] NewHmacSha1Context  Pointer to new HMAC-SHA1 context.\r
 \r
   @retval TRUE   HMAC-SHA1 context copy succeeded.\r
   @retval FALSE  HMAC-SHA1 context copy failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -653,6 +706,7 @@ HmacSha1Duplicate (
   be finalized by HmacSha1Final(). Behavior with invalid context is undefined.\r
 \r
   If HmacSha1Context 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[in]       Data            Pointer to the buffer containing the data to be digested.\r
@@ -660,6 +714,7 @@ HmacSha1Duplicate (
 \r
   @retval TRUE   HMAC-SHA1 data digest succeeded.\r
   @retval FALSE  HMAC-SHA1 data digest failed.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -681,6 +736,7 @@ HmacSha1Update (
 \r
   If HmacSha1Context is NULL, then return FALSE.\r
   If HashValue 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]      HashValue        Pointer to a buffer that receives the HMAC-SHA1 digest\r
@@ -688,6 +744,7 @@ HmacSha1Update (
 \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
@@ -705,7 +762,10 @@ HmacSha1Final (
 /**\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
@@ -718,7 +778,7 @@ TdesGetContextSize (
   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 addtion, it sets up all TDES key materials for subsequent encryption and decryption\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
@@ -728,6 +788,7 @@ TdesGetContextSize (
   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
@@ -735,6 +796,7 @@ TdesGetContextSize (
 \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
@@ -759,6 +821,7 @@ TdesInit (
   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
@@ -767,6 +830,7 @@ TdesInit (
 \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
@@ -792,6 +856,7 @@ TdesEcbEncrypt (
   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
@@ -800,6 +865,7 @@ TdesEcbEncrypt (
 \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
@@ -827,6 +893,7 @@ TdesEcbDecrypt (
   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
@@ -836,6 +903,7 @@ TdesEcbDecrypt (
 \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
@@ -864,6 +932,7 @@ TdesCbcEncrypt (
   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
@@ -873,6 +942,7 @@ TdesCbcEncrypt (
 \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
@@ -888,7 +958,10 @@ TdesCbcDecrypt (
 /**\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
@@ -901,13 +974,14 @@ AesGetContextSize (
   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 addtion, it sets up all AES key materials for subsequent encryption and decryption\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
@@ -915,6 +989,7 @@ AesGetContextSize (
 \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
@@ -939,6 +1014,7 @@ AesInit (
   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
@@ -947,6 +1023,7 @@ AesInit (
 \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
@@ -972,6 +1049,7 @@ AesEcbEncrypt (
   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
@@ -980,6 +1058,7 @@ AesEcbEncrypt (
 \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
@@ -1007,6 +1086,7 @@ AesEcbDecrypt (
   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
@@ -1016,6 +1096,7 @@ AesEcbDecrypt (
 \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
@@ -1044,6 +1125,7 @@ AesCbcEncrypt (
   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
@@ -1053,6 +1135,7 @@ AesCbcEncrypt (
 \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
@@ -1068,7 +1151,10 @@ AesCbcDecrypt (
 /**\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
@@ -1081,12 +1167,13 @@ Arc4GetContextSize (
   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 addtion, it sets up all ARC4 key materials for subsequent encryption and decryption\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
@@ -1094,6 +1181,7 @@ Arc4GetContextSize (
 \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
@@ -1115,6 +1203,7 @@ Arc4Init (
   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]   Arc4Context  Pointer to the ARC4 context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
@@ -1123,6 +1212,7 @@ Arc4Init (
 \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
@@ -1145,6 +1235,7 @@ Arc4Encrypt (
   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]   Arc4Context  Pointer to the ARC4 context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be decrypted.\r
@@ -1153,6 +1244,7 @@ Arc4Encrypt (
 \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
@@ -1173,11 +1265,13 @@ Arc4Decrypt (
   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
@@ -1262,6 +1356,7 @@ RsaSetKey (
   If RsaContext is NULL, then return FALSE.\r
   If BnSize is NULL, then return FALSE.\r
   If BnSize is large enough but BigNumber is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  RsaContext  Pointer to RSA context being set.\r
   @param[in]       KeyTag      Tag of RSA key component being set.\r
@@ -1272,6 +1367,7 @@ RsaSetKey (
   @retval  TRUE   RSA key component was retrieved successfully.\r
   @retval  FALSE  Invalid RSA key component tag.\r
   @retval  FALSE  BnSize is too small.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1294,6 +1390,7 @@ RsaGetKey (
   initialized by RandomSeed().\r
 \r
   If RsaContext is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  RsaContext           Pointer to RSA context being set.\r
   @param[in]       ModulusLength        Length of RSA modulus N in bits.\r
@@ -1302,6 +1399,7 @@ RsaGetKey (
 \r
   @retval  TRUE   RSA key component was generated successfully.\r
   @retval  FALSE  Invalid RSA key component tag.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1323,11 +1421,13 @@ RsaGenerateKey (
   - Whether d*e = 1  mod lcm(p-1,q-1)\r
 \r
   If RsaContext is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  RsaContext  Pointer to RSA context to check.\r
 \r
   @retval  TRUE   RSA key components are valid.\r
   @retval  FALSE  RSA key components are not valid.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1348,6 +1448,7 @@ RsaCheckKey (
   If MessageHash is NULL, then return FALSE.\r
   If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.\r
   If SigSize is large enough but Signature is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]      RsaContext   Pointer to RSA context for signature generation.\r
   @param[in]      MessageHash  Pointer to octet message hash to be signed.\r
@@ -1359,6 +1460,7 @@ RsaCheckKey (
   @retval  TRUE   Signature successfully generated in PKCS1-v1_5.\r
   @retval  FALSE  Signature generation failed.\r
   @retval  FALSE  SigSize is too small.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1403,6 +1505,10 @@ RsaPkcs1Verify (
 /**\r
   Retrieve the RSA Private Key from the password-protected PEM key data.\r
 \r
+  If PemData is NULL, then return FALSE.\r
+  If RsaContext is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
+\r
   @param[in]  PemData      Pointer to the PEM-encoded key data to be retrieved.\r
   @param[in]  PemSize      Size of the PEM key data in bytes.\r
   @param[in]  Password     NULL-terminated passphrase used for encrypted PEM key data.\r
@@ -1410,11 +1516,10 @@ RsaPkcs1Verify (
                            RSA private key component. Use RsaFree() function to free the\r
                            resource.\r
 \r
-  If PemData is NULL, then return FALSE.\r
-  If RsaContext is NULL, then return FALSE.\r
-\r
   @retval  TRUE   RSA Private Key was retrieved successfully.\r
   @retval  FALSE  Invalid PEM key data or incorrect password.\r
+  @retval  FALSE  This interface is not supported.\r
+  \r
 \r
 **/\r
 BOOLEAN\r
@@ -1429,17 +1534,19 @@ RsaGetPrivateKeyFromPem (
 /**\r
   Retrieve the RSA Public Key from one DER-encoded X509 certificate.\r
 \r
+  If Cert is NULL, then return FALSE.\r
+  If RsaContext is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
+\r
   @param[in]  Cert         Pointer to the DER-encoded X509 certificate.\r
   @param[in]  CertSize     Size of the X509 certificate in bytes.\r
   @param[out] RsaContext   Pointer to new-generated RSA context which contain the retrieved\r
                            RSA public key component. Use RsaFree() function to free the\r
                            resource.\r
 \r
-  If Cert is NULL, then return FALSE.\r
-  If RsaContext is NULL, then return FALSE.\r
-\r
   @retval  TRUE   RSA Public Key was retrieved successfully.\r
   @retval  FALSE  Fail to retrieve RSA public key from X509 certificate.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1453,18 +1560,20 @@ RsaGetPublicKeyFromX509 (
 /**\r
   Retrieve the subject bytes from one X.509 certificate.\r
 \r
+  If Cert is NULL, then return FALSE.\r
+  If SubjectSize is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
+\r
   @param[in]      Cert         Pointer to the DER-encoded X509 certificate.\r
   @param[in]      CertSize     Size of the X509 certificate in bytes.\r
   @param[out]     CertSubject  Pointer to the retrieved certificate subject bytes.\r
   @param[in, out] SubjectSize  The size in bytes of the CertSubject buffer on input,\r
                                and the size of buffer returned CertSubject on output.\r
 \r
-  If Cert is NULL, then return FALSE.\r
-  If SubjectSize is NULL, then return FALSE.\r
-\r
   @retval  TRUE   The certificate subject retrieved successfully.\r
   @retval  FALSE  Invalid certificate, or the SubjectSize is too small for the result.\r
                   The SubjectSize will be updated with the required size.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1479,17 +1588,19 @@ X509GetSubjectName (
 /**\r
   Verify one X509 certificate was issued by the trusted CA.\r
 \r
+  If Cert is NULL, then return FALSE.\r
+  If CACert is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
+\r
   @param[in]      Cert         Pointer to the DER-encoded X509 certificate to be verified.\r
   @param[in]      CertSize     Size of the X509 certificate in bytes.\r
   @param[in]      CACert       Pointer to the DER-encoded trusted CA certificate.\r
   @param[in]      CACertSize   Size of the CA Certificate in bytes.\r
 \r
-  If Cert is NULL, then return FALSE.\r
-  If CACert is NULL, then return FALSE.\r
-\r
   @retval  TRUE   The certificate was issued by the trusted CA.\r
   @retval  FALSE  Invalid certificate or the certificate was not issued by the given\r
                   trusted CA.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1506,6 +1617,7 @@ X509VerifyCert (
 \r
   If Cert is NULL, then return FALSE.\r
   If SingleX509Cert is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  Cert            Pointer to the DER-encoded certificate data.\r
   @param[in]  CertSize        The size of certificate data in bytes.\r
@@ -1513,6 +1625,7 @@ X509VerifyCert (
 \r
   @retval     TRUE            The X509 object generation succeeded.\r
   @retval     FALSE           The operation failed.\r
+  @retval     FALSE           This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1527,6 +1640,7 @@ X509ConstructCertificate (
   Construct a X509 stack object from a list of DER-encoded certificate data.\r
 \r
   If X509Stack is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  X509Stack  On input, pointer to an existing X509 stack object.\r
                               On output, pointer to the X509 stack object with new\r
@@ -1537,6 +1651,7 @@ X509ConstructCertificate (
                                  \r
   @retval     TRUE            The X509 stack construction succeeded.\r
   @retval     FALSE           The construction operation failed.\r
+  @retval     FALSE           This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1549,7 +1664,7 @@ X509ConstructCertificateStack (
 /**\r
   Release the specified X509 object.\r
 \r
-  If X509Cert is NULL, then return FALSE.\r
+  If the interface is not supported, then ASSERT().\r
 \r
   @param[in]  X509Cert  Pointer to the X509 object to be released.\r
 \r
@@ -1563,7 +1678,7 @@ X509Free (
 /**\r
   Release the specified X509 stack object.\r
 \r
-  If X509Stack is NULL, then return FALSE.\r
+  If the interface is not supported, then ASSERT().\r
 \r
   @param[in]  X509Stack  Pointer to the X509 stack object to be released.\r
 \r
@@ -1581,6 +1696,7 @@ X509StackFree (
 \r
   If P7Data, CertStack, StackLength, TrustedCert or CertLength is NULL, then\r
   return FALSE. If P7Length overflow, then return FAlSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  P7Data       Pointer to the PKCS#7 message to verify.\r
   @param[in]  P7Length     Length of the PKCS#7 message in bytes.\r
@@ -1593,6 +1709,7 @@ X509StackFree (
 \r
   @retval  TRUE            The operation is finished successfully.\r
   @retval  FALSE           Error occurs during the operation.\r
+  @retval  FALSE           This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1609,6 +1726,8 @@ Pkcs7GetSigners (
 /**\r
   Wrap function to use free() to free allocated memory for certificates.\r
 \r
+  If this interface is not supported, then ASSERT().\r
+\r
   @param[in]  Certs        Pointer to the certificates to be freed.\r
 \r
 **/\r
@@ -1623,6 +1742,8 @@ Pkcs7FreeSigners (
   Syntax Standard, version 1.5". This interface is only intended to be used for\r
   application to perform PKCS#7 functionality validation.\r
 \r
+  If this interface is not supported, then return FALSE.\r
+\r
   @param[in]  PrivateKey       Pointer to the PEM-formatted private key data for\r
                                data signing.\r
   @param[in]  PrivateKeySize   Size of the PEM private key data in bytes.\r
@@ -1639,6 +1760,7 @@ Pkcs7FreeSigners (
 \r
   @retval     TRUE             PKCS#7 data signing succeeded.\r
   @retval     FALSE            PKCS#7 data signing failed.\r
+  @retval     FALSE            This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1662,6 +1784,7 @@ Pkcs7Sign (
 \r
   If P7Data, TrustedCert or InData is NULL, then return FALSE.\r
   If P7Length, CertLength or DataLength overflow, then return FAlSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  P7Data       Pointer to the PKCS#7 message to verify.\r
   @param[in]  P7Length     Length of the PKCS#7 message in bytes.\r
@@ -1673,6 +1796,7 @@ Pkcs7Sign (
 \r
   @retval  TRUE  The specified PKCS#7 signed data is valid.\r
   @retval  FALSE Invalid PKCS#7 signed data.\r
+  @retval  FALSE This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1692,6 +1816,7 @@ Pkcs7Verify (
 \r
   If AuthData is NULL, then return FALSE.\r
   If ImageHash is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  AuthData     Pointer to the Authenticode Signature retrieved from signed\r
                            PE/COFF image to be verified.\r
@@ -1706,6 +1831,7 @@ Pkcs7Verify (
 \r
   @retval  TRUE   The specified Authenticode Signature is valid.\r
   @retval  FALSE  Invalid Authenticode Signature.\r
+  @retval  FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1728,6 +1854,7 @@ AuthenticodeVerify (
 \r
   @return  Pointer to the Diffie-Hellman Context that has been initialized.\r
            If the allocations fails, DhNew() returns NULL.\r
+           If the interface is not supported, DhNew() returns NULL.\r
 \r
 **/\r
 VOID *\r
@@ -1739,7 +1866,7 @@ DhNew (
 /**\r
   Release the specified DH context.\r
 \r
-  If DhContext is NULL, then return FALSE.\r
+  If the interface is not supported, then ASSERT().\r
 \r
   @param[in]  DhContext  Pointer to the DH context to be released.\r
 \r
@@ -1761,6 +1888,7 @@ DhFree (
 \r
   If DhContext is NULL, then return FALSE.\r
   If Prime is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  DhContext    Pointer to the DH context.\r
   @param[in]       Generator    Value of generator.\r
@@ -1770,6 +1898,7 @@ DhFree (
   @retval TRUE   DH pamameter generation succeeded.\r
   @retval FALSE  Value of Generator is not supported.\r
   @retval FALSE  PRNG fails to generate random prime number with PrimeLength.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1789,6 +1918,7 @@ DhGenerateParameter (
 \r
   If DhContext is NULL, then return FALSE.\r
   If Prime is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  DhContext    Pointer to the DH context.\r
   @param[in]       Generator    Value of generator.\r
@@ -1800,6 +1930,7 @@ DhGenerateParameter (
   @retval FALSE  Value of Generator is not suitable for the Prime.\r
   @retval FALSE  Value of Prime is not a prime number.\r
   @retval FALSE  Value of Prime is not a safe prime number.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1822,6 +1953,7 @@ DhSetParameter (
   If DhContext is NULL, then return FALSE.\r
   If PublicKeySize is NULL, then return FALSE.\r
   If PublicKeySize is large enough but PublicKey is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  DhContext      Pointer to the DH context.\r
   @param[out]      PublicKey      Pointer to the buffer to receive generated public key.\r
@@ -1831,6 +1963,7 @@ DhSetParameter (
   @retval TRUE   DH public key generation succeeded.\r
   @retval FALSE  DH public key generation failed.\r
   @retval FALSE  PublicKeySize is not large enough.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1845,12 +1978,14 @@ DhGenerateKey (
   Computes exchanged common key.\r
 \r
   Given peer's public key, this function computes the exchanged common key, based on its own\r
-  context including value of prime modulus and random secret exponent. \r
+  context including value of prime modulus and random secret exponent.\r
 \r
   If DhContext is NULL, then return FALSE.\r
   If PeerPublicKey is NULL, then return FALSE.\r
   If KeySize is NULL, then return FALSE.\r
-  If KeySize is large enough but Key is NULL, then return FALSE.\r
+  If Key is NULL, then return FALSE.\r
+  If KeySize is not large enough, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in, out]  DhContext          Pointer to the DH context.\r
   @param[in]       PeerPublicKey      Pointer to the peer's public key.\r
@@ -1862,6 +1997,7 @@ DhGenerateKey (
   @retval TRUE   DH exchanged key generation succeeded.\r
   @retval FALSE  DH exchanged key generation failed.\r
   @retval FALSE  KeySize is not large enough.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1884,6 +2020,7 @@ DhComputeKey (
   This function sets up the seed value for the pseudorandom number generator.\r
   If Seed is not NULL, then the seed passed in is used.\r
   If Seed is NULL, then default seed is used.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[in]  Seed      Pointer to seed value.\r
                         If NULL, default seed is used.\r
@@ -1892,6 +2029,7 @@ DhComputeKey (
 \r
   @retval TRUE   Pseudorandom number generator has enough entropy for random generation.\r
   @retval FALSE  Pseudorandom number generator does not have enough entropy for random generation.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1905,12 +2043,14 @@ RandomSeed (
   Generates a pseudorandom byte stream of the specified size.\r
 \r
   If Output is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
 \r
   @param[out]  Output  Pointer to buffer to receive random value.\r
   @param[in]   Size    Size of randome bytes to generate.\r
 \r
   @retval TRUE   Pseudorandom byte stream generated successfully.\r
   @retval FALSE  Pseudorandom number generator fails to generate due to lack of entropy.\r
+  @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r