23#ifndef CRYPTO_MODES_OCB_H
24#define CRYPTO_MODES_OCB_H
42#define OCB_ERR_INVALID_NONCE_LENGTH (-2)
46#define OCB_ERR_INVALID_BLOCK_LENGTH (-3)
50#define OCB_ERR_INVALID_DATA_LENGTH (-3)
54#define OCB_ERR_INVALID_TAG_LENGTH (-4)
58#define OCB_ERR_INVALID_TAG (-5)
81 const uint8_t *auth_data,
size_t auth_data_len,
83 const uint8_t *nonce,
size_t nonce_len,
84 const uint8_t *input,
size_t input_len,
106 const uint8_t *auth_data,
size_t auth_data_len,
108 const uint8_t *nonce,
size_t nonce_len,
109 const uint8_t *input,
size_t input_len,
Headers for the packet encryption class.
int32_t cipher_decrypt_ocb(const cipher_t *cipher, const uint8_t *auth_data, size_t auth_data_len, uint8_t tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *input, size_t input_len, uint8_t *output)
Decrypt and verify the authentication of OCB encrypted data.
int32_t cipher_encrypt_ocb(const cipher_t *cipher, const uint8_t *auth_data, size_t auth_data_len, uint8_t tag_len, 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 OCB mode.
basic struct for using block ciphers contains the cipher interface and the context