![]() |
Contiki-NG
|
An implementation of Ephemeral Diffie-Hellman Over COSE (EDHOC) (RFC9528). More...
#include "edhoc-config.h"#include "ecdh.h"#include "edhoc-msgs.h"#include <stdint.h>#include <string.h>Go to the source code of this file.
Functions | |
| void | edhoc_storage_init (void) |
| Reserve memory for the EDHOC context struct. | |
| uint8_t | edhoc_setup_suites (edhoc_context_t *ctx) |
| Initialize the EDHOC Context with the defined EDHOC parameters. | |
| void | edhoc_finalize (edhoc_context_t *ctx) |
| Close the EDHOC context. | |
| edhoc_error_t | edhoc_generate_message_1 (edhoc_context_t *ctx, uint8_t *ad, size_t ad_sz, bool suite_array) |
| Generate the EDHOC Message 1 and set it in the EDHOC context. | |
| edhoc_error_t | edhoc_generate_message_2 (edhoc_context_t *ctx, const uint8_t *auth_data, size_t auth_data_size) |
| Generate the EDHOC Message 2 and set it in the EDHOC context. | |
| edhoc_error_t | edhoc_generate_message_3 (edhoc_context_t *ctx, const uint8_t *auth_data, size_t auth_data_size) |
| Generate the EDHOC Message 3 and set it in the EDHOC context. | |
| uint8_t | edhoc_generate_error_message (uint8_t *msg_er, size_t msg_er_sz, const edhoc_context_t *ctx, int8_t err) |
| Generate the EDHOC ERROR Message. | |
| int | edhoc_authenticate_msg (edhoc_context_t *ctx, uint8_t *ad, bool msg2) |
| Authenticate the rx message. | |
| int16_t | edhoc_kdf (const uint8_t *prk, uint8_t info_label, const uint8_t *context, uint8_t context_sz, uint16_t length, uint8_t *result) |
| EDHOC Key Derivation Function (KDF) based on HMAC-based Expand (RFC 5869). | |
| int16_t | edhoc_expand (const uint8_t *prk, const uint8_t *info, uint16_t info_sz, uint16_t length, uint8_t *result) |
| HMAC-based Key Expansion Function for EDHOC context using HKDF (RFC 5869). | |
| uint8_t | edhoc_initialize_context (edhoc_context_t *ctx) |
| Internal API functions. | |
| uint8_t | edhoc_get_own_auth_key (edhoc_context_t *ctx, cose_key_t **key) |
| Retrieve own authentication key from key storage. | |
| int8_t | edhoc_set_config_from_suite (edhoc_context_t *ctx, uint8_t suite) |
| Set EDHOC configuration parameters based on cipher suite. | |
| void | edhoc_print_session_info (const edhoc_context_t *ctx) |
| Print current EDHOC session information for debugging. | |
| int8_t | edhoc_generate_transcript_hash_2 (edhoc_context_t *ctx, const uint8_t *eph_pub, uint8_t *msg, uint16_t msg_sz) |
| Generate transcript hash TH_2. | |
| uint8_t | edhoc_generate_transcript_hash_3 (edhoc_context_t *ctx, const uint8_t *cred, uint16_t cred_sz, const uint8_t *plaintext, uint16_t plaintext_sz) |
| Generate transcript hash TH_3. | |
| uint8_t | edhoc_generate_transcript_hash_4 (edhoc_context_t *ctx, const uint8_t *cred, uint16_t cred_sz, const uint8_t *plaintext, uint16_t plaintext_sz) |
| Generate transcript hash TH_4. | |
| bool | edhoc_generate_prk_2e (edhoc_context_t *ctx) |
| Generate pseudorandom key PRK_2e. | |
| bool | edhoc_generate_prk_3e2m (edhoc_context_t *ctx, const ecc_key_t *auth_key, uint8_t gen) |
| Generate pseudorandom key PRK_3e2m. | |
| bool | edhoc_generate_prk_4e3m (edhoc_context_t *ctx, const ecc_key_t *auth_key, uint8_t gen) |
| Generate pseudorandom key PRK_4e3m. | |
| int16_t | edhoc_generate_keystream_2e (edhoc_context_t *ctx, uint16_t length, uint8_t *ks_2e) |
| Generate keystream KS_2e for encryption. | |
| int16_t | edhoc_enc_dec_ciphertext_2 (const edhoc_context_t *ctx, const uint8_t *ks_2e, uint8_t *plaintext, uint16_t plaintext_sz) |
| Encrypt/decrypt ciphertext 2 using XOR with keystream. | |
| size_t | edhoc_generate_cred_x (const cose_key_t *cose, uint8_t *cred, size_t cred_sz) |
| Generate CBOR-encoded credential CRED_X. | |
| size_t | edhoc_generate_id_cred_x (const cose_key_t *cose, uint8_t *cred, size_t cred_sz) |
| Generate credential identifier ID_CRED_X. | |
| uint8_t | edhoc_calc_mac (const edhoc_context_t *ctx, uint8_t mac_num, uint8_t mac_len, uint8_t *mac) |
| Calculate message authentication code (MAC). | |
| void | edhoc_print_config_summary (const edhoc_context_t *ctx) |
| Print EDHOC session configuration summary. | |
Variables | |
| edhoc_context_t * | edhoc_ctx |
| EDHOC context struct used in the EDHOC protocol. | |
An implementation of Ephemeral Diffie-Hellman Over COSE (EDHOC) (RFC9528).
Definition in file edhoc.h.