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
//\r
// Check input parameters.\r
//\r
- if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) {\r
+ if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) {\r
+ return FALSE;\r
+ }\r
+\r
+ if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {\r
return FALSE;\r
}\r
\r
//\r
// Check input parameters.\r
//\r
- if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) {\r
+ if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) {\r
+ return FALSE;\r
+ }\r
+\r
+ if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {\r
return FALSE;\r
}\r
\r