1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge pull request #185 from gilles-peskine-arm/harvard-md

Remove method dispatch from md
This commit is contained in:
Jaeden Amero
2019-09-10 18:38:39 +01:00
committed by GitHub
6 changed files with 436 additions and 649 deletions

View File

@ -46,42 +46,17 @@ extern "C" {
*/
struct mbedtls_md_info_t
{
/** Digest identifier */
mbedtls_md_type_t type;
/** Name of the message digest */
const char * name;
/** Digest identifier */
mbedtls_md_type_t type;
/** Output length of the digest function in bytes */
int size;
unsigned char size;
/** Block length of the digest function in bytes */
int block_size;
/** Digest initialisation function */
int (*starts_func)( void *ctx );
/** Digest update function */
int (*update_func)( void *ctx, const unsigned char *input, size_t ilen );
/** Digest finalisation function */
int (*finish_func)( void *ctx, unsigned char *output );
/** Generic digest function */
int (*digest_func)( const unsigned char *input, size_t ilen,
unsigned char *output );
/** Allocate a new context */
void * (*ctx_alloc_func)( void );
/** Free the given context */
void (*ctx_free_func)( void *ctx );
/** Clone state from a context */
void (*clone_func)( void *dst, const void *src );
/** Internal use only */
int (*process_func)( void *ctx, const unsigned char *input );
unsigned char block_size;
};
#if defined(MBEDTLS_MD2_C)