#ifndef MD5_H_ #define MD5_H_ #include #include #ifdef __cplusplus extern "C" { #endif /** * \brief MD5 context structure */ typedef struct { uint32_t total[2]; /*!< number of bytes processed */ uint32_t state[4]; /*!< intermediate digest state */ unsigned char buffer[64]; /*!< data block being processed */ } mbedtls_md5_context; /** * \brief Initialize MD5 context * * \param ctx MD5 context to be initialized */ void mbedtls_md5_init( mbedtls_md5_context *ctx ); /** * \brief Clone (the state of) an MD5 context * * \param dst The destination context * \param src The context to be cloned */ void mbedtls_md5_clone( mbedtls_md5_context *dst, const mbedtls_md5_context *src ); /** * \brief MD5 context setup * * \param ctx context to be initialized */ void mbedtls_md5_starts( mbedtls_md5_context *ctx ); /** * \brief MD5 process buffer * * \param ctx MD5 context * \param input buffer holding the data * \param ilen length of the input data */ void mbedtls_md5_update( mbedtls_md5_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief MD5 final digest * * \param ctx MD5 context * \param output MD5 checksum result */ void mbedtls_md5_finish( mbedtls_md5_context *ctx, unsigned char output[16] ); /* Internal use */ void mbedtls_md5_process( mbedtls_md5_context *ctx, const unsigned char data[64] ); /** * \brief Output = MD5( input buffer ) * * \param input buffer holding the data * \param ilen length of the input data * \param output MD5 checksum result */ void mbedtls_md5( const unsigned char *input, size_t ilen, unsigned char output[16] ); #ifdef __cplusplus } #endif #endif /*MD5_H_*/