/** @file\r
Implementation of MD5 algorithm.\r
\r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, 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
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
};\r
\r
//\r
\r
/**\r
Tf1 is one basic MD5 transform function.\r
- \r
+\r
@param[in] A A 32-bit quantity.\r
- @param[in] B A 32-bit quantity. \r
+ @param[in] B A 32-bit quantity.\r
@param[in] C A 32-bit quantity.\r
\r
@return Output was produced as a 32-bit quantity based on the\r
- three 32-bit input quantity. \r
+ three 32-bit input quantity.\r
**/\r
-UINT32 \r
+UINT32\r
Tf1 (\r
- IN UINT32 A, \r
- IN UINT32 B, \r
+ IN UINT32 A,\r
+ IN UINT32 B,\r
IN UINT32 C\r
)\r
{\r
\r
/**\r
Tf2 is one basic MD5 transform function.\r
- \r
+\r
@param[in] A A 32-bit quantity.\r
- @param[in] B A 32-bit quantity. \r
+ @param[in] B A 32-bit quantity.\r
@param[in] C A 32-bit quantity.\r
\r
@return Output was produced as a 32-bit quantity based on the\r
- three 32-bit input quantity. \r
+ three 32-bit input quantity.\r
**/\r
-UINT32 \r
+UINT32\r
Tf2 (\r
- IN UINT32 A, \r
- IN UINT32 B, \r
+ IN UINT32 A,\r
+ IN UINT32 B,\r
IN UINT32 C\r
)\r
{\r
\r
/**\r
Tf3 is one basic MD5 transform function.\r
- \r
+\r
@param[in] A A 32-bit quantity.\r
- @param[in] B A 32-bit quantity. \r
+ @param[in] B A 32-bit quantity.\r
@param[in] C A 32-bit quantity.\r
\r
@return Output was produced as a 32-bit quantity based on the\r
- three 32-bit input quantity. \r
+ three 32-bit input quantity.\r
**/\r
-UINT32 \r
+UINT32\r
Tf3 (\r
- IN UINT32 A, \r
- IN UINT32 B, \r
+ IN UINT32 A,\r
+ IN UINT32 B,\r
IN UINT32 C\r
)\r
{\r
\r
/**\r
Tf4 is one basic MD5 transform function.\r
- \r
+\r
@param[in] A A 32-bit quantity.\r
- @param[in] B A 32-bit quantity. \r
+ @param[in] B A 32-bit quantity.\r
@param[in] C A 32-bit quantity.\r
\r
@return Output was produced as a 32-bit quantity based on the\r
- three 32-bit input quantity. \r
+ three 32-bit input quantity.\r
**/\r
-UINT32 \r
+UINT32\r
Tf4 (\r
- IN UINT32 A, \r
- IN UINT32 B, \r
+ IN UINT32 A,\r
+ IN UINT32 B,\r
IN UINT32 C\r
)\r
{\r
Copy data segment into the M field of MD5_CTX structure for later transform.\r
If the length of data segment is larger than 64 bytes, then does the transform\r
immediately and the generated Md5 code is stored in the States field of MD5_CTX\r
- data struct for later accumulation. \r
+ data struct for later accumulation.\r
All of Md5 code generated for the sequential 64-bytes data segaments are be\r
accumulated in MD5Final() function.\r
\r
for (Limit = 64 - Md5Ctx->Count; DataLen >= 64 - Md5Ctx->Count; Limit = 64) {\r
CopyMem (Md5Ctx->M + Md5Ctx->Count, (VOID *)Data, Limit);\r
MD5Transform (Md5Ctx);\r
- \r
+\r
Md5Ctx->Count = 0;\r
Data += Limit;\r
DataLen -= Limit;\r
Md5Ctx->States[0] = 0x67452301;\r
Md5Ctx->States[1] = 0xefcdab89;\r
Md5Ctx->States[2] = 0x98badcfe;\r
- Md5Ctx->States[3] = 0x10325476; \r
+ Md5Ctx->States[3] = 0x10325476;\r
\r
return EFI_SUCCESS;\r
}\r
//\r
CopyMem (HashVal, (UINT8 *) Md5Ctx->States, MD5_HASHSIZE);\r
ZeroMem ((UINT8 *)Md5Ctx, sizeof (*Md5Ctx));\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r