Contiki-NG
Loading...
Searching...
No Matches
cose.h File Reference

Public API declarations for COSE (RFC 9052). More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "edhoc-config.h"

Go to the source code of this file.

Functions

size_t cose_encrypt0_seal (uint8_t alg, const uint8_t *key, const uint8_t *nonce, const uint8_t *external_aad, size_t external_aad_len, uint8_t *buf, size_t plaintext_len, size_t buf_capacity)
 AEAD-encrypt a buffer in place as a COSE_Encrypt0.
size_t cose_encrypt0_open (uint8_t alg, const uint8_t *key, const uint8_t *nonce, const uint8_t *external_aad, size_t external_aad_len, uint8_t *buf, size_t ciphertext_len)
 AEAD-decrypt a buffer in place as a COSE_Encrypt0.
size_t cose_sign1_sign (int8_t alg, const uint8_t *private_key, const uint8_t *protected_hdr, size_t protected_hdr_len, const uint8_t *external_aad, size_t external_aad_len, const uint8_t *payload, size_t payload_len, uint8_t *signature)
 Produce a COSE_Sign1 signature.
bool cose_sign1_verify (int8_t alg, const uint8_t *public_key, const uint8_t *protected_hdr, size_t protected_hdr_len, const uint8_t *external_aad, size_t external_aad_len, const uint8_t *payload, size_t payload_len, const uint8_t *signature, size_t signature_len)
 Verify a COSE_Sign1 signature.
uint8_t cose_get_key_len (uint8_t alg_id)
 Get the symmetric key length for a COSE AEAD algorithm.
uint8_t cose_get_iv_len (uint8_t alg_id)
 Get the nonce/IV length for a COSE AEAD algorithm.
uint8_t cose_get_tag_len (uint8_t alg_id)
 Get the authentication tag length for a COSE AEAD algorithm.

Detailed Description

Public API declarations for COSE (RFC 9052).

Author
Lidia Pocero pocer.nosp@m.o@is.nosp@m.i.gr, Rikard Höglund, Marco Tiloca Christos Koulamas cklm@.nosp@m.isi..nosp@m.gr, Niclas Finne nicla.nosp@m.s.fi.nosp@m.nne@r.nosp@m.i.se, Nicolas Tsiftes nicol.nosp@m.as.t.nosp@m.sifte.nosp@m.s@ri.nosp@m..se

Definition in file cose.h.