NDEVR
API Documentation
md5.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: md5
29Included in API: False
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33/*
34 * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
35 * MD5 Message-Digest Algorithm (RFC 1321).
36 *
37 * Homepage:
38 * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
39 *
40 * Author:
41 * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
42 *
43 * This software was written by Alexander Peslyak in 2001. No copyright is
44 * claimed, and the software is hereby placed in the public domain.
45 * In case this attempt to disclaim copyright and place the software in the
46 * public domain is deemed null and void, then the software is
47 * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
48 * general public under the following terms:
49 *
50 * Redistribution and use in source and binary forms, with or without
51 * modification, are permitted.
52 *
53 * There's ABSOLUTELY NO WARRANTY, express or implied.
54 *
55 * See md5.c for more information.
56 */
57
58#ifdef HAVE_OPENSSL
59#include <openssl/md5.h>
60#elif !defined(_MD5_H)
61#define _MD5_H
62namespace NDEVR
63{
65 typedef unsigned int MD5_u32plus;
79
82 class MD5
83 {
84 public:
89 static void MD5_Init(MD5_CTX *ctx);
96 static void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
102 static void MD5_Final(unsigned char *result, MD5_CTX *ctx);
103 };
104}
105#endif
106
107
Logic for creating an MD5 hash.
Definition md5.h:83
static void MD5_Init(MD5_CTX *ctx)
Initializes the MD5 context to its default starting state.
static void MD5_Final(unsigned char *result, MD5_CTX *ctx)
Finalizes the MD5 computation and writes the 16-byte digest.
static void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size)
Feeds data into the MD5 context for hashing.
The primary namespace for the NDEVR SDK.
unsigned int MD5_u32plus
Unsigned 32-bit integer type used internally by the MD5 algorithm.
Definition md5.h:65
Struct for storing md5 information.
Definition md5.h:69
MD5_u32plus hi
High 32 bits of the total message length in bytes.
Definition md5.h:71
MD5_u32plus b
MD5 state variable B.
Definition md5.h:73
MD5_u32plus block[16]
Decoded 32-bit words from the current 64-byte input block.
Definition md5.h:77
unsigned char buffer[64]
Input buffer for accumulating data before processing a full 64-byte block.
Definition md5.h:76
MD5_u32plus c
MD5 state variable C.
Definition md5.h:74
MD5_u32plus lo
Low 32 bits of the total message length in bytes.
Definition md5.h:70
MD5_u32plus d
MD5 state variable D.
Definition md5.h:75
MD5_u32plus a
MD5 state variable A.
Definition md5.h:72