CRYPTO-C v1.1.3
C/C++ Documentation
md5.h File Reference

Go to the source code of this file.

#include "utildev.h"

Detailed Description

MD5 hash function support.

This file is based on Brad Conte's basic implementations of cryptography algorithms...

https://github.com/B-Con/crypto-algorithms

... which was released into the Public Domain.

Macros

#define MD5LEN   16
 MD5 message digest length, in bytes.
 

Data Structures

struct  MD5_CTX
 

Functions

void md5_init (MD5_CTX *ctx)
 Initialize a MD5 context. More...
 
void md5_update (MD5_CTX *ctx, const void *in, size_t inlen)
 Add inlen bytes from in to a MD5 context for hashing. More...
 
void md5_final (MD5_CTX *ctx, void *out)
 Finalize a MD5 message digest. More...
 
void md5 (const void *in, size_t inlen, void *out)
 Convenient all-in-one MD5 computation. More...
 

Function Documentation

◆ md5()

void md5 ( const void *  in,
size_t  inlen,
void *  out 
)

Convenient all-in-one MD5 computation.

Performs md5_init(), md5_update() and md5_final(), and places the resulting hash in out.

Parameters
inPointer to data to hash
inlenLength of in data, in bytes
outPointer to location to place the message digest

◆ md5_final()

void md5_final ( MD5_CTX ctx,
void *  out 
)

Finalize a MD5 message digest.

Generate the MD5 message digest and place in out.

Parameters
ctxPointer to MD5 context
outPointer to location to place the message digest

◆ md5_init()

void md5_init ( MD5_CTX ctx)

Initialize a MD5 context.

Parameters
ctxPointer to MD5 context

◆ md5_update()

void md5_update ( MD5_CTX ctx,
const void *  in,
size_t  inlen 
)

Add inlen bytes from in to a MD5 context for hashing.

Parameters
ctxPointer to MD5 context
inPointer to data to hash
inlenLength of in data, in bytes