/mbedtls-latest/programs/cipher/ |
D | cipher_aead_demo.c | 116 size_t *tag_len) in aead_prepare() argument 124 *tag_len = 16; in aead_prepare() 127 *tag_len = 16; in aead_prepare() 130 *tag_len = 8; in aead_prepare() 133 *tag_len = 16; in aead_prepare() 157 static void aead_info(const mbedtls_cipher_context_t *ctx, size_t tag_len) in aead_info() argument 170 ciph, key_bits, mode_str, (unsigned) tag_len); in aead_info() 176 static int aead_encrypt(mbedtls_cipher_context_t *ctx, size_t tag_len, in aead_encrypt() argument 197 CHK(mbedtls_cipher_write_tag(ctx, p, tag_len)); in aead_encrypt() 198 p += tag_len; in aead_encrypt() [all …]
|
/mbedtls-latest/library/ |
D | ccm.c | 175 if (ctx->tag_len == 0) { in ccm_calculate_first_block_if_ready() 196 ctx->y[0] |= ((ctx->tag_len - 2) / 2) << 3; in ccm_calculate_first_block_if_ready() 263 size_t tag_len) in mbedtls_ccm_set_lengths() argument 272 if (tag_len == 2 || tag_len > 16 || tag_len % 2 != 0) { in mbedtls_ccm_set_lengths() 282 ctx->tag_len = tag_len; in mbedtls_ccm_set_lengths() 379 if (ctx->tag_len != 0 && ctx->processed + input_len > ctx->plaintext_len) { in mbedtls_ccm_update() 473 unsigned char *tag, size_t tag_len) in mbedtls_ccm_finish() argument 502 memcpy(tag, ctx->y, tag_len); in mbedtls_ccm_finish() 516 unsigned char *tag, size_t tag_len) in ccm_auth_crypt() argument 525 if ((ret = mbedtls_ccm_set_lengths(ctx, add_len, length, tag_len)) != 0) { in ccm_auth_crypt() [all …]
|
D | cipher.c | 1183 unsigned char *tag, size_t tag_len) in mbedtls_cipher_write_tag() argument 1209 tag, tag_len); in mbedtls_cipher_write_tag() 1216 if (tag_len != 16U) { in mbedtls_cipher_write_tag() 1229 const unsigned char *tag, size_t tag_len) in mbedtls_cipher_check_tag() argument 1260 if (tag_len > sizeof(check_tag)) { in mbedtls_cipher_check_tag() 1267 check_tag, tag_len))) { in mbedtls_cipher_check_tag() 1272 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1282 if (tag_len != sizeof(check_tag)) { in mbedtls_cipher_check_tag() 1293 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1301 mbedtls_platform_zeroize(check_tag, tag_len); in mbedtls_cipher_check_tag() [all …]
|
D | gcm.c | 653 unsigned char *tag, size_t tag_len) in mbedtls_gcm_finish() argument 675 if (tag_len > 16 || tag_len < 4) { in mbedtls_gcm_finish() 683 memcpy(tag, ctx->base_ectr, tag_len); in mbedtls_gcm_finish() 697 mbedtls_xor(tag, tag, ctx->buf, tag_len); in mbedtls_gcm_finish() 712 size_t tag_len, in mbedtls_gcm_crypt_and_tag() argument 731 if ((ret = mbedtls_gcm_finish(ctx, NULL, 0, &olen, tag, tag_len)) != 0) { in mbedtls_gcm_crypt_and_tag() 745 size_t tag_len, in mbedtls_gcm_auth_decrypt() argument 755 input, output, tag_len, check_tag)) != 0) { in mbedtls_gcm_auth_decrypt() 760 diff = mbedtls_ct_memcmp(tag, check_tag, tag_len); in mbedtls_gcm_auth_decrypt()
|
D | x509.c | 1218 size_t tag_len; in mbedtls_x509_get_subject_alt_name_ext() local 1229 if ((ret = mbedtls_asn1_get_len(p, end, &tag_len)) != 0) { in mbedtls_x509_get_subject_alt_name_ext() 1234 tmp_san_buf.len = tag_len; in mbedtls_x509_get_subject_alt_name_ext()
|
D | psa_crypto.c | 4915 const uint8_t tag_len = PSA_ALG_AEAD_GET_TAG_LENGTH(alg); local 4921 if (tag_len < 4 || tag_len > 16 || tag_len % 2) { 4930 if (tag_len != 4 && tag_len != 8 && (tag_len < 12 || tag_len > 16)) { 4939 if (tag_len != 16) { 4946 (void) tag_len;
|
/mbedtls-latest/include/mbedtls/ |
D | ccm.h | 74 size_t MBEDTLS_PRIVATE(tag_len); /*!< Total tag length */ 177 unsigned char *tag, size_t tag_len); 226 unsigned char *tag, size_t tag_len); 263 const unsigned char *tag, size_t tag_len); 309 const unsigned char *tag, size_t tag_len); 374 size_t tag_len); 510 unsigned char *tag, size_t tag_len);
|
D | gcm.h | 175 size_t tag_len, 218 size_t tag_len, 356 unsigned char *tag, size_t tag_len);
|
D | cipher.h | 1004 unsigned char *tag, size_t tag_len); 1020 const unsigned char *tag, size_t tag_len); 1111 size_t *olen, size_t tag_len); 1167 size_t *olen, size_t tag_len);
|
/mbedtls-latest/tests/scripts/ |
D | gen_gcm_encrypt.pl | 55 my $tag_len = get_suite_val("Taglen"); 67 print("GCM NIST Validation (AES-$key_len,$iv_len,$pt_len,$add_len,$tag_len) #$Count\n"); 74 print(":$tag_len");
|
D | gen_gcm_decrypt.pl | 72 my $tag_len = get_suite_val("Taglen"); 84 print("GCM NIST Validation (AES-$key_len,$iv_len,$pt_len,$add_len,$tag_len) #$Count\n"); 90 print(":$tag_len");
|
/mbedtls-latest/tests/suites/ |
D | test_suite_gcm.function | 187 size_t tag_len = tag_len_bits / 8; 197 add_str->x, add_str->len, src_str->x, output, tag_len, 216 size_t tag_len = tag_len_bits / 8; 231 output, tag_len, tag_output) == 0); 234 TEST_MEMORY_COMPARE(tag_output, tag_len, tag->x, tag->len); 265 size_t tag_len = tag_len_bits / 8; 284 tag_len,
|
D | test_suite_ccm.function | 101 void ccm_lengths(int msg_len, int iv_len, int add_len, int tag_len, int res) 126 msg, out, tag, tag_len) == res); 129 msg, out, tag, tag_len); 145 void ccm_star_lengths(int msg_len, int iv_len, int add_len, int tag_len, 171 add, add_len, msg, out, tag, tag_len) == res); 174 add_len, msg, out, tag, tag_len); 176 if (res == 0 && tag_len != 0) {
|
D | test_suite_cipher.function | 99 int use_psa, size_t tag_len, const data_t *key, int direction) 106 (void) tag_len; 111 tag_len));
|
/mbedtls-latest/programs/psa/ |
D | aead_demo.c | 175 size_t tag_len = PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg); in aead_info() local 185 type_str, (unsigned) key_bits, base_str, (unsigned) tag_len); in aead_info()
|