]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Universal/Network/IScsiDxe/Md5.h
delete #include <Uefi/UefiBaseType.h>
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / Md5.h
... / ...
CommitLineData
1/** @file\r
2 Header file for Md5.\r
3\r
4Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _MD5_H_\r
16#define _MD5_H_\r
17\r
18#include <Uefi.h>\r
19#include <Library/BaseLib.h>\r
20#include <Library/NetLib.h>\r
21 \r
22#define MD5_HASHSIZE 16\r
23\r
24typedef struct _MD5_CTX {\r
25 EFI_STATUS Status;\r
26 UINT64 Length;\r
27 UINT32 States[MD5_HASHSIZE / sizeof (UINT32)];\r
28 UINT8 M[64];\r
29 UINTN Count;\r
30} MD5_CTX;\r
31\r
32/**\r
33 Initialize four 32-bits chaining variables and use them to do the Md5 transform.\r
34\r
35 @param[in] Md5Ctx The data structure of Md5.\r
36\r
37 @retval EFI_SUCCESS Initialization is ok.\r
38**/\r
39EFI_STATUS\r
40MD5Init (\r
41 IN MD5_CTX *Md5Ctx\r
42 );\r
43\r
44/**\r
45 the external interface of Md5 algorithm\r
46\r
47 @param[in] Md5Ctx The data structure of storing the original data\r
48 segment and the final result.\r
49 @param[in] Data The data wanted to be transformed.\r
50 @param[in] DataLen The length of data.\r
51\r
52 @retval EFI_SUCCESS The transform is ok.\r
53 @retval Others Some unexpected errors happened.\r
54**/\r
55EFI_STATUS\r
56MD5Update (\r
57 IN MD5_CTX *Md5Ctx,\r
58 IN VOID *Data,\r
59 IN UINTN DataLen\r
60 );\r
61\r
62/**\r
63 Accumulate the MD5 value of every data segment and generate the finial\r
64 result according to MD5 algorithm.\r
65\r
66 @param[in] Md5Ctx The data structure of storing the original data\r
67 segment and the final result.\r
68 @param[out] HashVal The final 128-bits output.\r
69\r
70 @retval EFI_SUCCESS The transform is ok.\r
71 @retval Others Some unexpected errors happened.\r
72**/\r
73EFI_STATUS\r
74MD5Final (\r
75 IN MD5_CTX *Md5Ctx,\r
76 OUT UINT8 *HashVal\r
77 );\r
78\r
79#endif \r