51#if !defined(MBEDTLS_CONFIG_FILE)
54#include MBEDTLS_CONFIG_FILE
57#if defined(MBEDTLS_MD_C)
61#if defined(MBEDTLS_MD2_C)
65#if defined(MBEDTLS_MD4_C)
69#if defined(MBEDTLS_MD5_C)
73#if defined(MBEDTLS_RIPEMD160_C)
77#if defined(MBEDTLS_SHA1_C)
81#if defined(MBEDTLS_SHA256_C)
85#if defined(MBEDTLS_SHA512_C)
89#if defined(MBEDTLS_PLATFORM_C)
93#define mbedtls_calloc calloc
94#define mbedtls_free free
97#if defined(MBEDTLS_MD2_C)
99static int md2_starts_wrap(
void *
ctx )
104static int md2_update_wrap(
void *
ctx,
const unsigned char *
input,
110static int md2_finish_wrap(
void *
ctx,
unsigned char *output )
115static void *md2_ctx_alloc(
void )
125static void md2_ctx_free(
void *
ctx )
131static void md2_clone_wrap(
void *
dst,
const void *
src )
137static int md2_process_wrap(
void *
ctx,
const unsigned char *
data )
161#if defined(MBEDTLS_MD4_C)
163static int md4_starts_wrap(
void *
ctx )
168static int md4_update_wrap(
void *
ctx,
const unsigned char *
input,
174static int md4_finish_wrap(
void *
ctx,
unsigned char *output )
179static void *md4_ctx_alloc(
void )
189static void md4_ctx_free(
void *
ctx )
195static void md4_clone_wrap(
void *
dst,
const void *
src )
201static int md4_process_wrap(
void *
ctx,
const unsigned char *
data )
223#if defined(MBEDTLS_MD5_C)
225static int md5_starts_wrap(
void *
ctx )
230static int md5_update_wrap(
void *
ctx,
const unsigned char *
input,
236static int md5_finish_wrap(
void *
ctx,
unsigned char *output )
241static void *md5_ctx_alloc(
void )
251static void md5_ctx_free(
void *
ctx )
257static void md5_clone_wrap(
void *
dst,
const void *
src )
263static int md5_process_wrap(
void *
ctx,
const unsigned char *
data )
285#if defined(MBEDTLS_RIPEMD160_C)
287static int ripemd160_starts_wrap(
void *
ctx )
292static int ripemd160_update_wrap(
void *
ctx,
const unsigned char *
input,
299static int ripemd160_finish_wrap(
void *
ctx,
unsigned char *output )
305static void *ripemd160_ctx_alloc(
void )
315static void ripemd160_ctx_free(
void *
ctx )
321static void ripemd160_clone_wrap(
void *
dst,
const void *
src )
327static int ripemd160_process_wrap(
void *
ctx,
const unsigned char *
data )
338 ripemd160_starts_wrap,
339 ripemd160_update_wrap,
340 ripemd160_finish_wrap,
344 ripemd160_clone_wrap,
345 ripemd160_process_wrap,
350#if defined(MBEDTLS_SHA1_C)
352static int sha1_starts_wrap(
void *
ctx )
357static int sha1_update_wrap(
void *
ctx,
const unsigned char *
input,
364static int sha1_finish_wrap(
void *
ctx,
unsigned char *output )
369static void *sha1_ctx_alloc(
void )
379static void sha1_clone_wrap(
void *
dst,
const void *
src )
385static void sha1_ctx_free(
void *
ctx )
391static int sha1_process_wrap(
void *
ctx,
const unsigned char *
data )
417#if defined(MBEDTLS_SHA256_C)
419static int sha224_starts_wrap(
void *
ctx )
424static int sha224_update_wrap(
void *
ctx,
const unsigned char *
input,
431static int sha224_finish_wrap(
void *
ctx,
unsigned char *output )
437static int sha224_wrap(
const unsigned char *
input,
size_t ilen,
438 unsigned char *output )
443static void *sha224_ctx_alloc(
void )
453static void sha224_ctx_free(
void *
ctx )
459static void sha224_clone_wrap(
void *
dst,
const void *
src )
465static int sha224_process_wrap(
void *
ctx,
const unsigned char *
data )
486static int sha256_starts_wrap(
void *
ctx )
491static int sha256_wrap(
const unsigned char *
input,
size_t ilen,
492 unsigned char *output )
514#if defined(MBEDTLS_SHA512_C)
516static int sha384_starts_wrap(
void *
ctx )
521static int sha384_update_wrap(
void *
ctx,
const unsigned char *
input,
528static int sha384_finish_wrap(
void *
ctx,
unsigned char *output )
534static int sha384_wrap(
const unsigned char *
input,
size_t ilen,
535 unsigned char *output )
540static void *sha384_ctx_alloc(
void )
550static void sha384_ctx_free(
void *
ctx )
556static void sha384_clone_wrap(
void *
dst,
const void *
src )
562static int sha384_process_wrap(
void *
ctx,
const unsigned char *
data )
583static int sha512_starts_wrap(
void *
ctx )
588static int sha512_wrap(
const unsigned char *
input,
size_t ilen,
589 unsigned char *output )
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLenum input
MD2 message digest algorithm (hash function)
void mbedtls_md2_init(mbedtls_md2_context *ctx)
Initialize MD2 context.
void mbedtls_md2_clone(mbedtls_md2_context *dst, const mbedtls_md2_context *src)
Clone (the state of) an MD2 context.
int mbedtls_internal_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
int mbedtls_md2_finish_ret(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
void mbedtls_md2_free(mbedtls_md2_context *ctx)
Clear MD2 context.
int mbedtls_md2_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
int mbedtls_md2_starts_ret(mbedtls_md2_context *ctx)
MD2 context setup.
int mbedtls_md2_update_ret(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
const mbedtls_md_info_t mbedtls_sha384_info
const mbedtls_md_info_t mbedtls_sha1_info
const mbedtls_md_info_t mbedtls_ripemd160_info
const mbedtls_md_info_t mbedtls_sha256_info
const mbedtls_md_info_t mbedtls_sha224_info
const mbedtls_md_info_t mbedtls_md5_info
const mbedtls_md_info_t mbedtls_sha512_info
RIPE MD-160 message digest.
void mbedtls_ripemd160_clone(mbedtls_ripemd160_context *dst, const mbedtls_ripemd160_context *src)
Clone (the state of) an RIPEMD-160 context.
void mbedtls_ripemd160_init(mbedtls_ripemd160_context *ctx)
Initialize RIPEMD-160 context.
int mbedtls_internal_ripemd160_process(mbedtls_ripemd160_context *ctx, const unsigned char data[64])
RIPEMD-160 process data block (internal use only)
void mbedtls_ripemd160_free(mbedtls_ripemd160_context *ctx)
Clear RIPEMD-160 context.
int mbedtls_ripemd160_update_ret(mbedtls_ripemd160_context *ctx, const unsigned char *input, size_t ilen)
RIPEMD-160 process buffer.
int mbedtls_ripemd160_ret(const unsigned char *input, size_t ilen, unsigned char output[20])
Output = RIPEMD-160( input buffer )
int mbedtls_ripemd160_finish_ret(mbedtls_ripemd160_context *ctx, unsigned char output[20])
RIPEMD-160 final digest.
int mbedtls_ripemd160_starts_ret(mbedtls_ripemd160_context *ctx)
RIPEMD-160 context setup.
Configuration options (set of defines)
MD4 message digest algorithm (hash function)
int mbedtls_md4_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD4( input buffer )
int mbedtls_md4_starts_ret(mbedtls_md4_context *ctx)
MD4 context setup.
void mbedtls_md4_free(mbedtls_md4_context *ctx)
Clear MD4 context.
int mbedtls_md4_update_ret(mbedtls_md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 process buffer.
int mbedtls_md4_finish_ret(mbedtls_md4_context *ctx, unsigned char output[16])
MD4 final digest.
void mbedtls_md4_init(mbedtls_md4_context *ctx)
Initialize MD4 context.
void mbedtls_md4_clone(mbedtls_md4_context *dst, const mbedtls_md4_context *src)
Clone (the state of) an MD4 context.
int mbedtls_internal_md4_process(mbedtls_md4_context *ctx, const unsigned char data[64])
MD4 process data block (internal use only)
MD5 message digest algorithm (hash function)
void mbedtls_md5_clone(mbedtls_md5_context *dst, const mbedtls_md5_context *src)
Clone (the state of) an MD5 context.
int mbedtls_internal_md5_process(mbedtls_md5_context *ctx, const unsigned char data[64])
MD5 process data block (internal use only)
void mbedtls_md5_free(mbedtls_md5_context *ctx)
Clear MD5 context.
int mbedtls_md5_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD5( input buffer )
int mbedtls_md5_starts_ret(mbedtls_md5_context *ctx)
MD5 context setup.
void mbedtls_md5_init(mbedtls_md5_context *ctx)
Initialize MD5 context.
int mbedtls_md5_update_ret(mbedtls_md5_context *ctx, const unsigned char *input, size_t ilen)
MD5 process buffer.
int mbedtls_md5_finish_ret(mbedtls_md5_context *ctx, unsigned char output[16])
MD5 final digest.
This file contains SHA-1 definitions and functions.
void mbedtls_sha1_free(mbedtls_sha1_context *ctx)
This function clears a SHA-1 context.
void mbedtls_sha1_clone(mbedtls_sha1_context *dst, const mbedtls_sha1_context *src)
This function clones the state of a SHA-1 context.
int mbedtls_sha1_ret(const unsigned char *input, size_t ilen, unsigned char output[20])
This function calculates the SHA-1 checksum of a buffer.
int mbedtls_sha1_update_ret(mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-1 checksum calculation.
int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64])
SHA-1 process data block (internal use only).
int mbedtls_sha1_starts_ret(mbedtls_sha1_context *ctx)
This function starts a SHA-1 checksum calculation.
int mbedtls_sha1_finish_ret(mbedtls_sha1_context *ctx, unsigned char output[20])
This function finishes the SHA-1 operation, and writes the result to the output buffer.
void mbedtls_sha1_init(mbedtls_sha1_context *ctx)
This function initializes a SHA-1 context.
This file contains SHA-224 and SHA-256 definitions and functions.
void mbedtls_sha256_free(mbedtls_sha256_context *ctx)
This function clears a SHA-256 context.
void mbedtls_sha256_init(mbedtls_sha256_context *ctx)
This function initializes a SHA-256 context.
int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx, const unsigned char data[64])
This function processes a single data block within the ongoing SHA-256 computation....
void mbedtls_sha256_clone(mbedtls_sha256_context *dst, const mbedtls_sha256_context *src)
This function clones the state of a SHA-256 context.
int mbedtls_sha256_ret(const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
This function calculates the SHA-224 or SHA-256 checksum of a buffer.
int mbedtls_sha256_finish_ret(mbedtls_sha256_context *ctx, unsigned char output[32])
This function finishes the SHA-256 operation, and writes the result to the output buffer.
int mbedtls_sha256_starts_ret(mbedtls_sha256_context *ctx, int is224)
This function starts a SHA-224 or SHA-256 checksum calculation.
int mbedtls_sha256_update_ret(mbedtls_sha256_context *ctx, const unsigned char *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-256 checksum calculation.
This file contains SHA-384 and SHA-512 definitions and functions.
int mbedtls_sha512_ret(const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
This function calculates the SHA-512 or SHA-384 checksum of a buffer.
int mbedtls_internal_sha512_process(mbedtls_sha512_context *ctx, const unsigned char data[128])
This function processes a single data block within the ongoing SHA-512 computation....
void mbedtls_sha512_clone(mbedtls_sha512_context *dst, const mbedtls_sha512_context *src)
This function clones the state of a SHA-512 context.
void mbedtls_sha512_free(mbedtls_sha512_context *ctx)
This function clears a SHA-512 context.
int mbedtls_sha512_starts_ret(mbedtls_sha512_context *ctx, int is384)
This function starts a SHA-384 or SHA-512 checksum calculation.
int mbedtls_sha512_update_ret(mbedtls_sha512_context *ctx, const unsigned char *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-512 checksum calculation.
int mbedtls_sha512_finish_ret(mbedtls_sha512_context *ctx, unsigned char output[64])
This function finishes the SHA-512 operation, and writes the result to the output buffer.
void mbedtls_sha512_init(mbedtls_sha512_context *ctx)
This function initializes a SHA-512 context.
RIPEMD-160 context structure.
The SHA-1 context structure.
The SHA-256 context structure.
The SHA-512 context structure.