43 #if defined(MBEDTLS_BLOCK_CIPHER_C)
47 #define MBEDTLS_CCM_DECRYPT 0
48 #define MBEDTLS_CCM_ENCRYPT 1
49 #define MBEDTLS_CCM_STAR_DECRYPT 2
50 #define MBEDTLS_CCM_STAR_ENCRYPT 3
53 #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
55 #define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
61 #if !defined(MBEDTLS_CCM_ALT)
87 #if defined(MBEDTLS_BLOCK_CIPHER_C)
125 const unsigned char *
key,
126 unsigned int keybits);
174 const unsigned char *iv,
size_t iv_len,
175 const unsigned char *ad,
size_t ad_len,
177 unsigned char *
tag,
size_t tag_len);
223 const unsigned char *iv,
size_t iv_len,
224 const unsigned char *ad,
size_t ad_len,
226 unsigned char *
tag,
size_t tag_len);
260 const unsigned char *iv,
size_t iv_len,
261 const unsigned char *ad,
size_t ad_len,
263 const unsigned char *
tag,
size_t tag_len);
306 const unsigned char *iv,
size_t iv_len,
307 const unsigned char *ad,
size_t ad_len,
309 const unsigned char *
tag,
size_t tag_len);
341 const unsigned char *iv,
373 size_t plaintext_len,
407 const unsigned char *ad,
474 const unsigned char *
input,
size_t input_len,
475 unsigned char *
output,
size_t output_size,
510 unsigned char *
tag,
size_t tag_len);
512 #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_CCM_GCM_CAN_AES)
519 int mbedtls_ccm_self_test(
int verbose);
Internal abstraction layer.
int mbedtls_ccm_encrypt_and_tag(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *ad, size_t ad_len, const unsigned char *input, unsigned char *output, unsigned char *tag, size_t tag_len)
This function encrypts a buffer using CCM.
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
This function releases and clears the specified CCM context and underlying cipher sub-context.
int mbedtls_ccm_starts(mbedtls_ccm_context *ctx, int mode, const unsigned char *iv, size_t iv_len)
This function starts a CCM encryption or decryption operation.
int mbedtls_ccm_star_auth_decrypt(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *ad, size_t ad_len, const unsigned char *input, unsigned char *output, const unsigned char *tag, size_t tag_len)
This function performs a CCM* authenticated decryption of a buffer.
int mbedtls_ccm_setkey(mbedtls_ccm_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key, unsigned int keybits)
This function initializes the CCM context set in the ctx parameter and sets the encryption key.
int mbedtls_ccm_star_encrypt_and_tag(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *ad, size_t ad_len, const unsigned char *input, unsigned char *output, unsigned char *tag, size_t tag_len)
This function encrypts a buffer using CCM*.
int mbedtls_ccm_finish(mbedtls_ccm_context *ctx, unsigned char *tag, size_t tag_len)
This function finishes the CCM operation and generates the authentication tag.
int mbedtls_ccm_set_lengths(mbedtls_ccm_context *ctx, size_t total_ad_len, size_t plaintext_len, size_t tag_len)
This function declares the lengths of the message and additional data for a CCM encryption or decrypt...
int mbedtls_ccm_update(mbedtls_ccm_context *ctx, const unsigned char *input, size_t input_len, unsigned char *output, size_t output_size, size_t *output_len)
This function feeds an input buffer into an ongoing CCM encryption or decryption operation.
struct mbedtls_ccm_context mbedtls_ccm_context
The CCM context-type definition.
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
This function initializes the specified CCM context, to make references valid, and prepare the contex...
int mbedtls_ccm_auth_decrypt(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *ad, size_t ad_len, const unsigned char *input, unsigned char *output, const unsigned char *tag, size_t tag_len)
This function performs a CCM authenticated decryption of a buffer.
int mbedtls_ccm_update_ad(mbedtls_ccm_context *ctx, const unsigned char *ad, size_t ad_len)
This function feeds an input buffer as associated data (authenticated but not encrypted data) in a CC...
This file contains an abstraction interface for use with the cipher primitives provided by the librar...
mbedtls_cipher_id_t
Supported cipher types.
static SQLCHAR output[256]
Build-time configuration info.
const struct ncbi::grid::netcache::search::fields::KEY key
Macro wrapper for struct's members.
The CCM context-type definition.
unsigned int MBEDTLS_PRIVATE(mode)
size_t MBEDTLS_PRIVATE(plaintext_len)
size_t MBEDTLS_PRIVATE(add_len)
size_t MBEDTLS_PRIVATE(tag_len)
unsigned char MBEDTLS_PRIVATE(y)[16]
size_t MBEDTLS_PRIVATE(processed)
int MBEDTLS_PRIVATE(state)
unsigned int MBEDTLS_PRIVATE(q)
unsigned char MBEDTLS_PRIVATE(ctr)[16]
mbedtls_cipher_context_t MBEDTLS_PRIVATE(cipher_ctx)