Platform-independent SHA-256 API.
More...
#include "contiki.h"
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
|
void | sha_256_hash (const uint8_t *data, size_t len, uint8_t digest[static 32]) |
| Generic implementation of sha_256_driver::hash.
|
|
void | sha_256_hmac (const uint8_t *key, size_t key_len, const uint8_t *data, size_t data_len, uint8_t hmac[static 32]) |
| Computes HMAC-SHA-256 as per RFC 2104.
|
|
void | sha_256_hkdf_extract (const uint8_t *salt, size_t salt_len, const uint8_t *ikm, size_t ikm_len, uint8_t prk[static 32]) |
| Extracts a key as per RFC 5869.
|
|
void | sha_256_hkdf_expand (const uint8_t *prk, size_t prk_len, const uint8_t *info, size_t info_len, uint8_t *okm, uint_fast16_t okm_len) |
| Expands a key as per RFC 5869.
|
|
void | sha_256_hkdf (const uint8_t *salt, size_t salt_len, const uint8_t *ikm, size_t ikm_len, const uint8_t *info, size_t info_len, uint8_t *okm, uint_fast16_t okm_len) |
| Performs both extraction and expansion as per RFC 5869.
|
|
Platform-independent SHA-256 API.
- Author
- Konrad Krentz konra.nosp@m.d.kr.nosp@m.entz@.nosp@m.gmai.nosp@m.l.com
Definition in file sha-256.h.
◆ sha_256_hkdf()
void sha_256_hkdf |
( |
const uint8_t * | salt, |
|
|
size_t | salt_len, |
|
|
const uint8_t * | ikm, |
|
|
size_t | ikm_len, |
|
|
const uint8_t * | info, |
|
|
size_t | info_len, |
|
|
uint8_t * | okm, |
|
|
uint_fast16_t | okm_len ) |
Performs both extraction and expansion as per RFC 5869.
- Parameters
-
salt | optional salt value |
salt_len | length of salt in bytes |
ikm | input keying material |
ikm_len | length of ikm in bytes |
info | optional context and application specific information |
info_len | length of info in bytes |
okm | output keying material |
okm_len | length of okm in bytes (<= 255 * SHA_256_DIGEST_LENGTH) |
Definition at line 442 of file sha-256.c.
◆ sha_256_hkdf_expand()
void sha_256_hkdf_expand |
( |
const uint8_t * | prk, |
|
|
size_t | prk_len, |
|
|
const uint8_t * | info, |
|
|
size_t | info_len, |
|
|
uint8_t * | okm, |
|
|
uint_fast16_t | okm_len ) |
Expands a key as per RFC 5869.
- Parameters
-
prk | a pseudorandom key of at least SHA_256_DIGEST_LENGTH bytes |
prk_len | length of prk in bytes |
info | optional context and application specific information |
info_len | length of info in bytes |
okm | output keying material |
okm_len | length of okm in bytes (<= 255 * SHA_256_DIGEST_LENGTH) |
Definition at line 410 of file sha-256.c.
◆ sha_256_hkdf_extract()
void sha_256_hkdf_extract |
( |
const uint8_t * | salt, |
|
|
size_t | salt_len, |
|
|
const uint8_t * | ikm, |
|
|
size_t | ikm_len, |
|
|
uint8_t | prk[static 32] ) |
Extracts a key as per RFC 5869.
- Parameters
-
salt | optional salt value |
salt_len | length of salt in bytes |
ikm | input keying material |
ikm_len | length of ikm in bytes |
prk | pointer to where the extracted key shall be stored |
◆ sha_256_hmac()
void sha_256_hmac |
( |
const uint8_t * | key, |
|
|
size_t | key_len, |
|
|
const uint8_t * | data, |
|
|
size_t | data_len, |
|
|
uint8_t | hmac[static 32] ) |
Computes HMAC-SHA-256 as per RFC 2104.
- Parameters
-
key | the key to authenticate with |
key_len | length of key in bytes |
data | the data to authenticate |
data_len | length of data in bytes |
hmac | pointer to where the resulting HMAC shall be stored |