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