MCCI TweetNaCl
TweetNaCl library adapted for embedded use
+ Collaboration diagram for Hashing:

Data Structures

struct  mcci_tweetnacl_sha512_t
 abstract type for SHA512 signature blocks More...
 

Functions

static void mcci_tweetnacl_hash_sha512 (mcci_tweetnacl_sha512_t *pOut, const unsigned char *pMessage, size_t nMessage)
 Calculate sha512 hash of message. More...
 
static size_t mcci_tweetnacl_hashblocks_sha512 (mcci_tweetnacl_sha512_t *pState, const unsigned char *pMessage, size_t nMessage)
 Partial calculation of sha512 hash of message. More...
 
static void mcci_tweetnacl_hashblocks_sha512_finish (mcci_tweetnacl_sha512_t *pHash, const unsigned char *pMessage, size_t nMessage)
 Finish partial calculation of sha512 hash of message. More...
 
static void mcci_tweetnacl_hashblocks_sha512_init (mcci_tweetnacl_sha512_t *pState)
 Partial calculation of sha512 hash of message. More...
 

Detailed Description

Function Documentation

◆ mcci_tweetnacl_hash_sha512()

static void mcci_tweetnacl_hash_sha512 ( mcci_tweetnacl_sha512_t *  pOut,
const unsigned char *  pMessage,
size_t  nMessage 
)
inlinestatic

Calculate sha512 hash of message.

Parameters
[out]pOutis set to the signature
[in]pMessageis the message to be hashed
[in]nMessageis the length of the message in bytes
See also
https://nacl.cr.yp.to/hash.html

Definition at line 76 of file mcci_tweetnacl_hash.h.

◆ mcci_tweetnacl_hashblocks_sha512()

static size_t mcci_tweetnacl_hashblocks_sha512 ( mcci_tweetnacl_sha512_t *  pState,
const unsigned char *  pMessage,
size_t  nMessage 
)
inlinestatic

Partial calculation of sha512 hash of message.

Parameters
[in,out]pStatecarries the current state
[in]pMessageis the message to be hashed
[in]nMessageis the length of the message in bytes
Returns
number of bytes not processed.
See also
https://nacl.cr.yp.to/hash.html

Definition at line 97 of file mcci_tweetnacl_hash.h.

◆ mcci_tweetnacl_hashblocks_sha512_finish()

static void mcci_tweetnacl_hashblocks_sha512_finish ( mcci_tweetnacl_sha512_t *  pHash,
const unsigned char *  pMessage,
size_t  nMessage 
)
inlinestatic

Finish partial calculation of sha512 hash of message.

Parameters
[in,out]pHashcarries the current state
[in]pMessageis the message to be hashed
[in]nMessageis the length of the message in bytes

SHA512 processes the message in 128-byte chunks. To accomodate variable-length text, SHA512 always appends some bytes, containing enough info to unambigiously represent the size of the message, even though its padding. This routine does that, assuming that all but nMessage % 128 bytes have already been incorporated in the hash.

See also
https://nacl.cr.yp.to/hash.html

Definition at line 144 of file mcci_tweetnacl_hash.h.

◆ mcci_tweetnacl_hashblocks_sha512_init()

static void mcci_tweetnacl_hashblocks_sha512_init ( mcci_tweetnacl_sha512_t *  pState)
inlinestatic

Partial calculation of sha512 hash of message.

Parameters
[out]pStateis set to the initialization vector
See also
https://nacl.cr.yp.to/hash.html

Definition at line 118 of file mcci_tweetnacl_hash.h.