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
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
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
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