]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Include/Library/BaseCryptLib.h
1. Remove conducting ASSERT in BaseCryptLib.
[mirror_edk2.git] / CryptoPkg / Include / Library / BaseCryptLib.h
index 0745e9316d4f8d73e0fda25c16f89eed0f4dce73..69b9a888f2395ea514fd1e666ab81f19ea253798 100644 (file)
@@ -4,7 +4,7 @@
   primitives (Hash Serials, HMAC, RSA, Diffie-Hellman, etc) for UEFI security\r
   functionality enabling.\r
 \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -82,7 +82,7 @@ Md4GetContextSize (
   Initializes user-supplied memory pointed by Md4Context as MD4 hash context for\r
   subsequent use.\r
 \r
-  If Md4Context is NULL, then ASSERT().\r
+  If Md4Context is NULL, then return FALSE.\r
 \r
   @param[out]  Md4Context  Pointer to MD4 context being initialized.\r
 \r
@@ -99,8 +99,8 @@ Md4Init (
 /**\r
   Makes a copy of an existing MD4 context.\r
 \r
-  If Md4Context is NULL, then ASSERT().\r
-  If NewMd4Context is NULL, then ASSERT().\r
+  If Md4Context is NULL, then return FALSE.\r
+  If NewMd4Context is NULL, then return FALSE.\r
 \r
   @param[in]  Md4Context     Pointer to MD4 context being copied.\r
   @param[out] NewMd4Context  Pointer to new MD4 context.\r
@@ -124,7 +124,7 @@ Md4Duplicate (
   MD4 context should be already correctly intialized by Md4Init(), and should not be finalized\r
   by Md4Final(). Behavior with invalid context is undefined.\r
 \r
-  If Md4Context is NULL, then ASSERT().\r
+  If Md4Context is NULL, 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
@@ -151,8 +151,8 @@ Md4Update (
   MD4 context should be already correctly intialized by Md4Init(), and should not be\r
   finalized by Md4Final(). Behavior with invalid MD4 context is undefined.\r
 \r
-  If Md4Context is NULL, then ASSERT().\r
-  If HashValue is NULL, then ASSERT().\r
+  If Md4Context is NULL, then return FALSE.\r
+  If HashValue is NULL, 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
@@ -185,7 +185,7 @@ Md5GetContextSize (
   Initializes user-supplied memory pointed by Md5Context as MD5 hash context for\r
   subsequent use.\r
 \r
-  If Md5Context is NULL, then ASSERT().\r
+  If Md5Context is NULL, then return FALSE.\r
 \r
   @param[out]  Md5Context  Pointer to MD5 context being initialized.\r
 \r
@@ -202,8 +202,8 @@ Md5Init (
 /**\r
   Makes a copy of an existing MD5 context.\r
 \r
-  If Md5Context is NULL, then ASSERT().\r
-  If NewMd5Context is NULL, then ASSERT().\r
+  If Md5Context is NULL, then return FALSE.\r
+  If NewMd5Context is NULL, then return FALSE.\r
 \r
   @param[in]  Md5Context     Pointer to MD5 context being copied.\r
   @param[out] NewMd5Context  Pointer to new MD5 context.\r
@@ -227,7 +227,7 @@ Md5Duplicate (
   MD5 context should be already correctly intialized by Md5Init(), and should not be finalized\r
   by Md5Final(). Behavior with invalid context is undefined.\r
 \r
-  If Md5Context is NULL, then ASSERT().\r
+  If Md5Context is NULL, 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
@@ -254,8 +254,8 @@ Md5Update (
   MD5 context should be already correctly intialized by Md5Init(), and should not be\r
   finalized by Md5Final(). Behavior with invalid MD5 context is undefined.\r
 \r
-  If Md5Context is NULL, then ASSERT().\r
-  If HashValue is NULL, then ASSERT().\r
+  If Md5Context is NULL, then return FALSE.\r
+  If HashValue is NULL, 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
@@ -288,7 +288,7 @@ Sha1GetContextSize (
   Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for\r
   subsequent use.\r
 \r
-  If Sha1Context is NULL, then ASSERT().\r
+  If Sha1Context is NULL, then return FALSE.\r
 \r
   @param[out]  Sha1Context  Pointer to SHA-1 context being initialized.\r
 \r
@@ -305,8 +305,8 @@ Sha1Init (
 /**\r
   Makes a copy of an existing SHA-1 context.\r
 \r
-  If Sha1Context is NULL, then ASSERT().\r
-  If NewSha1Context is NULL, then ASSERT().\r
+  If Sha1Context is NULL, then return FALSE.\r
+  If NewSha1Context is NULL, 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
@@ -330,7 +330,7 @@ Sha1Duplicate (
   SHA-1 context should be already correctly intialized by Sha1Init(), and should not be finalized\r
   by Sha1Final(). Behavior with invalid context is undefined.\r
 \r
-  If Sha1Context is NULL, then ASSERT().\r
+  If Sha1Context is NULL, 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
@@ -357,8 +357,8 @@ Sha1Update (
   SHA-1 context should be already correctly intialized by Sha1Init(), and should not be\r
   finalized by Sha1Final(). Behavior with invalid SHA-1 context is undefined.\r
 \r
-  If Sha1Context is NULL, then ASSERT().\r
-  If HashValue is NULL, then ASSERT().\r
+  If Sha1Context is NULL, then return FALSE.\r
+  If HashValue is NULL, 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
@@ -391,7 +391,7 @@ Sha256GetContextSize (
   Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for\r
   subsequent use.\r
 \r
-  If Sha256Context is NULL, then ASSERT().\r
+  If Sha256Context is NULL, then return FALSE.\r
 \r
   @param[out]  Sha256Context  Pointer to SHA-256 context being initialized.\r
 \r
@@ -408,8 +408,8 @@ Sha256Init (
 /**\r
   Makes a copy of an existing SHA-256 context.\r
 \r
-  If Sha256Context is NULL, then ASSERT().\r
-  If NewSha256Context is NULL, then ASSERT().\r
+  If Sha256Context is NULL, then return FALSE.\r
+  If NewSha256Context is NULL, 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
@@ -433,7 +433,7 @@ Sha256Duplicate (
   SHA-256 context should be already correctly intialized by Sha256Init(), and should not be finalized\r
   by Sha256Final(). Behavior with invalid context is undefined.\r
 \r
-  If Sha256Context is NULL, then ASSERT().\r
+  If Sha256Context is NULL, then return FALSE.\r
 \r
   @param[in, out]  Sha256Context  Pointer to the SHA-256 context.\r
   @param[in]       Data           Pointer to the buffer containing the data to be hashed.\r
@@ -460,8 +460,8 @@ Sha256Update (
   SHA-256 context should be already correctly intialized by Sha256Init(), and should not be\r
   finalized by Sha256Final(). Behavior with invalid SHA-256 context is undefined.\r
 \r
-  If Sha256Context is NULL, then ASSERT().\r
-  If HashValue is NULL, then ASSERT().\r
+  If Sha256Context is NULL, then return FALSE.\r
+  If HashValue is NULL, then return FALSE.\r
 \r
   @param[in, out]  Sha256Context  Pointer to the SHA-256 context.\r
   @param[out]      HashValue      Pointer to a buffer that receives the SHA-256 digest\r
@@ -499,7 +499,7 @@ HmacMd5GetContextSize (
   Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for\r
   subsequent use.\r
 \r
-  If HmacMd5Context is NULL, then ASSERT().\r
+  If HmacMd5Context is NULL, 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
@@ -520,8 +520,8 @@ HmacMd5Init (
 /**\r
   Makes a copy of an existing HMAC-MD5 context.\r
 \r
-  If HmacMd5Context is NULL, then ASSERT().\r
-  If NewHmacMd5Context is NULL, then ASSERT().\r
+  If HmacMd5Context is NULL, then return FALSE.\r
+  If NewHmacMd5Context is NULL, 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
@@ -545,7 +545,7 @@ HmacMd5Duplicate (
   HMAC-MD5 context should be already correctly intialized by HmacMd5Init(), and should not be\r
   finalized by HmacMd5Final(). Behavior with invalid context is undefined.\r
 \r
-  If HmacMd5Context is NULL, then ASSERT().\r
+  If HmacMd5Context is NULL, 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
@@ -572,8 +572,8 @@ HmacMd5Update (
   HMAC-MD5 context should be already correctly intialized by HmacMd5Init(), and should not be\r
   finalized by HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.\r
 \r
-  If HmacMd5Context is NULL, then ASSERT().\r
-  If HashValue is NULL, then ASSERT().\r
+  If HmacMd5Context is NULL, then return FALSE.\r
+  If HashValue is NULL, 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
@@ -606,7 +606,7 @@ HmacSha1GetContextSize (
   Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for\r
   subsequent use.\r
 \r
-  If HmacSha1Context is NULL, then ASSERT().\r
+  If HmacSha1Context is NULL, 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
@@ -627,8 +627,8 @@ HmacSha1Init (
 /**\r
   Makes a copy of an existing HMAC-SHA1 context.\r
 \r
-  If HmacSha1Context is NULL, then ASSERT().\r
-  If NewHmacSha1Context is NULL, then ASSERT().\r
+  If HmacSha1Context is NULL, then return FALSE.\r
+  If NewHmacSha1Context is NULL, 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
@@ -652,7 +652,7 @@ HmacSha1Duplicate (
   HMAC-SHA1 context should be already correctly intialized by HmacSha1Init(), and should not\r
   be finalized by HmacSha1Final(). Behavior with invalid context is undefined.\r
 \r
-  If HmacSha1Context is NULL, then ASSERT().\r
+  If HmacSha1Context is NULL, 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
@@ -679,8 +679,8 @@ HmacSha1Update (
   HMAC-SHA1 context should be already correctly intialized 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 ASSERT().\r
-  If HashValue is NULL, then ASSERT().\r
+  If HmacSha1Context is NULL, then return FALSE.\r
+  If HashValue is NULL, 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
@@ -725,9 +725,9 @@ TdesGetContextSize (
   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 ASSERT().\r
-  If Key is NULL, then ASSERT().\r
-  If KeyLength is not valid, then ASSERT().\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
 \r
   @param[out]  TdesContext  Pointer to TDES context being initialized.\r
   @param[in]   Key          Pointer to the user-supplied TDES key.\r
@@ -755,10 +755,10 @@ TdesInit (
   TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
   invalid TDES context is undefined.\r
 \r
-  If TdesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (8 bytes), then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   TdesContext  Pointer to the TDES context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
@@ -788,10 +788,10 @@ TdesEcbEncrypt (
   TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
   invalid TDES context is undefined.\r
 \r
-  If TdesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (8 bytes), then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   TdesContext  Pointer to the TDES context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be decrypted.\r
@@ -822,11 +822,11 @@ TdesEcbDecrypt (
   TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
   invalid TDES context is undefined.\r
 \r
-  If TdesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (8 bytes), then ASSERT().\r
-  If Ivec is NULL, then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   TdesContext  Pointer to the TDES context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
@@ -859,11 +859,11 @@ TdesCbcEncrypt (
   TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
   invalid TDES context is undefined.\r
 \r
-  If TdesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (8 bytes), then ASSERT().\r
-  If Ivec is NULL, then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   TdesContext  Pointer to the TDES context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
@@ -905,9 +905,9 @@ AesGetContextSize (
   operations.\r
   There are 3 options for key length, 128 bits, 192 bits, and 256 bits.\r
 \r
-  If AesContext is NULL, then ASSERT().\r
-  If Key is NULL, then ASSERT().\r
-  If KeyLength is not valid, then ASSERT().\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
 \r
   @param[out]  AesContext  Pointer to AES context being initialized.\r
   @param[in]   Key         Pointer to the user-supplied AES key.\r
@@ -935,10 +935,10 @@ AesInit (
   AesContext should be already correctly initialized by AesInit(). Behavior with\r
   invalid AES context is undefined.\r
 \r
-  If AesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (16 bytes), then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   AesContext  Pointer to the AES context.\r
   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.\r
@@ -968,10 +968,10 @@ AesEcbEncrypt (
   AesContext should be already correctly initialized by AesInit(). Behavior with\r
   invalid AES context is undefined.\r
 \r
-  If AesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (16 bytes), then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   AesContext  Pointer to the AES context.\r
   @param[in]   Input       Pointer to the buffer containing the data to be decrypted.\r
@@ -1002,11 +1002,11 @@ AesEcbDecrypt (
   AesContext should be already correctly initialized by AesInit(). Behavior with\r
   invalid AES context is undefined.\r
 \r
-  If AesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (16 bytes), then ASSERT().\r
-  If Ivec is NULL, then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   AesContext  Pointer to the AES context.\r
   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.\r
@@ -1039,11 +1039,11 @@ AesCbcEncrypt (
   AesContext should be already correctly initialized by AesInit(). Behavior with\r
   invalid AES context is undefined.\r
 \r
-  If AesContext is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If InputSize is not multiple of block size (16 bytes), then ASSERT().\r
-  If Ivec is NULL, then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   AesContext  Pointer to the AES context.\r
   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.\r
@@ -1084,9 +1084,9 @@ Arc4GetContextSize (
   In addtion, it sets up all ARC4 key materials for subsequent encryption and decryption\r
   operations.\r
 \r
-  If Arc4Context is NULL, then ASSERT().\r
-  If Key is NULL, then ASSERT().\r
-  If KeySize does not in the range of [5, 256] bytes, then ASSERT().\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
 \r
   @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
   @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
@@ -1112,9 +1112,9 @@ Arc4Init (
   Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
   invalid ARC4 context is undefined.\r
 \r
-  If Arc4Context is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   Arc4Context  Pointer to the ARC4 context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.\r
@@ -1142,9 +1142,9 @@ Arc4Encrypt (
   Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
   invalid ARC4 context is undefined.\r
 \r
-  If Arc4Context is NULL, then ASSERT().\r
-  If Input is NULL, then ASSERT().\r
-  If Output is NULL, then ASSERT().\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
 \r
   @param[in]   Arc4Context  Pointer to the ARC4 context.\r
   @param[in]   Input        Pointer to the buffer containing the data to be decrypted.\r
@@ -1172,7 +1172,7 @@ Arc4Decrypt (
   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 ASSERT().\r
+  If Arc4Context is NULL, then return FALSE.\r
 \r
   @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
 \r
@@ -1206,7 +1206,7 @@ RsaNew (
 /**\r
   Release the specified RSA context.\r
 \r
-  If RsaContext is NULL, then ASSERT().\r
+  If RsaContext is NULL, then return FALSE.\r
 \r
   @param[in]  RsaContext  Pointer to the RSA context to be released.\r
 \r
@@ -1225,7 +1225,7 @@ RsaFree (
   represented in RSA PKCS#1).\r
   If BigNumber is NULL, then the specified key componenet in RSA context is cleared.\r
 \r
-  If RsaContext is NULL, then ASSERT().\r
+  If RsaContext is NULL, 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
@@ -1259,9 +1259,9 @@ RsaSetKey (
   If the BigNumber buffer is too small to hold the contents of the key, FALSE\r
   is returned and BnSize is set to the required buffer size to obtain the key.\r
 \r
-  If RsaContext is NULL, then ASSERT().\r
-  If BnSize is NULL, then ASSERT().\r
-  If BnSize is large enough but BigNumber is NULL, then ASSERT().\r
+  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
 \r
   @param[in, out]  RsaContext  Pointer to RSA context being set.\r
   @param[in]       KeyTag      Tag of RSA key component being set.\r
@@ -1293,7 +1293,7 @@ RsaGetKey (
   Before this function can be invoked, pseudorandom number generator must be correctly\r
   initialized by RandomSeed().\r
 \r
-  If RsaContext is NULL, then ASSERT().\r
+  If RsaContext is NULL, 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
@@ -1322,7 +1322,7 @@ RsaGenerateKey (
   - Whether n = p * q\r
   - Whether d*e = 1  mod lcm(p-1,q-1)\r
 \r
-  If RsaContext is NULL, then ASSERT().\r
+  If RsaContext is NULL, then return FALSE.\r
 \r
   @param[in]  RsaContext  Pointer to RSA context to check.\r
 \r
@@ -1344,10 +1344,10 @@ RsaCheckKey (
   If the Signature buffer is too small to hold the contents of signature, FALSE\r
   is returned and SigSize is set to the required buffer size to obtain the signature.\r
 \r
-  If RsaContext is NULL, then ASSERT().\r
-  If MessageHash is NULL, then ASSERT().\r
-  If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then ASSERT().\r
-  If SigSize is large enough but Signature is NULL, then ASSERT().\r
+  If RsaContext is NULL, then return FALSE.\r
+  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
 \r
   @param[in]      RsaContext   Pointer to RSA context for signature generation.\r
   @param[in]      MessageHash  Pointer to octet message hash to be signed.\r
@@ -1375,10 +1375,10 @@ RsaPkcs1Sign (
   Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in\r
   RSA PKCS#1.\r
 \r
-  If RsaContext is NULL, then ASSERT().\r
-  If MessageHash is NULL, then ASSERT().\r
-  If Signature is NULL, then ASSERT().\r
-  If HashSize is not equal to the size of MD5, SHA-1, SHA-256 digest, then ASSERT().\r
+  If RsaContext is NULL, then return FALSE.\r
+  If MessageHash is NULL, then return FALSE.\r
+  If Signature is NULL, then return FALSE.\r
+  If HashSize is not equal to the size of MD5, SHA-1, SHA-256 digest, then return FALSE.\r
 \r
   @param[in]  RsaContext   Pointer to RSA context for signature verification.\r
   @param[in]  MessageHash  Pointer to octet message hash to be checked.\r
@@ -1410,8 +1410,8 @@ RsaPkcs1Verify (
                            RSA private key component. Use RsaFree() function to free the\r
                            resource.\r
 \r
-  If PemData is NULL, then ASSERT().\r
-  If RsaContext is NULL, then ASSERT().\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
@@ -1435,8 +1435,8 @@ RsaGetPrivateKeyFromPem (
                            RSA public key component. Use RsaFree() function to free the\r
                            resource.\r
 \r
-  If Cert is NULL, then ASSERT().\r
-  If RsaContext is NULL, then ASSERT().\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
@@ -1459,8 +1459,8 @@ RsaGetPublicKeyFromX509 (
   @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 ASSERT().\r
-  If SubjectSize is NULL, then ASSERT().\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
@@ -1484,8 +1484,8 @@ X509GetSubjectName (
   @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 ASSERT().\r
-  If CACert is NULL, then ASSERT().\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
@@ -1504,8 +1504,8 @@ X509VerifyCert (
 /**\r
   Construct a X509 object from DER-encoded certificate data.\r
 \r
-  If Cert is NULL, then ASSERT().\r
-  If SingleX509Cert is NULL, then ASSERT().\r
+  If Cert is NULL, then return FALSE.\r
+  If SingleX509Cert is NULL, 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
@@ -1526,7 +1526,7 @@ X509ConstructCertificate (
 /**\r
   Construct a X509 stack object from a list of DER-encoded certificate data.\r
 \r
-  If X509Stack is NULL, then ASSERT().\r
+  If X509Stack is NULL, 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
@@ -1549,7 +1549,7 @@ X509ConstructCertificateStack (
 /**\r
   Release the specified X509 object.\r
 \r
-  If X509Cert is NULL, then ASSERT().\r
+  If X509Cert is NULL, then return FALSE.\r
 \r
   @param[in]  X509Cert  Pointer to the X509 object to be released.\r
 \r
@@ -1563,7 +1563,7 @@ X509Free (
 /**\r
   Release the specified X509 stack object.\r
 \r
-  If X509Stack is NULL, then ASSERT().\r
+  If X509Stack is NULL, then return FALSE.\r
 \r
   @param[in]  X509Stack  Pointer to the X509 stack object to be released.\r
 \r
@@ -1615,7 +1615,7 @@ Pkcs7Sign (
   Verifies the validility of a PKCS#7 signed data as described in "PKCS #7: Cryptographic\r
   Message Syntax Standard".\r
 \r
-  If P7Data is NULL, then ASSERT().\r
+  If P7Data is NULL, then return FALSE.\r
 \r
   @param[in]  P7Data       Pointer to the PKCS#7 message to verify.\r
   @param[in]  P7Size       Size of the PKCS#7 message in bytes.\r
@@ -1644,8 +1644,8 @@ Pkcs7Verify (
   Verifies the validility of a PE/COFF Authenticode Signature as described in "Windows\r
   Authenticode Portable Executable Signature Format".\r
 \r
-  If AuthData is NULL, then ASSERT().\r
-  If ImageHash is NULL, then ASSERT().\r
+  If AuthData is NULL, then return FALSE.\r
+  If ImageHash is NULL, then return FALSE.\r
 \r
   @param[in]  AuthData     Pointer to the Authenticode Signature retrieved from signed\r
                            PE/COFF image to be verified.\r
@@ -1693,7 +1693,7 @@ DhNew (
 /**\r
   Release the specified DH context.\r
 \r
-  If DhContext is NULL, then ASSERT().\r
+  If DhContext is NULL, then return FALSE.\r
 \r
   @param[in]  DhContext  Pointer to the DH context to be released.\r
 \r
@@ -1713,8 +1713,8 @@ DhFree (
   Before this function can be invoked, pseudorandom number generator must be correctly\r
   initialized by RandomSeed().\r
 \r
-  If DhContext is NULL, then ASSERT().\r
-  If Prime is NULL, then ASSERT().\r
+  If DhContext is NULL, then return FALSE.\r
+  If Prime is NULL, then return FALSE.\r
 \r
   @param[in, out]  DhContext    Pointer to the DH context.\r
   @param[in]       Generator    Value of generator.\r
@@ -1741,8 +1741,8 @@ DhGenerateParameter (
   Given generator g, and prime number p, this function and sets DH\r
   context accordingly.\r
 \r
-  If DhContext is NULL, then ASSERT().\r
-  If Prime is NULL, then ASSERT().\r
+  If DhContext is NULL, then return FALSE.\r
+  If Prime is NULL, then return FALSE.\r
 \r
   @param[in, out]  DhContext    Pointer to the DH context.\r
   @param[in]       Generator    Value of generator.\r
@@ -1773,9 +1773,9 @@ DhSetParameter (
   If the PublicKey buffer is too small to hold the public key, FALSE is returned and\r
   PublicKeySize is set to the required buffer size to obtain the public key.\r
 \r
-  If DhContext is NULL, then ASSERT().\r
-  If PublicKeySize is NULL, then ASSERT().\r
-  If PublicKeySize is large enough but PublicKey is NULL, then ASSERT().\r
+  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
 \r
   @param[in, out]  DhContext      Pointer to the DH context.\r
   @param[out]      PublicKey      Pointer to the buffer to receive generated public key.\r
@@ -1801,10 +1801,10 @@ DhGenerateKey (
   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
 \r
-  If DhContext is NULL, then ASSERT().\r
-  If PeerPublicKey is NULL, then ASSERT().\r
-  If KeySize is NULL, then ASSERT().\r
-  If KeySize is large enough but Key is NULL, then ASSERT().\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
 \r
   @param[in, out]  DhContext          Pointer to the DH context.\r
   @param[in]       PeerPublicKey      Pointer to the peer's public key.\r
@@ -1858,7 +1858,7 @@ RandomSeed (
 /**\r
   Generates a pseudorandom byte stream of the specified size.\r
 \r
-  If Output is NULL, then ASSERT().\r
+  If Output is NULL, 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