21#ifndef COAP_CRYPTO_INTERNAL_H_
22#define COAP_CRYPTO_INTERNAL_H_
37#ifndef COAP_CRYPTO_MAX_KEY_SIZE
38#define COAP_CRYPTO_MAX_KEY_SIZE (32)
41#ifndef COAP_OSCORE_DEFAULT_REPLAY_WINDOW
42#define COAP_OSCORE_DEFAULT_REPLAY_WINDOW 32
87#if COAP_OSCORE_GROUP_SUPPORT
88 oscore_auth_cred_t cred_type;
142 size_t *max_result_len);
160 size_t *max_result_len);
194#if COAP_OSCORE_GROUP_SUPPORT
214int coap_crypto_check_hash_alg(
cose_alg_t alg);
224int coap_crypto_read_pem_private_key(
const char *filename,
275int coap_crypto_read_pem_public_cred(
const char *filename,
377int coap_crypto_derive_shared_secret(
cose_alg_t alg_pairwise,
int coap_crypto_hmac(cose_hmac_alg_t hmac_alg, coap_bin_const_t *key, coap_bin_const_t *data, coap_bin_const_t **hmac)
Create a HMAC hash of the provided data.
coap_bin_const_t coap_crypto_key_t
The structure that holds the Crypto Key.
int coap_crypto_aead_decrypt(const coap_crypto_param_t *params, coap_bin_const_t *data, coap_bin_const_t *aad, uint8_t *result, size_t *max_result_len)
Decrypt the provided encrypted data into plaintext.
int coap_crypto_aead_encrypt(const coap_crypto_param_t *params, coap_bin_const_t *data, coap_bin_const_t *aad, uint8_t *result, size_t *max_result_len)
Encrypt the provided plaintext data.
int coap_crypto_hash(cose_alg_t alg, const coap_bin_const_t *data, coap_bin_const_t **hash)
Create a hash of the provided data.
int coap_crypto_check_hkdf_alg(cose_hkdf_alg_t hkdf_alg)
Check whether the defined hkdf algorithm is supported by the underlying crypto library.
int coap_crypto_check_cipher_alg(cose_alg_t alg)
Check whether the defined cipher algorithm is supported by the underlying crypto library.
An implementation of the CBOR Object Signing and Encryption (RFC).
CoAP binary data definition with const data.
CoAP binary data definition.
The structure that holds the AES Crypto information.
size_t l
The number of bytes in the length field.
const uint8_t * nonce
must be exactly 15 - l bytes
coap_crypto_key_t key
The Key to use.
size_t tag_len
The size of the Tag.
Holds credential definitions.
size_t wire_sign_size
Size of signature on wire.
coap_bin_const_t * auth_cred
Authentication Credentials of type type.
coap_bin_const_t * pub_raw
Raw Value of the public key abstracted from key_tls.
cose_curve_t sign_curve
Sign Curve.
coap_bin_const_t * cert_der
DER Value of the certificate used for key_tls.
coap_bin_const_t * pub_der
DER Value of the public key abstracted from key_tls.
void * key_tls
Public Key in the used TLS format.
cose_alg_t sign_hash
Sign Hash Algorithm.
The common structure that holds the Crypto information.
union coap_crypto_param_t::@250042334257003036060227022037266106077265366262 params
coap_crypto_key_t key
The key to use.
coap_crypto_aes_ccm_t aes
Used if AES type encryption.
cose_alg_t alg
The COSE algorithm to use.
Holds private key definitions.
size_t wire_sign_size
Size of signature on wire.
coap_bin_const_t * pri_der
DER Value of the private key abstracted from key_tls.
void * key_tls
Private Key in the used TLS format.
coap_bin_const_t * pri_raw
Raw Value of the private key abstracted from key_tls.