![]() |
ndn-lite
|
Macros | |
#define | Sigma0(a) (ROTR((a), 2) ^ ROTR((a), 13) ^ ROTR((a), 22)) |
#define | Sigma1(a) (ROTR((a), 6) ^ ROTR((a), 11) ^ ROTR((a), 25)) |
#define | sigma0(a) (ROTR((a), 7) ^ ROTR((a), 18) ^ ((a) >> 3)) |
#define | sigma1(a) (ROTR((a), 17) ^ ROTR((a), 19) ^ ((a) >> 10)) |
#define | Ch(a, b, c) (((a) & (b)) ^ ((~(a)) & (c))) |
#define | Maj(a, b, c) (((a) & (b)) ^ ((a) & (c)) ^ ((b) & (c))) |
Functions | |
static void | compress (unsigned int *iv, const uint8_t *data) |
int | tc_sha256_init (TCSha256State_t s) |
SHA256 initialization procedure Initializes s. More... | |
int | tc_sha256_update (TCSha256State_t s, const uint8_t *data, size_t datalen) |
SHA256 update procedure Hashes data_length bytes addressed by data into state s. More... | |
int | tc_sha256_final (uint8_t *digest, TCSha256State_t s) |
SHA256 final procedure Inserts the completed hash computation into digest. More... | |
static unsigned int | ROTR (unsigned int a, unsigned int n) |
static unsigned int | BigEndian (const uint8_t **c) |
Variables | |
static const unsigned int | k256 [64] |
#define Ch | ( | a, | |
b, | |||
c | |||
) | (((a) & (b)) ^ ((~(a)) & (c))) |
#define Maj | ( | a, | |
b, | |||
c | |||
) | (((a) & (b)) ^ ((a) & (c)) ^ ((b) & (c))) |
|
inlinestatic |
|
static |
|
inlinestatic |
int tc_sha256_final | ( | uint8_t * | digest, |
TCSha256State_t | s | ||
) |
SHA256 final procedure Inserts the completed hash computation into digest.
digest | unsigned eight bit integer |
Sha256 | state struct |
int tc_sha256_init | ( | TCSha256State_t | s | ) |
SHA256 initialization procedure Initializes s.
s | Sha256 state struct |
int tc_sha256_update | ( | TCSha256State_t | s, |
const uint8_t * | data, | ||
size_t | datalen | ||
) |
SHA256 update procedure Hashes data_length bytes addressed by data into state s.
s | Sha256 state struct |
data | message to hash |
datalen | length of message to hash |
|
static |