Detailed Description

Accelerated mbed TLS SHA-384/SHA-512 cryptographic hash function for the mbed TLS API using Silicon Labs peripherals. This implementation builds on the PSA Crypto drivers (Silicon Labs Cryptography Hardware Acceleration Plugins for PSA Crypto).

Macros

#define SL_HASH_OPERATION_CTX_TYPE   sli_se_transparent_hash_operation_t
 

Typedefs

typedef SL_HASH_OPERATION_CTX_TYPE mbedtls_sha512_context
 SHA-512 context structure.
 

Functions

void mbedtls_sha512_init (mbedtls_sha512_context *ctx)
 Initialize SHA-512 context.
 
void mbedtls_sha512_free (mbedtls_sha512_context *ctx)
 Clear SHA-512 context.
 
void mbedtls_sha512_clone (mbedtls_sha512_context *dst, const mbedtls_sha512_context *src)
 Clone (the state of) 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. This function is for internal use only.
 
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.
 

Macro Definition Documentation

#define SL_HASH_OPERATION_CTX_TYPE   sli_se_transparent_hash_operation_t

Definition at line 53 of file sha512_alt.h.

Typedef Documentation

SHA-512 context structure.

Definition at line 67 of file sha512_alt.h.

Function Documentation

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.

Parameters
ctxThe SHA-512 context.
dataThe buffer holding one block of data.
Returns
0 on success.
void mbedtls_sha512_clone ( mbedtls_sha512_context dst,
const mbedtls_sha512_context src 
)

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

Parameters
dstThe destination context
srcThe context to be cloned
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. This function is for internal use only.

Parameters
ctxThe SHA-512 context.
outputThe SHA-384 or SHA-512 checksum result.
Returns
0 on success.
void mbedtls_sha512_free ( mbedtls_sha512_context ctx)

Clear SHA-512 context.

Parameters
ctxSHA-512 context to be cleared
void mbedtls_sha512_init ( mbedtls_sha512_context ctx)

Initialize SHA-512 context.

Parameters
ctxSHA-512 context to be initialized
int mbedtls_sha512_starts_ret ( mbedtls_sha512_context ctx,
int  is384 
)

This function starts a SHA-384 or SHA-512 checksum calculation.

Parameters
ctxThe SHA-512 context to initialize.
is384Determines which function to use.
  • 0: Use SHA-512.
  • 1: Use SHA-384.
Returns
0 on success.
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.

Parameters
ctxThe SHA-512 context.
inputThe buffer holding the input data.
ilenThe length of the input data.
Returns
0 on success.