OneCore⢠Storage SDK Release 11.2
User Space iSCSI Target RAMD Driver (Uspace ocs_iscsi_ramd)
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
ocs_md5.h
Go to the documentation of this file.
1
/*
2
* This is the header file for the MD5 message-digest algorithm.
3
* The algorithm is due to Ron Rivest. This code was
4
* written by Colin Plumb in 1993, no copyright is claimed.
5
* This code is in the public domain; do with it what you wish.
6
*
7
* Equivalent code is available from RSA Data Security, Inc.
8
* This code has been tested against that, and is equivalent,
9
* except that you don't need to include two pages of legalese
10
* with every copy.
11
*
12
* To compute the message digest of a chunk of bytes, declare an
13
* MD5Context structure, pass it to MD5Init, call MD5Update as
14
* needed on buffers full of bytes, and then call MD5Final, which
15
* will fill a supplied 16-byte array with the digest.
16
*
17
* Changed so as no longer to depend on Colin Plumb's `usual.h'
18
* header definitions; now uses stuff from dpkg's config.h
19
* - Ian Jackson <ijackson@nyx.cs.du.edu>.
20
* Still in the public domain.
21
*/
22
23
/*
24
* Copyright (c) 2011-2015, Emulex
25
* All rights reserved.
26
*
27
* Redistribution and use in source and binary forms, with or without
28
* modification, are permitted provided that the following conditions are met:
29
*
30
* 1. Redistributions of source code must retain the above copyright notice,
31
* this list of conditions and the following disclaimer.
32
*
33
* 2. Redistributions in binary form must reproduce the above copyright notice,
34
* this list of conditions and the following disclaimer in the documentation
35
* and/or other materials provided with the distribution.
36
*
37
* 3. Neither the name of the copyright holder nor the names of its contributors
38
* may be used to endorse or promote products derived from this software
39
* without specific prior written permission.
40
*
41
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
42
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
45
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
46
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
47
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
48
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
49
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
51
* POSSIBILITY OF SUCH DAMAGE.
52
*
53
*/
54
55
/**
56
* @file
57
* Defines the interfaces to the standard MD5 routines.
58
*/
59
60
#ifndef _OCS_MD5_H
61
#define _OCS_MD5_H
62
63
#include "ocs_os.h"
64
65
#define md5byte unsigned char
66
67
/* MD5 context. */
68
typedef
struct
{
69
uint32_t buf[4];
/* state (ABCD) */
70
uint32_t bytes[2];
/* number of bits, modulo 2^64 (lsb first) */
71
uint32_t in[16];
/* input buffer */
72
}
ocs_md5_ctx_t
;
73
74
void
ocs_md5_init
(
ocs_md5_ctx_t
*);
75
void
ocs_md5_update
(
ocs_md5_ctx_t
*,
md5byte
const
*buf,
unsigned
len);
76
void
ocs_md5_final
(
unsigned
char
[16],
ocs_md5_ctx_t
*);
77
78
#endif
/* !_OCS_MD5_H */
79
80
/* vim: set noexpandtab textwidth=120: */
ocs_md5_final
void ocs_md5_final(md5byte digest[16], ocs_md5_ctx_t *ctx)
Definition:
ocs_md5.c:132
ocs_md5_init
void ocs_md5_init(ocs_md5_ctx_t *ctx)
Definition:
ocs_md5.c:70
md5byte
#define md5byte
Definition:
ocs_md5.h:65
ocs_md5_update
void ocs_md5_update(ocs_md5_ctx_t *ctx, md5byte const *buf, unsigned len)
Definition:
ocs_md5.c:90
ocs_md5_ctx_t
Definition:
ocs_md5.h:68
common
ocs_iscsi
ocs_md5.h