Configuration¶
libedhoc is configured at compile time. On Zephyr the options below are
ordinary CONFIG_* Kconfig symbols; on other targets they are passed as
compiler defines (see Supported targets).
Kconfig library configuration¶
LIBEDHOC_ENABLE- Enable building libedhoc for the Zephyr target.
LIBEDHOC_KEY_ID_LEN- Size of the opaque key handle the library stores to reference a key inside the crypto backend’s key store.Must match the handle size of the bound backend.
LIBEDHOC_MAX_NR_OF_CIPHER_SUITES- Capacity of the cipher suite list a peer may offer or accept.Values greater than
3require regeneration of the CBOR backend. LIBEDHOC_MAX_NR_OF_METHODS- Capacity of the method list a peer may offer or accept, from
1to4. LIBEDHOC_MAX_LEN_OF_CONN_ID- Longest connection identifier (C_I / C_R) this peer accepts.Identifiers are byte strings; one byte covers the range that RFC 9528: 3.3.2 sends as a bare CBOR integer, which is the common case.
LIBEDHOC_MAX_LEN_OF_KEM_ENCAPSULATION_KEY- Buffer holding the ephemeral encapsulation key (
G_X).Set it to the largest suite you build in:32for X25519,65for P-256,97for P-384,800for ML-KEM-512. LIBEDHOC_MAX_LEN_OF_KEM_CIPHERTEXT- Buffer holding the ephemeral ciphertext (
G_Y).Set it to the largest suite you build in:32for X25519,65for P-256,97for P-384,768for ML-KEM-512. LIBEDHOC_MAX_LEN_OF_MAC- Buffers holding a transcript hash or a MAC.Set it to the hash length of the largest suite you build in:
32for SHA-256,48for SHA-384,64for SHA-512 and SHAKE256. LIBEDHOC_MAX_NR_OF_EAD_TOKENS- Capacity of the EAD (External Authorization Data) token list carried in each message. Set to
0to disable EAD.Values greater than3require regeneration of the CBOR backend. LIBEDHOC_MAX_LEN_OF_CRED_KEY_ID- Longest COSE
kidkey identifier this peer accepts, from1to32. LIBEDHOC_MAX_NR_OF_CERTS_IN_X509_CHAIN- Capacity of the
x5chaincertificate list, from1to3.Values greater than3require regeneration of the CBOR backend.
Reference cipher suites¶
Each bundled reference cipher suite has its own gate. A disabled suite is not
compiled in, and both edhoc_cipher_suite_get_params() and
edhoc_cipher_suite_get_crypto() return NULL for it.
Symbol |
Suite |
|---|---|
|
X25519 / EdDSA / AES-CCM-16-64-128 / SHA-256 |
|
P-256 / ES256 / AES-CCM-16-64-128 / SHA-256 |
|
X25519 / EdDSA / ChaCha20-Poly1305 / SHA-256 |
|
P-384 / ES384 / A256GCM / SHA-384 |
|
ML-KEM-512 / ML-DSA-44 / AES-CCM-16-128-128 / SHAKE256 |
Logging¶
Set the compile-time log level with CONFIG_LIBEDHOC_LOG_LEVEL; each level
enables the ones below it:
Level |
Value |
|---|---|
|
0 |
|
1 |
|
2 |
|
3 |
|
4 |
Memory backend¶
libedhoc allocates its handshake working buffers through a compile-time
selectable backend, chosen with CONFIG_LIBEDHOC_MEM_BACKEND:
Backend |
Value |
Notes |
|---|---|---|
Stack |
|
C99 variable-length arrays; no heap, zero static RAM (default). |
Heap |
|
|
Custom |
|
Application-provided |
Supported targets¶
libedhoc is portable C and is regularly built and tested on:
Linux — via CMake. Pass the options above as
-DCONFIG_LIBEDHOC_*, or consume an installed build throughfind_package(libedhoc)(the generatededhoc_config.hcarries the build-time configuration).Zephyr RTOS — as a west module. The options above are ordinary Kconfig symbols and the dependencies (zcbor, mbedTLS) are pulled by the manifest.