lcx_sha512.h | Developers

lcx_sha512.h

Back to the files list

SHA-2 (Secure Hash Algorithm 2) More...

Data Structures

struct  cx_sha512_s
 SHA-384 and SHA-512 context. More...

Macros

#define CX_SHA384_SIZE   48
 SHA-384 message digest size. More...
#define CX_SHA512_SIZE   64
 SHA-512 message digest size. More...

Typedefs

typedef struct cx_sha512_s cx_sha512_t
 Convenience type. More...

Functions

cx_err_t cx_sha384_init_no_throw (cx_sha512_t *hash)
 Initializes a SHA-384 context. More...
static int cx_sha384_init (cx_sha512_t *hash)
 Initializes a SHA-384 context. More...
cx_err_t cx_sha512_init_no_throw (cx_sha512_t *hash)
 Initializes a SHA-512 context. More...
static int cx_sha512_init (cx_sha512_t *hash)
 Initializes a SHA-512 context. More...
size_t cx_hash_sha512 (const uint8_t *in, size_t in_len, uint8_t *out, size_t out_len)
 Computes a one shot SHA-512 digest. More...

Detailed Description

SHA-2 (Secure Hash Algorithm 2)

SHA-384 and SHA-512 are secure hash functions belonging to the SHA-2 family with a digest length of 384 and 512 bits, respectively. The message length should be less than 2128 bits. Refer to FIPS 180-4 for more details.

Macro Definition Documentation

CX_SHA384_SIZE

#define CX_SHA384_SIZE   48

SHA-384 message digest size.

CX_SHA512_SIZE

#define CX_SHA512_SIZE   64

SHA-512 message digest size.

Typedef Documentation

cx_sha512_t

typedef struct cx_sha512_s cx_sha512_t

Convenience type.

See cx_sha512_s.

Function Documentation

cx_hash_sha512()

size_t cx_hash_sha512 ( const uint8_t *  in,
size_t  in_len,
uint8_t *  out,
size_t  out_len 
)

Computes a one shot SHA-512 digest.

Parameters
[in]inInput data.
[in]in_lenLength of the input data.
[out]outBuffer where to store the output.
[out]out_lenLength of the output. This is actually 512 bits.

cx_sha384_init()

static int cx_sha384_init ( cx_sha512_t hash)

Initializes a SHA-384 context.

Parameters
[out]hashPointer to the context. The context shall be in RAM.
Returns
SHA384 identifier.

cx_sha384_init_no_throw()

cx_err_t cx_sha384_init_no_throw ( cx_sha512_t hash)

Initializes a SHA-384 context.

Parameters
[out]hashPointer to the context. The context shall be in RAM.
Returns
Error code:
  • CX_OK on success

cx_sha512_init()

static int cx_sha512_init ( cx_sha512_t hash)

Initializes a SHA-512 context.

Parameters
[out]hashPointer to the context. The context shall be in RAM.
Returns
SHA512 identifier.

cx_sha512_init_no_throw()

cx_err_t cx_sha512_init_no_throw ( cx_sha512_t hash)

Initializes a SHA-512 context.

Parameters
[out]hashPointer to the context. The context shall be in RAM.
Returns
Error code:
  • CX_OK on success

Back to the files list


Did you find this page helpful?


How would you improve this page for developers?



Getting Started
Theme Features
Customization

Embedded Apps