Contiki-NG
Loading...
Searching...
No Matches
sha_256_driver Struct Reference

Structure of SHA-256 drivers. More...

#include <os/lib/sha-256.h>

Data Fields

void(* init )(void)
 Starts a hash session.
 
void(* update )(const uint8_t *data, size_t len)
 Processes a chunk of data.
 
void(* finalize )(uint8_t digest[static 32])
 Terminates the hash session and produces the digest.
 
void(* create_checkpoint )(sha_256_checkpoint_t *checkpoint)
 Saves the hash session, e.g., before pausing a protothread.
 
void(* restore_checkpoint )(const sha_256_checkpoint_t *checkpoint)
 Restores a hash session, e.g., after resuming a protothread.
 
void(* hash )(const uint8_t *data, size_t len, uint8_t digest[static 32])
 Does init, update, and finalize at once.
 

Detailed Description

Structure of SHA-256 drivers.

Definition at line 66 of file sha-256.h.

Field Documentation

◆ finalize

void(* sha_256_driver::finalize) (uint8_t digest[static 32])

Terminates the hash session and produces the digest.

Parameters
digestpointer to the hash value

Definition at line 84 of file sha-256.h.

◆ hash

void(* sha_256_driver::hash) (const uint8_t *data, size_t len, uint8_t digest[static 32])

Does init, update, and finalize at once.

Parameters
datapointer to the data to hash
lenlength of the data to hash in bytes
digestpointer to the hash value

Definition at line 102 of file sha-256.h.

◆ update

void(* sha_256_driver::update) (const uint8_t *data, size_t len)

Processes a chunk of data.

Parameters
datapointer to the data to hash
lenlength of the data to hash in bytes

Definition at line 78 of file sha-256.h.