Contiki 3.x
Files

Driver for the cc2538 SHA-256 mode of the security core. More...

Files

file  sha256.h
 Header file for the cc2538 SHA-256 driver.
 

SHA-256 functions

uint8_t sha256_init (sha256_state_t *state)
 Initializes the hash state. More...
 
uint8_t sha256_process (sha256_state_t *state, const void *data, uint32_t len)
 Processes a block of memory through the hash. More...
 
uint8_t sha256_done (sha256_state_t *state, void *hash)
 Terminates hash session to get the digest. More...
 

Detailed Description

Driver for the cc2538 SHA-256 mode of the security core.

Function Documentation

uint8_t sha256_done ( sha256_state_t *  state,
void *  hash 
)

Terminates hash session to get the digest.

Parameters
statePointer to hash state
hashPointer to hash
Returns
CRYPTO_SUCCESS if successful, or CRYPTO/SHA256 error code
Note
This function must be called only after sha256_process().

Definition at line 320 of file sha256.c.

References AES_CTRL_ALG_SEL, new_hash(), NULL, and resume_hash().

uint8_t sha256_init ( sha256_state_t *  state)

Initializes the hash state.

Parameters
statePointer to hash state to initialize
Returns
CRYPTO_SUCCESS if successful, or CRYPTO/SHA256 error code

Definition at line 229 of file sha256.c.

References NULL.

uint8_t sha256_process ( sha256_state_t *  state,
const void *  data,
uint32_t  len 
)

Processes a block of memory through the hash.

Parameters
statePointer to hash state
dataPointer to the data to hash
lenLength of the data to hash in bytes (octets)
Returns
CRYPTO_SUCCESS if successful, or CRYPTO/SHA256 error code
Note
This function must be called only after sha256_init().

Definition at line 243 of file sha256.c.

References AES_CTRL_ALG_SEL, new_hash(), NULL, and resume_hash().