// for backup copy. When Arc4Reset() is called, we can use the backup copy to restore\r
// the working copy to the initial state.\r
//\r
- return (UINTN) (2 * sizeof(RC4_KEY));\r
+ return (UINTN) (2 * sizeof (RC4_KEY));\r
}\r
\r
/**\r
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
\r
RC4_set_key (Rc4Key, (UINT32) KeySize, Key);\r
\r
- CopyMem (Rc4Key + 1, Rc4Key, sizeof(RC4_KEY));\r
+ CopyMem (Rc4Key + 1, Rc4Key, sizeof (RC4_KEY));\r
\r
return TRUE;\r
}\r
//\r
// Check input parameters.\r
//\r
- if (Arc4Context == NULL || Input == NULL || Output == NULL) {\r
+ if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {\r
return FALSE;\r
}\r
\r
//\r
// Check input parameters.\r
//\r
- if (Arc4Context == NULL || Input == NULL || Output == NULL) {\r
+ if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {\r
return FALSE;\r
}\r
\r
\r
Rc4Key = (RC4_KEY *) Arc4Context;\r
\r
- CopyMem (Rc4Key, Rc4Key + 1, sizeof(RC4_KEY));\r
+ CopyMem (Rc4Key, Rc4Key + 1, sizeof (RC4_KEY));\r
\r
return TRUE;\r
}\r