Accelerated SHA-1 Hash FunctionCryptography Hardware Acceleration Plugins

Detailed Description

Accelerated SHA-1 cryptographic hash function using the CRYPTO peripheral.

Data Structures

struct  mbedtls_sha1_context
 SHA-1 context structure.
 

Functions

void mbedtls_sha1_init (mbedtls_sha1_context *ctx)
 Initialize SHA-1 context.
 
void mbedtls_sha1_free (mbedtls_sha1_context *ctx)
 Clear SHA-1 context.
 
void mbedtls_sha1_clone (mbedtls_sha1_context *dst, const mbedtls_sha1_context *src)
 Clone (the state of) a SHA-1 context.
 
int mbedtls_sha1_starts_ret (mbedtls_sha1_context *ctx)
 SHA-1 context setup.
 
int mbedtls_sha1_update_ret (mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
 SHA-1 process buffer.
 
int mbedtls_sha1_finish_ret (mbedtls_sha1_context *ctx, unsigned char output[20])
 SHA-1 final digest.
 
int mbedtls_internal_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64])
 SHA-1 process data block (internal use only)
 

Function Documentation

int mbedtls_internal_sha1_process ( mbedtls_sha1_context ctx,
const unsigned char  data[64] 
)

SHA-1 process data block (internal use only)

Parameters
ctxSHA-1 context
dataThe data block being processed.
Returns
0 if successful
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.
void mbedtls_sha1_clone ( mbedtls_sha1_context dst,
const mbedtls_sha1_context src 
)

Clone (the state of) a SHA-1 context.

Parameters
dstThe destination context
srcThe context to be cloned
int mbedtls_sha1_finish_ret ( mbedtls_sha1_context ctx,
unsigned char  output[20] 
)

SHA-1 final digest.

Parameters
ctxSHA-1 context
outputSHA-1 checksum result
Returns
0 if successful
void mbedtls_sha1_free ( mbedtls_sha1_context ctx)

Clear SHA-1 context.

Parameters
ctxSHA-1 context to be cleared
void mbedtls_sha1_init ( mbedtls_sha1_context ctx)

Initialize SHA-1 context.

Parameters
ctxSHA-1 context to be initialized
int mbedtls_sha1_starts_ret ( mbedtls_sha1_context ctx)

SHA-1 context setup.

Parameters
ctxcontext to be initialized
Returns
0 if successful
int mbedtls_sha1_update_ret ( mbedtls_sha1_context ctx,
const unsigned char *  input,
size_t  ilen 
)

SHA-1 process buffer.

Parameters
ctxSHA-1 context
inputbuffer holding the data
ilenlength of the input data
Returns
0 if successful