Loading...
Searching...
No Matches
md2.h
Go to the documentation of this file.
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*
*/
#ifndef MBEDTLS_MD2_H
#define MBEDTLS_MD2_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
/* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(MBEDTLS_MD2_ALT)
// Regular implementation
//
typedef struct mbedtls_md2_context {
unsigned char cksum[16];
unsigned char state[48];
unsigned char buffer[16];
size_t left;
}
mbedtls_md2_context;
#else /* MBEDTLS_MD2_ALT */
#include "md2_alt.h"
#endif /* MBEDTLS_MD2_ALT */
void mbedtls_md2_init(mbedtls_md2_context *ctx);
void mbedtls_md2_free(mbedtls_md2_context *ctx);
void mbedtls_md2_clone(mbedtls_md2_context *dst,
const mbedtls_md2_context *src);
int mbedtls_md2_starts_ret(mbedtls_md2_context *ctx);
int mbedtls_md2_update_ret(mbedtls_md2_context *ctx,
const unsigned char *input,
size_t ilen);
int mbedtls_md2_finish_ret(mbedtls_md2_context *ctx,
unsigned char output[16]);
int mbedtls_internal_md2_process(mbedtls_md2_context *ctx);
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
#if defined(MBEDTLS_DEPRECATED_WARNING)
#define MBEDTLS_DEPRECATED __attribute__((deprecated))
#else
#define MBEDTLS_DEPRECATED
#endif
MBEDTLS_DEPRECATED void mbedtls_md2_starts(mbedtls_md2_context *ctx);
MBEDTLS_DEPRECATED void mbedtls_md2_update(mbedtls_md2_context *ctx,
const unsigned char *input,
size_t ilen);
MBEDTLS_DEPRECATED void mbedtls_md2_finish(mbedtls_md2_context *ctx,
unsigned char output[16]);
MBEDTLS_DEPRECATED void mbedtls_md2_process(mbedtls_md2_context *ctx);
#undef MBEDTLS_DEPRECATED
#endif /* !MBEDTLS_DEPRECATED_REMOVED */
int mbedtls_md2_ret(const unsigned char *input,
size_t ilen,
unsigned char output[16]);
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
#if defined(MBEDTLS_DEPRECATED_WARNING)
#define MBEDTLS_DEPRECATED __attribute__((deprecated))
#else
#define MBEDTLS_DEPRECATED
#endif
MBEDTLS_DEPRECATED void mbedtls_md2(const unsigned char *input,
size_t ilen,
unsigned char output[16]);
#undef MBEDTLS_DEPRECATED
#endif /* !MBEDTLS_DEPRECATED_REMOVED */
#if defined(MBEDTLS_SELF_TEST)
int mbedtls_md2_self_test(int verbose);
#endif /* MBEDTLS_SELF_TEST */
#ifdef __cplusplus
}
#endif
#endif /* mbedtls_md2.h */
config.h
Configuration options (set of defines)
mbedtls_md2_init
void mbedtls_md2_init(mbedtls_md2_context *ctx)
Initialize MD2 context.
mbedtls_md2_finish
MBEDTLS_DEPRECATED void mbedtls_md2_finish(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
mbedtls_md2_self_test
int mbedtls_md2_self_test(int verbose)
Checkup routine.
mbedtls_md2_clone
void mbedtls_md2_clone(mbedtls_md2_context *dst, const mbedtls_md2_context *src)
Clone (the state of) an MD2 context.
mbedtls_internal_md2_process
int mbedtls_internal_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
mbedtls_md2_finish_ret
int mbedtls_md2_finish_ret(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
mbedtls_md2_process
MBEDTLS_DEPRECATED void mbedtls_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
mbedtls_md2_free
void mbedtls_md2_free(mbedtls_md2_context *ctx)
Clear MD2 context.
MBEDTLS_DEPRECATED
#define MBEDTLS_DEPRECATED
Definition md2.h:160
mbedtls_md2
MBEDTLS_DEPRECATED void mbedtls_md2(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
mbedtls_md2_ret
int mbedtls_md2_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
mbedtls_md2_starts_ret
int mbedtls_md2_starts_ret(mbedtls_md2_context *ctx)
MD2 context setup.
mbedtls_md2_update_ret
int mbedtls_md2_update_ret(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
mbedtls_md2_starts
MBEDTLS_DEPRECATED void mbedtls_md2_starts(mbedtls_md2_context *ctx)
MD2 context setup.
mbedtls_md2_update
MBEDTLS_DEPRECATED void mbedtls_md2_update(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
mbedtls_md2_context
MD2 context structure.
Definition md2.h:46
mbedtls_md2_context::cksum
unsigned char cksum[16]
Definition md2.h:47
mbedtls_md2_context::state
unsigned char state[48]
Definition md2.h:48
mbedtls_md2_context::left
size_t left
Definition md2.h:50
mbedtls_md2_context::buffer
unsigned char buffer[16]
Definition md2.h:49