80#define COSE_ALGORITHM_ED25519_SIG_LEN 64
81#define COSE_ALGORITHM_ED25519_PRIV_KEY_LEN 32
82#define COSE_ALGORITHM_ED25519_PUB_KEY_LEN 32
84#define COSE_ALGORITHM_AES_CCM_64_64_128_KEY_LEN 16
85#define COSE_ALGORITHM_AES_CCM_64_64_128_NONCE_LEN 7
86#define COSE_ALGORITHM_AES_CCM_64_64_128_TAG_LEN 8
88#define COSE_ALGORITHM_AES_CCM_16_64_128_KEY_LEN 16
89#define COSE_ALGORITHM_AES_CCM_16_64_128_NONCE_LEN 13
90#define COSE_ALGORITHM_AES_CCM_16_64_128_TAG_LEN 8
92#define COSE_ALGORITHM_AES_CCM_64_128_128_KEY_LEN 16
93#define COSE_ALGORITHM_AES_CCM_64_128_128_NONCE_LEN 7
94#define COSE_ALGORITHM_AES_CCM_64_128_128_TAG_LEN 16
96#define COSE_ALGORITHM_AES_CCM_16_128_128_KEY_LEN 16
97#define COSE_ALGORITHM_AES_CCM_16_128_128_NONCE_LEN 13
98#define COSE_ALGORITHM_AES_CCM_16_128_128_TAG_LEN 16
100#define COSE_ALGORITHM_ES256_PRIV_KEY_LEN 24
101#define COSE_ALGORITHM_ES256_PUB_KEY_LEN 32
102#define COSE_ALGORITHM_ES256_SIGNATURE_LEN 64
103#define COSE_ALGORITHM_ES256_HASH_LEN 32
105#define COSE_ALGORITHM_ES384_PRIV_KEY_LEN 24
106#define COSE_ALGORITHM_ES384_PUB_KEY_LEN 32
107#define COSE_ALGORITHM_ES384_SIGNATURE_LEN 64
108#define COSE_ALGORITHM_ES384_HASH_LEN 48
110#define COSE_ALGORITHM_ES512_PRIV_KEY_LEN 24
111#define COSE_ALGORITHM_ES512_PUB_KEY_LEN 32
112#define COSE_ALGORITHM_ES512_SIGNATURE_LEN 64
113#define COSE_ALGORITHM_ES512_HASH_LEN 64
115#define COSE_ALGORITHM_ECDH_PRIV_KEY_LEN 32
116#define COSE_ALGORITHM_ECDH_PUB_KEY_LEN 32
118#define COSE_ALGORITHM_SHA_512_LEN 64
119#define COSE_ALGORITHM_SHA_512_256_LEN 32
120#define COSE_ALGORITHM_SHA_256_256_LEN 32
121#define COSE_ALGORITHM_SHA_256_64_LEN 8
123#define COSE_ALGORITHM_HMAC256_64_HASH_LEN 16
124#define COSE_ALGORITHM_HMAC256_256_HASH_LEN 32
125#define COSE_ALGORITHM_HMAC384_384_HASH_LEN 48
126#define COSE_ALGORITHM_HMAC512_512_HASH_LEN 64
215#if COAP_OSCORE_GROUP_SUPPORT
220#if COAP_OSCORE_GROUP_SUPPORT
222typedef struct cose_sign1_t {
277 const uint8_t **buffer);
288 uint8_t *ciphertext_buffer,
289 size_t ciphertext_len);
292 uint8_t *plaintext_buffer,
293 size_t plaintext_len);
295#if COAP_OSCORE_GROUP_SUPPORT
298void cose_sign1_init(cose_sign1_t *ptr);
300void cose_sign1_set_alg(cose_sign1_t *ptr,
int alg,
int alg_param,
int alg_kty);
302void cose_sign1_set_ciphertext(cose_sign1_t *ptr, uint8_t *buffer,
size_t size);
304void cose_sign1_set_public_cred(cose_sign1_t *ptr,
307void cose_sign1_set_private_key(cose_sign1_t *ptr,
311int cose_sign1_get_signature(cose_sign1_t *ptr,
const uint8_t **buffer);
313void cose_sign1_set_signature(cose_sign1_t *ptr, uint8_t *buffer,
size_t size);
315int cose_sign1_sign(cose_sign1_t *ptr);
317void cose_sign1_set_sigstructure(cose_sign1_t *ptr, uint8_t *buffer,
size_t size);
319int cose_sign1_verify(cose_sign1_t *ptr);
struct coap_crypto_cred_t coap_crypto_cred_t
struct coap_crypto_pri_key_t coap_crypto_pri_key_t
void cose_encrypt0_set_plaintext(cose_encrypt0_t *ptr, uint8_t *buffer, size_t size)
int cose_encrypt0_get_plaintext(cose_encrypt0_t *ptr, uint8_t **buffer)
const char * cose_get_hkdf_alg_name(cose_hkdf_alg_t id, char *buffer, size_t buflen)
cose_key_type_t cose_get_curve_key_type(cose_curve_t curve)
int cose_encrypt0_set_key(cose_encrypt0_t *ptr, coap_bin_const_t *key)
size_t cose_nonce_len(cose_alg_t cose_alg)
coap_bin_const_t * cose_get_curve_bin_oid(cose_curve_t curve)
cose_alg_t cose_get_alg_id(const char *name)
void cose_encrypt0_set_kid_context(cose_encrypt0_t *ptr, coap_bin_const_t *kid_context)
cose_curve_t cose_get_curve_id(const char *name)
size_t cose_key_len(cose_alg_t cose_alg)
size_t cose_encrypt0_get_key_id(cose_encrypt0_t *ptr, const uint8_t **buffer)
const char * cose_get_alg_name(cose_alg_t id, char *buffer, size_t buflen)
int cose_get_hmac_alg_for_hkdf(cose_hkdf_alg_t hkdf_alg, cose_hmac_alg_t *hmac_alg)
coap_bin_const_t cose_encrypt0_get_partial_iv(cose_encrypt0_t *ptr)
size_t cose_encrypt0_get_kid_context(cose_encrypt0_t *ptr, const uint8_t **buffer)
void cose_encrypt0_set_ciphertext(cose_encrypt0_t *ptr, uint8_t *buffer, size_t size)
size_t cose_hash_len(cose_alg_t cose_alg)
int cose_encrypt0_decrypt(cose_encrypt0_t *ptr, uint8_t *plaintext_buffer, size_t plaintext_len)
size_t cose_tag_len(cose_alg_t cose_alg)
void cose_encrypt0_set_aad(cose_encrypt0_t *ptr, coap_bin_const_t *aad)
int cose_encrypt0_decode(cose_encrypt0_t *ptr, uint8_t *buffer, size_t size)
int cose_encrypt0_encrypt(cose_encrypt0_t *ptr, uint8_t *ciphertext_buffer, size_t ciphertext_len)
void cose_encrypt0_set_partial_iv(cose_encrypt0_t *ptr, coap_bin_const_t *partial_iv)
const char * cose_get_curve_name(cose_curve_t id, char *buffer, size_t buflen)
size_t cose_encrypt0_encode(cose_encrypt0_t *ptr, uint8_t *buffer, size_t size)
void cose_encrypt0_set_external_aad(cose_encrypt0_t *ptr, coap_bin_const_t *external_aad)
void cose_encrypt0_init(cose_encrypt0_t *ptr)
void cose_encrypt0_set_alg(cose_encrypt0_t *ptr, uint8_t alg)
void cose_encrypt0_set_key_id(cose_encrypt0_t *ptr, coap_bin_const_t *key_id)
void cose_encrypt0_set_nonce(cose_encrypt0_t *ptr, coap_bin_const_t *nonce)
@ COSE_HKDF_ALG_HKDF_SHA_256
@ COSE_HKDF_ALG_HKDF_SHA_512
@ COSE_HMAC_ALG_HMAC384_384
@ COSE_HMAC_ALG_HMAC256_256
@ COSE_HMAC_ALG_HMAC512_512
@ COSE_HMAC_ALG_HMAC256_64
@ COSE_ALGORITHM_HMAC256_256
@ COSE_ALGORITHM_AES_CCM_16_128_256
@ COSE_ALGORITHM_ECDH_SS_HKDF_256
@ COSE_ALGORITHM_HMAC512_512
@ COSE_ALGORITHM_SHA_256_64
@ COSE_ALGORITHM_SHA_512_256
@ COSE_ALGORITHM_AES_CCM_64_64_128
@ COSE_ALGORITHM_CHACHA20_P1035
@ COSE_ALGORITHM_HKDF_SHA_512
@ COSE_ALGORITHM_AES_CCM_16_128_128
@ COSE_ALGORITHM_AES_CCM_64_128_256
@ COSE_ALGORITHM_SHA_256_256
@ COSE_ALGORITHM_HMAC256_64
@ COSE_ALGORITHM_AES_CCM_64_64_256
@ COSE_ALGORITHM_HKDF_SHA_256
@ COSE_ALGORITHM_AES_CCM_16_64_128
@ COSE_ALGORITHM_HMAC384_384
@ COSE_ALGORITHM_AES_CCM_64_128_128
@ COSE_ALGORITHM_AES_CCM_16_64_256
struct coap_binary_t coap_binary_t
CoAP binary data definition.
struct coap_bin_const_t coap_bin_const_t
CoAP binary data definition with const data.
CoAP binary data definition with const data.
Holds credential definitions.
Holds private key definitions.
coap_bin_const_t ciphertext
coap_bin_const_t plaintext
coap_bin_const_t partial_iv
coap_bin_const_t kid_context
coap_bin_const_t external_aad
coap_bin_const_t oscore_option
uint8_t partial_iv_data[8]