Radcli library 1.4.0
A simple radius library
Loading...
Searching...
No Matches
rc-md5.c
1/* MD5 message-digest algorithm */
2
3/* This file is licensed under the BSD License, but is largely derived from
4 * public domain source code
5 */
6
7/*
8 * FORCE MD5 TO USE OUR MD5 HEADER FILE!
9 *
10 * If we don't do this, it might pick up the systems broken MD5.
11 */
12#include "rc-md5.h"
13
14/*- Hash the provided data using MD5
15 *
16 * @param[out] output will hold a 16-byte checksum.
17 * @param[in] input pointer to data to hash.
18 * @param[in] inlen the length of input.
19 -*/
20void rc_md5_calc(unsigned char *output, unsigned char const *input,
21 size_t inlen)
22{
23 MD5_CTX context;
24
25 MD5Init(&context);
26 MD5Update(&context, input, inlen);
27 MD5Final(output, &context);
28}
29