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

Stateless COSE helpers (RFC 9052) used by EDHOC. More...

#include "contiki.h"
#include "cose.h"
#include "ecdh.h"
#include "lib/cbor.h"
#include "lib/ccm-star.h"
#include "lib/sha-256.h"
#include <string.h>
#include "sys/log.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

Stateless COSE helpers (RFC 9052) used by EDHOC.

Author
Lidia Pocero pocer.nosp@m.o@is.nosp@m.i.gr Peter A Jonsson Rikard Höglund Marco Tiloca 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.c.