libfossil
fsl_sha3_cx Struct Reference

Type for holding SHA3 processing state. More...

#include "hash.h"

Collaboration diagram for fsl_sha3_cx:

Data Fields

unsigned char hex [132]
unsigned ixMask
unsigned nLoaded
unsigned nRate
enum fsl_sha3_hash_size size
union { 
   uint64_t   s [25] 
   unsigned char   x [1600] 
} u

Detailed Description

Type for holding SHA3 processing state.

Each instance must be initialized with fsl_sha3_init(), populated with fsl_sha3_update(), and "sealed" with fsl_sha3_end().

Sample usage:

fsl_sha3_update(&cx, memory, lengthOfMemory);
printf("Hash = %s\n", (char const *)cx.hex);
FSL_EXPORT void fsl_sha3_update(fsl_sha3_cx *cx, void const *data, unsigned int len)
Updates cx's state to include the first len bytes of data.
FSL_EXPORT unsigned char const * fsl_sha3_end(fsl_sha3_cx *cx)
To be called when SHA3 hashing is complete: finishes the hash calculation and populates cx->hex with ...
@ FSL_SHA3_DEFAULT
Definition hash.h:425
FSL_EXPORT void fsl_sha3_init(fsl_sha3_cx *cx)
Equivalent to fsl_sha3_init2(cx, FSL_SHA3_DEFAULT).
Type for holding SHA3 processing state.
Definition hash.h:448
unsigned char hex[132]
Definition hash.h:457

After fsl_sha3_end() is called cx.hex contains the hex-string forms of the digest. fsl_sha3_update() may be called an arbitrary number of times to feed in chunks of memory (e.g. to stream in arbitrarily large data).

Definition at line 448 of file hash.h.

Field Documentation

◆ hex

unsigned char fsl_sha3_cx::hex[132]

Definition at line 457 of file hash.h.

◆ ixMask

unsigned fsl_sha3_cx::ixMask

Definition at line 455 of file hash.h.

◆ nLoaded

unsigned fsl_sha3_cx::nLoaded

Definition at line 454 of file hash.h.

◆ nRate

unsigned fsl_sha3_cx::nRate

Definition at line 453 of file hash.h.

◆ s

uint64_t fsl_sha3_cx::s[25]

Definition at line 450 of file hash.h.

◆ size

enum fsl_sha3_hash_size fsl_sha3_cx::size

Definition at line 456 of file hash.h.

◆ [union]

union { ... } fsl_sha3_cx::u

◆ x

unsigned char fsl_sha3_cx::x[1600]

Definition at line 451 of file hash.h.


The documentation for this struct was generated from the following file: