e_aesccm.c
Go to the documentation of this file.
1 /* ====================================================================
2  * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  *
16  * 3. All advertising materials mentioning features or use of this
17  * software must display the following acknowledgment:
18  * "This product includes software developed by the OpenSSL Project
19  * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
20  *
21  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
22  * endorse or promote products derived from this software without
23  * prior written permission. For written permission, please contact
24  * openssl-core@openssl.org.
25  *
26  * 5. Products derived from this software may not be called "OpenSSL"
27  * nor may "OpenSSL" appear in their names without prior written
28  * permission of the OpenSSL Project.
29  *
30  * 6. Redistributions of any form whatsoever must retain the following
31  * acknowledgment:
32  * "This product includes software developed by the OpenSSL Project
33  * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
34  *
35  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
36  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
41  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
44  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
46  * OF THE POSSIBILITY OF SUCH DAMAGE.
47  * ==================================================================== */
48 
49 #include <openssl/aead.h>
50 
51 #include <assert.h>
52 
53 #include <openssl/cpu.h>
54 #include <openssl/cipher.h>
55 #include <openssl/err.h>
56 #include <openssl/mem.h>
57 
58 #include "../fipsmodule/cipher/internal.h"
59 
60 
64  unsigned M, L;
65 };
66 
67 struct ccm128_state {
68  union {
69  uint64_t u[2];
70  uint8_t c[16];
71  } nonce, cmac;
72 };
73 
74 static int CRYPTO_ccm128_init(struct ccm128_context *ctx, const AES_KEY *key,
75  block128_f block, ctr128_f ctr, unsigned M,
76  unsigned L) {
77  if (M < 4 || M > 16 || (M & 1) != 0 || L < 2 || L > 8) {
78  return 0;
79  }
80  ctx->block = block;
81  ctx->ctr = ctr;
82  ctx->M = M;
83  ctx->L = L;
84  return 1;
85 }
86 
87 static size_t CRYPTO_ccm128_max_input(const struct ccm128_context *ctx) {
88  return ctx->L >= sizeof(size_t) ? (size_t)-1
89  : (((size_t)1) << (ctx->L * 8)) - 1;
90 }
91 
92 static int ccm128_init_state(const struct ccm128_context *ctx,
93  struct ccm128_state *state, const AES_KEY *key,
94  const uint8_t *nonce, size_t nonce_len,
95  const uint8_t *aad, size_t aad_len,
96  size_t plaintext_len) {
97  const block128_f block = ctx->block;
98  const unsigned M = ctx->M;
99  const unsigned L = ctx->L;
100 
101  // |L| determines the expected |nonce_len| and the limit for |plaintext_len|.
102  if (plaintext_len > CRYPTO_ccm128_max_input(ctx) ||
103  nonce_len != 15 - L) {
104  return 0;
105  }
106 
107  // Assemble the first block for computing the MAC.
108  OPENSSL_memset(state, 0, sizeof(*state));
109  state->nonce.c[0] = (uint8_t)((L - 1) | ((M - 2) / 2) << 3);
110  if (aad_len != 0) {
111  state->nonce.c[0] |= 0x40; // Set AAD Flag
112  }
113  OPENSSL_memcpy(&state->nonce.c[1], nonce, nonce_len);
114  for (unsigned i = 0; i < L; i++) {
115  state->nonce.c[15 - i] = (uint8_t)(plaintext_len >> (8 * i));
116  }
117 
118  (*block)(state->nonce.c, state->cmac.c, key);
119  size_t blocks = 1;
120 
121  if (aad_len != 0) {
122  unsigned i;
123  // Cast to u64 to avoid the compiler complaining about invalid shifts.
124  uint64_t aad_len_u64 = aad_len;
125  if (aad_len_u64 < 0x10000 - 0x100) {
126  state->cmac.c[0] ^= (uint8_t)(aad_len_u64 >> 8);
127  state->cmac.c[1] ^= (uint8_t)aad_len_u64;
128  i = 2;
129  } else if (aad_len_u64 <= 0xffffffff) {
130  state->cmac.c[0] ^= 0xff;
131  state->cmac.c[1] ^= 0xfe;
132  state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 24);
133  state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 16);
134  state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 8);
135  state->cmac.c[5] ^= (uint8_t)aad_len_u64;
136  i = 6;
137  } else {
138  state->cmac.c[0] ^= 0xff;
139  state->cmac.c[1] ^= 0xff;
140  state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 56);
141  state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 48);
142  state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 40);
143  state->cmac.c[5] ^= (uint8_t)(aad_len_u64 >> 32);
144  state->cmac.c[6] ^= (uint8_t)(aad_len_u64 >> 24);
145  state->cmac.c[7] ^= (uint8_t)(aad_len_u64 >> 16);
146  state->cmac.c[8] ^= (uint8_t)(aad_len_u64 >> 8);
147  state->cmac.c[9] ^= (uint8_t)aad_len_u64;
148  i = 10;
149  }
150 
151  do {
152  for (; i < 16 && aad_len != 0; i++) {
153  state->cmac.c[i] ^= *aad;
154  aad++;
155  aad_len--;
156  }
157  (*block)(state->cmac.c, state->cmac.c, key);
158  blocks++;
159  i = 0;
160  } while (aad_len != 0);
161  }
162 
163  // Per RFC 3610, section 2.6, the total number of block cipher operations done
164  // must not exceed 2^61. There are two block cipher operations remaining per
165  // message block, plus one block at the end to encrypt the MAC.
166  size_t remaining_blocks = 2 * ((plaintext_len + 15) / 16) + 1;
167  if (plaintext_len + 15 < plaintext_len ||
168  remaining_blocks + blocks < blocks ||
169  (uint64_t) remaining_blocks + blocks > UINT64_C(1) << 61) {
170  return 0;
171  }
172 
173  // Assemble the first block for encrypting and decrypting. The bottom |L|
174  // bytes are replaced with a counter and all bit the encoding of |L| is
175  // cleared in the first byte.
176  state->nonce.c[0] &= 7;
177  return 1;
178 }
179 
180 static int ccm128_encrypt(const struct ccm128_context *ctx,
181  struct ccm128_state *state, const AES_KEY *key,
182  uint8_t *out, const uint8_t *in, size_t len) {
183  // The counter for encryption begins at one.
184  for (unsigned i = 0; i < ctx->L; i++) {
185  state->nonce.c[15 - i] = 0;
186  }
187  state->nonce.c[15] = 1;
188 
189  uint8_t partial_buf[16];
190  unsigned num = 0;
191  if (ctx->ctr != NULL) {
192  CRYPTO_ctr128_encrypt_ctr32(in, out, len, key, state->nonce.c, partial_buf,
193  &num, ctx->ctr);
194  } else {
195  CRYPTO_ctr128_encrypt(in, out, len, key, state->nonce.c, partial_buf, &num,
196  ctx->block);
197  }
198  return 1;
199 }
200 
201 static int ccm128_compute_mac(const struct ccm128_context *ctx,
202  struct ccm128_state *state, const AES_KEY *key,
203  uint8_t *out_tag, size_t tag_len,
204  const uint8_t *in, size_t len) {
205  block128_f block = ctx->block;
206  if (tag_len != ctx->M) {
207  return 0;
208  }
209 
210  // Incorporate |in| into the MAC.
211  union {
212  uint64_t u[2];
213  uint8_t c[16];
214  } tmp;
215  while (len >= 16) {
216  OPENSSL_memcpy(tmp.c, in, 16);
217  state->cmac.u[0] ^= tmp.u[0];
218  state->cmac.u[1] ^= tmp.u[1];
219  (*block)(state->cmac.c, state->cmac.c, key);
220  in += 16;
221  len -= 16;
222  }
223  if (len > 0) {
224  for (size_t i = 0; i < len; i++) {
225  state->cmac.c[i] ^= in[i];
226  }
227  (*block)(state->cmac.c, state->cmac.c, key);
228  }
229 
230  // Encrypt the MAC with counter zero.
231  for (unsigned i = 0; i < ctx->L; i++) {
232  state->nonce.c[15 - i] = 0;
233  }
234  (*block)(state->nonce.c, tmp.c, key);
235  state->cmac.u[0] ^= tmp.u[0];
236  state->cmac.u[1] ^= tmp.u[1];
237 
238  OPENSSL_memcpy(out_tag, state->cmac.c, tag_len);
239  return 1;
240 }
241 
242 static int CRYPTO_ccm128_encrypt(const struct ccm128_context *ctx,
243  const AES_KEY *key, uint8_t *out,
244  uint8_t *out_tag, size_t tag_len,
245  const uint8_t *nonce, size_t nonce_len,
246  const uint8_t *in, size_t len,
247  const uint8_t *aad, size_t aad_len) {
248  struct ccm128_state state;
249  return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len,
250  len) &&
251  ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, in, len) &&
253 }
254 
255 static int CRYPTO_ccm128_decrypt(const struct ccm128_context *ctx,
256  const AES_KEY *key, uint8_t *out,
257  uint8_t *out_tag, size_t tag_len,
258  const uint8_t *nonce, size_t nonce_len,
259  const uint8_t *in, size_t len,
260  const uint8_t *aad, size_t aad_len) {
261  struct ccm128_state state;
262  return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len,
263  len) &&
264  ccm128_encrypt(ctx, &state, key, out, in, len) &&
265  ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, out, len);
266 }
267 
268 #define EVP_AEAD_AES_CCM_MAX_TAG_LEN 16
269 
271  union {
272  double align;
274  } ks;
276 };
277 
278 OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >=
279  sizeof(struct aead_aes_ccm_ctx),
280  "AEAD state is too small");
281 #if defined(__GNUC__) || defined(__clang__)
283  alignof(struct aead_aes_ccm_ctx),
284  "AEAD state has insufficient alignment");
285 #endif
286 
288  size_t key_len, size_t tag_len, unsigned M,
289  unsigned L) {
290  assert(M == EVP_AEAD_max_overhead(ctx->aead));
291  assert(M == EVP_AEAD_max_tag_len(ctx->aead));
292  assert(15 - L == EVP_AEAD_nonce_length(ctx->aead));
293 
294  if (key_len != EVP_AEAD_key_length(ctx->aead)) {
296  return 0; // EVP_AEAD_CTX_init should catch this.
297  }
298 
299  if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) {
300  tag_len = M;
301  }
302 
303  if (tag_len != M) {
305  return 0;
306  }
307 
308  struct aead_aes_ccm_ctx *ccm_ctx = (struct aead_aes_ccm_ctx *)&ctx->state;
309 
311  ctr128_f ctr = aes_ctr_set_key(&ccm_ctx->ks.ks, NULL, &block, key, key_len);
312  ctx->tag_len = tag_len;
313  if (!CRYPTO_ccm128_init(&ccm_ctx->ccm, &ccm_ctx->ks.ks, block, ctr, M, L)) {
315  return 0;
316  }
317 
318  return 1;
319 }
320 
322 
324  const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag,
325  size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce,
326  size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in,
327  size_t extra_in_len, const uint8_t *ad, size_t ad_len) {
328  const struct aead_aes_ccm_ctx *ccm_ctx =
329  (struct aead_aes_ccm_ctx *)&ctx->state;
330 
331  if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) {
333  return 0;
334  }
335 
336  if (max_out_tag_len < ctx->tag_len) {
338  return 0;
339  }
340 
341  if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) {
343  return 0;
344  }
345 
346  if (!CRYPTO_ccm128_encrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, out_tag,
347  ctx->tag_len, nonce, nonce_len, in, in_len, ad,
348  ad_len)) {
350  return 0;
351  }
352 
353  *out_tag_len = ctx->tag_len;
354  return 1;
355 }
356 
358  const uint8_t *nonce, size_t nonce_len,
359  const uint8_t *in, size_t in_len,
360  const uint8_t *in_tag, size_t in_tag_len,
361  const uint8_t *ad, size_t ad_len) {
362  const struct aead_aes_ccm_ctx *ccm_ctx =
363  (struct aead_aes_ccm_ctx *)&ctx->state;
364 
365  if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) {
367  return 0;
368  }
369 
370  if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) {
372  return 0;
373  }
374 
375  if (in_tag_len != ctx->tag_len) {
377  return 0;
378  }
379 
381  assert(ctx->tag_len <= EVP_AEAD_AES_CCM_MAX_TAG_LEN);
382  if (!CRYPTO_ccm128_decrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, tag,
383  ctx->tag_len, nonce, nonce_len, in, in_len, ad,
384  ad_len)) {
386  return 0;
387  }
388 
389  if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) {
391  return 0;
392  }
393 
394  return 1;
395 }
396 
398  size_t key_len, size_t tag_len) {
399  return aead_aes_ccm_init(ctx, key, key_len, tag_len, 4, 2);
400 }
401 
403  16, // key length (AES-128)
404  13, // nonce length
405  4, // overhead
406  4, // max tag length
407  0, // seal_scatter_supports_extra_in
408 
410  NULL /* init_with_direction */,
412  NULL /* open */,
415  NULL /* get_iv */,
416  NULL /* tag_len */,
417 };
418 
421 }
422 
424  size_t key_len, size_t tag_len) {
425  return aead_aes_ccm_init(ctx, key, key_len, tag_len, 8, 2);
426 }
427 
429  16, // key length (AES-128)
430  13, // nonce length
431  8, // overhead
432  8, // max tag length
433  0, // seal_scatter_supports_extra_in
434 
436  NULL /* init_with_direction */,
438  NULL /* open */,
441  NULL /* get_iv */,
442  NULL /* tag_len */,
443 };
444 
447 }
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
ccm128_state::u
uint64_t u[2]
Definition: e_aesccm.c:69
ctx
Definition: benchmark-async.c:30
ccm128_context::ctr
ctr128_f ctr
Definition: e_aesccm.c:63
aead_aes_ccm_bluetooth_init
static int aead_aes_ccm_bluetooth_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len)
Definition: e_aesccm.c:397
CRYPTO_ccm128_decrypt
static int CRYPTO_ccm128_decrypt(const struct ccm128_context *ctx, const AES_KEY *key, uint8_t *out, uint8_t *out_tag, size_t tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t len, const uint8_t *aad, size_t aad_len)
Definition: e_aesccm.c:255
aead_aes_ccm_seal_scatter
static int aead_aes_ccm_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len)
Definition: e_aesccm.c:323
OPENSSL_PUT_ERROR
#define OPENSSL_PUT_ERROR(library, reason)
Definition: err.h:423
ccm128_state
Definition: e_aesccm.c:67
CIPHER_R_INVALID_NONCE_SIZE
#define CIPHER_R_INVALID_NONCE_SIZE
Definition: cipher.h:657
aead_aes_ccm_cleanup
static void aead_aes_ccm_cleanup(EVP_AEAD_CTX *ctx)
Definition: e_aesccm.c:321
u
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:351
CIPHER_R_BAD_KEY_LENGTH
#define CIPHER_R_BAD_KEY_LENGTH
Definition: cipher.h:648
CRYPTO_ctr128_encrypt_ctr32
#define CRYPTO_ctr128_encrypt_ctr32
Definition: boringssl_prefix_symbols.h:1148
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
EVP_AEAD_AES_CCM_MAX_TAG_LEN
#define EVP_AEAD_AES_CCM_MAX_TAG_LEN
Definition: e_aesccm.c:268
CRYPTO_ccm128_init
static int CRYPTO_ccm128_init(struct ccm128_context *ctx, const AES_KEY *key, block128_f block, ctr128_f ctr, unsigned M, unsigned L)
Definition: e_aesccm.c:74
OPENSSL_memset
static void * OPENSSL_memset(void *dst, int c, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:835
ccm128_state::cmac
union ccm128_state::@338 cmac
aead_aes_ccm_ctx::ks
AES_KEY ks
Definition: e_aesccm.c:273
EVP_AEAD_nonce_length
#define EVP_AEAD_nonce_length
Definition: boringssl_prefix_symbols.h:1461
block
Block * block
Definition: protobuf/src/google/protobuf/descriptor.cc:1041
EVP_AEAD_DEFAULT_TAG_LENGTH
#define EVP_AEAD_DEFAULT_TAG_LENGTH
Definition: aead.h:240
ccm128_context::L
unsigned L
Definition: e_aesccm.c:64
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
ccm128_compute_mac
static int ccm128_compute_mac(const struct ccm128_context *ctx, struct ccm128_state *state, const AES_KEY *key, uint8_t *out_tag, size_t tag_len, const uint8_t *in, size_t len)
Definition: e_aesccm.c:201
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
evp_aead_ctx_st_state
Definition: aead.h:210
ctr128_f
void(* ctr128_f)(const uint8_t *in, uint8_t *out, size_t blocks, const AES_KEY *key, const uint8_t ivec[16])
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h:83
ccm128_context::block
block128_f block
Definition: e_aesccm.c:62
aead_aes_ccm_init
static int aead_aes_ccm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len, unsigned M, unsigned L)
Definition: e_aesccm.c:287
evp_aead_ctx_st
Definition: aead.h:217
CIPHER_R_TAG_TOO_LARGE
#define CIPHER_R_TAG_TOO_LARGE
Definition: cipher.h:662
aes_ctr_set_key
#define aes_ctr_set_key
Definition: boringssl_prefix_symbols.h:2807
aead_aes_ccm_open_gather
static int aead_aes_ccm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, size_t in_tag_len, const uint8_t *ad, size_t ad_len)
Definition: e_aesccm.c:357
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
OPENSSL_memcpy
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:819
OPENSSL_STATIC_ASSERT
OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *) NULL) ->state) >=sizeof(struct aead_aes_ccm_ctx), "AEAD state is too small")
err.h
ERR_R_INTERNAL_ERROR
#define ERR_R_INTERNAL_ERROR
Definition: err.h:374
cipher.h
aead_aes_ccm_bluetooth_8_init
static int aead_aes_ccm_bluetooth_8_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len)
Definition: e_aesccm.c:423
aead.h
UINT64_C
#define UINT64_C(val)
Definition: stdint-msvc2008.h:238
CIPHER_R_BUFFER_TOO_SMALL
#define CIPHER_R_BUFFER_TOO_SMALL
Definition: cipher.h:649
ccm128_init_state
static int ccm128_init_state(const struct ccm128_context *ctx, struct ccm128_state *state, const AES_KEY *key, const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, size_t plaintext_len)
Definition: e_aesccm.c:92
evp_aead_st
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/internal.h:77
ccm128_encrypt
static int ccm128_encrypt(const struct ccm128_context *ctx, struct ccm128_state *state, const AES_KEY *key, uint8_t *out, const uint8_t *in, size_t len)
Definition: e_aesccm.c:180
EVP_aead_aes_128_ccm_bluetooth
const EVP_AEAD * EVP_aead_aes_128_ccm_bluetooth(void)
Definition: e_aesccm.c:419
CRYPTO_ctr128_encrypt
#define CRYPTO_ctr128_encrypt
Definition: boringssl_prefix_symbols.h:1147
key
const char * key
Definition: hpack_parser_table.cc:164
CRYPTO_ccm128_max_input
static size_t CRYPTO_ccm128_max_input(const struct ccm128_context *ctx)
Definition: e_aesccm.c:87
ccm128_context
Definition: e_aesccm.c:61
ccm128_context::M
unsigned M
Definition: e_aesccm.c:64
CRYPTO_ccm128_encrypt
static int CRYPTO_ccm128_encrypt(const struct ccm128_context *ctx, const AES_KEY *key, uint8_t *out, uint8_t *out_tag, size_t tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t len, const uint8_t *aad, size_t aad_len)
Definition: e_aesccm.c:242
aead_aes_128_ccm_bluetooth
static const EVP_AEAD aead_aes_128_ccm_bluetooth
Definition: e_aesccm.c:402
L
lua_State * L
Definition: upb/upb/bindings/lua/main.c:35
xds_manager.num
num
Definition: xds_manager.py:56
ccm128_state::c
uint8_t c[16]
Definition: e_aesccm.c:70
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
aead_aes_ccm_ctx
Definition: e_aesccm.c:270
aead_aes_128_ccm_bluetooth_8
static const EVP_AEAD aead_aes_128_ccm_bluetooth_8
Definition: e_aesccm.c:428
CIPHER_R_TOO_LARGE
#define CIPHER_R_TOO_LARGE
Definition: cipher.h:663
cpu.h
mem.h
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
autogen_x86imm.tmp
tmp
Definition: autogen_x86imm.py:12
aead_aes_ccm_ctx::ccm
struct ccm128_context ccm
Definition: e_aesccm.c:275
ccm128_state::nonce
union ccm128_state::@338 nonce
EVP_AEAD_key_length
#define EVP_AEAD_key_length
Definition: boringssl_prefix_symbols.h:1458
EVP_AEAD_max_tag_len
#define EVP_AEAD_max_tag_len
Definition: boringssl_prefix_symbols.h:1460
aes_key_st
Definition: aes.h:72
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
CRYPTO_memcmp
#define CRYPTO_memcmp
Definition: boringssl_prefix_symbols.h:1178
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
block128_f
void(* block128_f)(const uint8_t in[16], uint8_t out[16], const AES_KEY *key)
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h:76
EVP_AEAD_max_overhead
#define EVP_AEAD_max_overhead
Definition: boringssl_prefix_symbols.h:1459
aead_aes_ccm_ctx::align
double align
Definition: e_aesccm.c:272
EVP_aead_aes_128_ccm_bluetooth_8
const EVP_AEAD * EVP_aead_aes_128_ccm_bluetooth_8(void)
Definition: e_aesccm.c:445
CIPHER_R_BAD_DECRYPT
#define CIPHER_R_BAD_DECRYPT
Definition: cipher.h:647


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:18