![]() |
ndn-lite
|
Functions | |
ndn_sha_backend_t * | ndn_sha_get_backend (void) |
int | ndn_sha256_init (ndn_sha256_state_t *state) |
SHA256 initialization procedure. More... | |
int | ndn_sha256_update (ndn_sha256_state_t *state, const uint8_t *data, uint32_t datalen) |
int | ndn_sha256_finish (ndn_sha256_state_t *state, uint8_t *hash_result) |
SHA256 final procedure. More... | |
int | ndn_sha256 (const uint8_t *data, uint32_t datalen, uint8_t *hash_result) |
SHA256 a series of bytes into the result. More... | |
int | ndn_sha256_sign (const uint8_t *input_value, uint32_t input_size, uint8_t *output_value, uint32_t output_max_size, uint32_t *output_used_size) |
Sign a buffer using SHA-256 algorithm. More... | |
int | ndn_sha256_verify (const uint8_t *input_value, uint32_t input_size, const uint8_t *sig_value, uint32_t sig_size) |
Verify a SHA-256 signature. More... | |
Variables | |
ndn_sha_backend_t | ndn_sha_backend |
int ndn_sha256 | ( | const uint8_t * | data, |
uint32_t | datalen, | ||
uint8_t * | hash_result | ||
) |
SHA256 a series of bytes into the result.
data. | Input. The input data buffer. |
datalen. | Input. The length of the input data. |
hash_result. | Output. Output buffer whose length should be at least 32. |
int ndn_sha256_finish | ( | ndn_sha256_state_t * | state, |
uint8_t * | hash_result | ||
) |
SHA256 final procedure.
Inserts the completed hash computation into digest.
hash_result. | Output. digest in unsigned eight bit integer. |
state. | Input. SHA256 state struct. |
int ndn_sha256_init | ( | ndn_sha256_state_t * | state | ) |
SHA256 initialization procedure.
state. | Input. SHA256 state struct. |
int ndn_sha256_sign | ( | const uint8_t * | input_value, |
uint32_t | input_size, | ||
uint8_t * | output_value, | ||
uint32_t | output_max_size, | ||
uint32_t * | output_used_size | ||
) |
Sign a buffer using SHA-256 algorithm.
The memory buffer to hold the signature should not be smaller than 32 bytes.
input_value. | Input. Buffer prepared to sign. |
input_size. | Input. Size of input buffer. |
output_value. | Output. Signature value. |
output_max_size. | Input. Buffer size of output_value |
output_used_size. | Output. Size of used output buffer when signing complete. |
int ndn_sha256_update | ( | ndn_sha256_state_t * | state, |
const uint8_t * | data, | ||
uint32_t | datalen | ||
) |
int ndn_sha256_verify | ( | const uint8_t * | input_value, |
uint32_t | input_size, | ||
const uint8_t * | sig_value, | ||
uint32_t | sig_size | ||
) |
Verify a SHA-256 signature.
input_value. | Input. SHA-256-signed buffer. |
input_size. | Input. Size of input buffer. |
sig_value. | Input. SHA-256 signature value. |
sig_size. | Input. SHA-256 signature size. Should be 32 bytes. |
ndn_sha_backend_t* ndn_sha_get_backend | ( | void | ) |