]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c
Fix some typo and coding style issues in BaseCryptLib instances.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Cipher / CryptTdes.c
index 8213718b42642f89ec75451d5daa0278533561e5..f3a1eb7293de8da7c88a5abf16463ad6e46f7d29 100644 (file)
@@ -37,7 +37,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
@@ -76,9 +76,9 @@ TdesInit (
   KeySchedule = (DES_key_schedule *) TdesContext;\r
 \r
   //\r
-  // \r
+  // If input Key is a weak key, return error.\r
   //\r
-  if (DES_is_weak_key ((const_DES_cblock *) Key)) {\r
+  if (DES_is_weak_key ((const_DES_cblock *) Key) == 1) {\r
     return FALSE;\r
   }\r
 \r
@@ -90,7 +90,7 @@ TdesInit (
     return TRUE;\r
   }\r
 \r
-  if (DES_is_weak_key ((const_DES_cblock *) Key + 8)) {\r
+  if (DES_is_weak_key ((const_DES_cblock *) Key + 8) == 1) {\r
     return FALSE;\r
   }\r
 \r
@@ -101,7 +101,7 @@ TdesInit (
     return TRUE;\r
   }\r
 \r
-  if (DES_is_weak_key ((const_DES_cblock *) Key + 16)) {\r
+  if (DES_is_weak_key ((const_DES_cblock *) Key + 16) == 1) {\r
     return FALSE;\r
   }\r
 \r