20#ifndef CRYPTO_MODES_CCM_H
21#define CRYPTO_MODES_CCM_H
33#define CCM_ERR_INVALID_NONCE_LENGTH (-2)
34#define CCM_ERR_INVALID_CBC_MAC (-3)
35#define CCM_ERR_INVALID_DATA_LENGTH (-3)
36#define CCM_ERR_INVALID_LENGTH_ENCODING (-4)
37#define CCM_ERR_INVALID_MAC_LENGTH (-5)
43#define CCM_BLOCK_SIZE 16
48#define CCM_MAC_MAX_LEN 16
73 const uint8_t *auth_data, uint32_t auth_data_len,
74 uint8_t mac_length, uint8_t length_encoding,
75 const uint8_t *nonce,
size_t nonce_len,
76 const uint8_t *input,
size_t input_len,
102 const uint8_t *auth_data, uint32_t auth_data_len,
103 uint8_t mac_length, uint8_t length_encoding,
104 const uint8_t *nonce,
size_t nonce_len,
105 const uint8_t *input,
size_t input_len,
int cipher_decrypt_ccm(const cipher_t *cipher, const uint8_t *auth_data, uint32_t auth_data_len, uint8_t mac_length, uint8_t length_encoding, const uint8_t *nonce, size_t nonce_len, const uint8_t *input, size_t input_len, uint8_t *output)
Decrypt data of arbitrary length in ccm mode.
int cipher_encrypt_ccm(const cipher_t *cipher, const uint8_t *auth_data, uint32_t auth_data_len, uint8_t mac_length, uint8_t length_encoding, const uint8_t *nonce, size_t nonce_len, const uint8_t *input, size_t input_len, uint8_t *output)
Encrypt and authenticate data of arbitrary length in ccm mode.
Headers for the packet encryption class.
basic struct for using block ciphers contains the cipher interface and the context