/mbedtls-3.5.0/programs/cipher/ |
D | cipher_aead_demo.c | 128 size_t *tag_len) in aead_prepare() argument 136 *tag_len = 16; in aead_prepare() 139 *tag_len = 16; in aead_prepare() 142 *tag_len = 8; in aead_prepare() 145 *tag_len = 16; in aead_prepare() 169 static void aead_info(const mbedtls_cipher_context_t *ctx, size_t tag_len) in aead_info() argument 182 ciph, key_bits, mode_str, (unsigned) tag_len); in aead_info() 188 static int aead_encrypt(mbedtls_cipher_context_t *ctx, size_t tag_len, in aead_encrypt() argument 209 CHK(mbedtls_cipher_write_tag(ctx, p, tag_len)); in aead_encrypt() 210 p += tag_len; in aead_encrypt() [all …]
|
/mbedtls-3.5.0/library/ |
D | ccm.c | 158 if (ctx->tag_len == 0) { in ccm_calculate_first_block_if_ready() 179 ctx->y[0] |= ((ctx->tag_len - 2) / 2) << 3; in ccm_calculate_first_block_if_ready() 241 size_t tag_len) in mbedtls_ccm_set_lengths() argument 250 if (tag_len == 2 || tag_len > 16 || tag_len % 2 != 0) { in mbedtls_ccm_set_lengths() 260 ctx->tag_len = tag_len; in mbedtls_ccm_set_lengths() 347 if (ctx->tag_len != 0 && ctx->processed + input_len > ctx->plaintext_len) { in mbedtls_ccm_update() 434 unsigned char *tag, size_t tag_len) in mbedtls_ccm_finish() argument 463 memcpy(tag, ctx->y, tag_len); in mbedtls_ccm_finish() 477 unsigned char *tag, size_t tag_len) in ccm_auth_crypt() argument 486 if ((ret = mbedtls_ccm_set_lengths(ctx, add_len, length, tag_len)) != 0) { in ccm_auth_crypt() [all …]
|
D | cipher.c | 1085 unsigned char *tag, size_t tag_len) in mbedtls_cipher_write_tag() argument 1111 tag, tag_len); in mbedtls_cipher_write_tag() 1118 if (tag_len != 16U) { in mbedtls_cipher_write_tag() 1131 const unsigned char *tag, size_t tag_len) in mbedtls_cipher_check_tag() argument 1162 if (tag_len > sizeof(check_tag)) { in mbedtls_cipher_check_tag() 1169 check_tag, tag_len))) { in mbedtls_cipher_check_tag() 1174 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1184 if (tag_len != sizeof(check_tag)) { in mbedtls_cipher_check_tag() 1195 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1203 mbedtls_platform_zeroize(check_tag, tag_len); in mbedtls_cipher_check_tag() [all …]
|
D | gcm.c | 509 unsigned char *tag, size_t tag_len) in mbedtls_gcm_finish() argument 528 if (tag_len > 16 || tag_len < 4) { in mbedtls_gcm_finish() 536 memcpy(tag, ctx->base_ectr, tag_len); in mbedtls_gcm_finish() 550 mbedtls_xor(tag, tag, ctx->buf, tag_len); in mbedtls_gcm_finish() 565 size_t tag_len, in mbedtls_gcm_crypt_and_tag() argument 584 if ((ret = mbedtls_gcm_finish(ctx, NULL, 0, &olen, tag, tag_len)) != 0) { in mbedtls_gcm_crypt_and_tag() 598 size_t tag_len, in mbedtls_gcm_auth_decrypt() argument 609 input, output, tag_len, check_tag)) != 0) { in mbedtls_gcm_auth_decrypt() 614 for (diff = 0, i = 0; i < tag_len; i++) { in mbedtls_gcm_auth_decrypt()
|
D | x509.c | 1239 size_t len, tag_len; in mbedtls_x509_get_subject_alt_name() local 1261 if ((ret = mbedtls_asn1_get_len(p, end, &tag_len)) != 0) { in mbedtls_x509_get_subject_alt_name() 1266 tmp_san_buf.len = tag_len; in mbedtls_x509_get_subject_alt_name()
|
D | psa_crypto.c | 4502 const uint8_t tag_len = PSA_ALG_AEAD_GET_TAG_LENGTH(alg); local 4508 if (tag_len < 4 || tag_len > 16 || tag_len % 2) { 4517 if (tag_len != 4 && tag_len != 8 && (tag_len < 12 || tag_len > 16)) { 4526 if (tag_len != 16) { 4533 (void) tag_len;
|
/mbedtls-3.5.0/include/mbedtls/ |
D | ccm.h | 83 size_t MBEDTLS_PRIVATE(tag_len); /*!< Total tag length */ 182 unsigned char *tag, size_t tag_len); 231 unsigned char *tag, size_t tag_len); 268 const unsigned char *tag, size_t tag_len); 314 const unsigned char *tag, size_t tag_len); 379 size_t tag_len); 515 unsigned char *tag, size_t tag_len);
|
D | gcm.h | 173 size_t tag_len, 216 size_t tag_len, 354 unsigned char *tag, size_t tag_len);
|
D | cipher.h | 1012 unsigned char *tag, size_t tag_len); 1028 const unsigned char *tag, size_t tag_len); 1119 size_t *olen, size_t tag_len); 1175 size_t *olen, size_t tag_len);
|
/mbedtls-3.5.0/tests/scripts/ |
D | gen_gcm_encrypt.pl | 67 my $tag_len = get_suite_val("Taglen"); 79 print("GCM NIST Validation (AES-$key_len,$iv_len,$pt_len,$add_len,$tag_len) #$Count\n"); 86 print(":$tag_len");
|
D | gen_gcm_decrypt.pl | 84 my $tag_len = get_suite_val("Taglen"); 96 print("GCM NIST Validation (AES-$key_len,$iv_len,$pt_len,$add_len,$tag_len) #$Count\n"); 102 print(":$tag_len");
|
/mbedtls-3.5.0/tests/suites/ |
D | test_suite_gcm.function | 172 size_t tag_len = tag_len_bits / 8; 181 add_str->x, add_str->len, src_str->x, output, tag_len, 199 size_t tag_len = tag_len_bits / 8; 213 output, tag_len, tag_output) == 0); 216 ASSERT_COMPARE(tag_output, tag_len, tag->x, tag->len); 246 size_t tag_len = tag_len_bits / 8; 264 tag_len,
|
D | test_suite_ccm.function | 97 void ccm_lengths(int msg_len, int iv_len, int add_len, int tag_len, int res) 121 msg, out, tag, tag_len) == res); 124 msg, out, tag, tag_len); 139 void ccm_star_lengths(int msg_len, int iv_len, int add_len, int tag_len, 164 add, add_len, msg, out, tag, tag_len) == res); 167 add_len, msg, out, tag, tag_len); 169 if (res == 0 && tag_len != 0) {
|
D | test_suite_cipher.function | 96 int use_psa, size_t tag_len, const data_t *key, int direction) 103 (void) tag_len; 108 tag_len));
|
/mbedtls-3.5.0/programs/psa/ |
D | aead_demo.c | 187 size_t tag_len = PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg); in aead_info() local 197 type_str, (unsigned) key_bits, base_str, (unsigned) tag_len); in aead_info()
|