/mbedtls-3.5.0/tests/suites/ |
D | test_suite_ccm.data | 29 CCM lengths #4 tag too short 32 CCM lengths #5 tag too long 35 CCM lengths #6 tag length not even 45 CCM lengths #9 tag length 0 51 CCM* fixed tag lengths #1 all OK 54 CCM* fixed tag lengths #2 all OK - tag length 0 57 CCM* encrypt and tag #1 61 CCM* encrypt and tag #2 65 CCM* encrypt and tag #3 69 CCM* auth decrypt tag #1 [all …]
|
D | test_suite_pkcs7.data | 49 PKCS7 Signed Data Parse Fail with corrupted signer info[1] unexpected tag #6.3 53 PKCS7 Signed Data Parse Fail with corrupted signer info[2] unexpected tag #6.4 165 PKCS7 Parse Failure Invalid ASN1: Change tag 30 to 02 #22.0 173 PKCS7 Parse Failure Invalid ASN1: Change contents of tag 30 to contain one unaccounted extra byte #… 177 PKCS7 Parse Failure Invalid ASN1: Change tag 06 to 02 #25.0 189 PKCS7 Parse Failure Invalid ASN1: Change tag a0 to 02 #28.0 197 PKCS7 Parse Failure Invalid ASN1: Change contents of tag a0 to contain one unaccounted extra byte #… 205 PKCS7 Parse Failure Invalid ASN1: Change tag 30 to 02 #32.0 213 PKCS7 Parse Failure Invalid ASN1: Change contents of tag 30 to contain one unaccounted extra byte #… 221 PKCS7 Parse Failure Invalid ASN1: Change tag 02 to 04 #36.0 [all …]
|
D | test_suite_gcm.function | 13 const data_t *tag, 52 ASSERT_ALLOC(output, tag->len); 53 TEST_EQUAL(0, mbedtls_gcm_finish(ctx, NULL, 0, &olen, output, tag->len)); 55 ASSERT_COMPARE(output, tag->len, tag->x, tag->len); 70 const data_t *tag, 98 ASSERT_ALLOC(output, tag->len); 99 TEST_EQUAL(0, mbedtls_gcm_finish(ctx, NULL, 0, &olen, output, tag->len)); 101 ASSERT_COMPARE(output, tag->len, tag->x, tag->len); 111 const data_t *tag, 127 ASSERT_ALLOC(output_tag, tag->len); [all …]
|
D | test_suite_ccm.function | 13 const data_t *tag, 28 TEST_EQUAL(0, mbedtls_ccm_set_lengths(ctx, add->len, input->len, tag->len)); 51 ASSERT_ALLOC(output, tag->len); 52 TEST_EQUAL(0, mbedtls_ccm_finish(ctx, output, tag->len)); 53 ASSERT_COMPARE(output, tag->len, tag->x, tag->len); 105 unsigned char tag[18]; 115 memset(tag, 0, sizeof(tag)); 121 msg, out, tag, tag_len) == res); 124 msg, out, tag, tag_len); 148 unsigned char tag[18]; [all …]
|
D | test_suite_asn1parse.function | 27 unsigned char tag; 29 /* First get the length, skipping over the tag. */ 37 /* Since we have a valid element start (tag and length), retrieve and 38 * check the tag. */ 39 tag = start[0]; 40 TEST_EQUAL(mbedtls_asn1_get_tag(p, end, &len2, tag ^ 1), 43 TEST_EQUAL(mbedtls_asn1_get_tag(p, end, &len2, tag), 0); 48 switch (tag & 0x1f) { 113 /* No further testing implemented for this tag. */ 182 static int traverse_callback(void *ctx, int tag, [all …]
|
D | test_suite_cipher.function | 365 unsigned char tag[16]; 415 memset(tag, 0, sizeof(tag)); 458 TEST_EQUAL(expected, mbedtls_cipher_write_tag(&ctx_enc, tag, sizeof(tag))); 479 TEST_EQUAL(expected, mbedtls_cipher_check_tag(&ctx_dec, tag, sizeof(tag))); 772 data_t *clear, data_t *ad, data_t *tag, 785 ((void) tag); 809 /* decode buffer and check tag->x */ 821 TEST_EQUAL(tag_expected, mbedtls_cipher_check_tag(&ctx, tag->x, tag->len)); 837 data_t *ad, data_t *cipher, data_t *tag, 841 * Take an AEAD ciphertext + tag and perform a pair [all …]
|
D | test_suite_oid.function | 21 asn1_buf.tag = MBEDTLS_ASN1_OID; 42 asn1_buf.tag = MBEDTLS_ASN1_OID; 63 ext_oid.tag = MBEDTLS_ASN1_OID; 84 md_oid.tag = MBEDTLS_ASN1_OID; 107 input_oid.tag = MBEDTLS_ASN1_OID;
|
D | test_suite_x509write.function | 84 * - 1 byte for MBEDTLS_ASN1_OID tag 341 unsigned char tag, sz; 458 x.tag = MBEDTLS_ASN1_OID; \ 527 // UTC tag if before 2050, 2 digits less for year 542 tag = *p++; 544 if (tag == MBEDTLS_ASN1_UTC_TIME || tag == MBEDTLS_ASN1_GENERALIZED_TIME) { 545 // Check correct tag and time written 546 TEST_ASSERT(before_tag == tag); 549 tag = *p++; 551 TEST_ASSERT(after_tag == tag); [all …]
|
/mbedtls-3.5.0/library/ |
D | asn1parse.c | 103 size_t *len, int tag) in mbedtls_asn1_get_tag() argument 109 if (**p != tag) { in mbedtls_asn1_get_tag() 141 int tag, int *val) in asn1_get_tagged_int() argument 146 if ((ret = mbedtls_asn1_get_tag(p, end, &len, tag)) != 0) { in asn1_get_tagged_int() 263 int (*cb)(void *ctx, int tag, in mbedtls_asn1_traverse_sequence_of() argument 281 unsigned char const tag = *(*p)++; in mbedtls_asn1_traverse_sequence_of() local 283 if ((tag & tag_must_mask) != tag_must_val) { in mbedtls_asn1_traverse_sequence_of() 291 if ((tag & tag_may_mask) == tag_may_val) { in mbedtls_asn1_traverse_sequence_of() 293 ret = cb(ctx, tag, *p, len); in mbedtls_asn1_traverse_sequence_of() 341 int tag; member [all …]
|
D | psa_crypto_aead.c | 144 uint8_t *tag; in mbedtls_psa_aead_encrypt() local 159 tag = ciphertext + plaintext_length; in mbedtls_psa_aead_encrypt() 170 tag, operation.tag_length)); in mbedtls_psa_aead_encrypt() 182 operation.tag_length, tag)); in mbedtls_psa_aead_encrypt() 199 tag)); in mbedtls_psa_aead_encrypt() 203 (void) tag; in mbedtls_psa_aead_encrypt() 256 const uint8_t *tag = NULL; in mbedtls_psa_aead_decrypt() local 267 plaintext_size, &tag); in mbedtls_psa_aead_decrypt() 281 tag, operation.tag_length)); in mbedtls_psa_aead_decrypt() 292 tag, operation.tag_length, in mbedtls_psa_aead_decrypt() [all …]
|
D | ccm.c | 434 unsigned char *tag, size_t tag_len) in mbedtls_ccm_finish() argument 462 if (tag != NULL) { in mbedtls_ccm_finish() 463 memcpy(tag, ctx->y, tag_len); in mbedtls_ccm_finish() 477 unsigned char *tag, size_t tag_len) in ccm_auth_crypt() argument 499 if ((ret = mbedtls_ccm_finish(ctx, tag, tag_len)) != 0) { in ccm_auth_crypt() 513 unsigned char *tag, size_t tag_len) in mbedtls_ccm_star_encrypt_and_tag() argument 516 add, add_len, input, output, tag, tag_len); in mbedtls_ccm_star_encrypt_and_tag() 523 unsigned char *tag, size_t tag_len) in mbedtls_ccm_encrypt_and_tag() argument 526 add, add_len, input, output, tag, tag_len); in mbedtls_ccm_encrypt_and_tag() 555 const unsigned char *tag, size_t tag_len) in ccm_auth_decrypt() argument [all …]
|
D | x509.c | 87 serial->tag = *(*p)++; in mbedtls_x509_get_serial() 192 if (alg->tag != (MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) { in x509_get_hash_alg() 206 md_oid.tag = *p; in x509_get_hash_alg() 265 if (params->tag != (MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) { in mbedtls_x509_get_rsassa_pss_params() 432 oid->tag = **p; in x509_get_attr_type_value() 455 val->tag = *(*p)++; in x509_get_attr_type_value() 693 unsigned char tag; in mbedtls_x509_get_time() local 700 tag = **p; in mbedtls_x509_get_time() 702 if (tag == MBEDTLS_ASN1_UTC_TIME) { in mbedtls_x509_get_time() 704 } else if (tag == MBEDTLS_ASN1_GENERALIZED_TIME) { in mbedtls_x509_get_time() [all …]
|
D | chachapoly.c | 263 unsigned char tag[16]) in chachapoly_crypt_and_tag() 282 ret = mbedtls_chachapoly_finish(ctx, tag); in chachapoly_crypt_and_tag() 295 unsigned char tag[16]) in mbedtls_chachapoly_encrypt_and_tag() 299 input, output, tag); in mbedtls_chachapoly_encrypt_and_tag() 307 const unsigned char tag[16], in mbedtls_chachapoly_auth_decrypt() 324 diff |= tag[i] ^ check_tag[i]; in mbedtls_chachapoly_auth_decrypt()
|
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() 1123 (mbedtls_chachapoly_context *) ctx->cipher_ctx, tag); in mbedtls_cipher_write_tag() 1131 const unsigned char *tag, size_t tag_len) in mbedtls_cipher_check_tag() argument 1174 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1195 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1312 unsigned char *tag, size_t tag_len) in mbedtls_cipher_aead_encrypt() argument 1328 if (output == NULL || tag != output + ilen) { in mbedtls_cipher_aead_encrypt() 1352 input, output, tag_len, tag); in mbedtls_cipher_aead_encrypt() 1360 tag, tag_len); in mbedtls_cipher_aead_encrypt() [all …]
|
D | asn1write.c | 95 int mbedtls_asn1_write_tag(unsigned char **p, const unsigned char *start, unsigned char tag) in mbedtls_asn1_write_tag() argument 101 *--(*p) = tag; in mbedtls_asn1_write_tag() 235 static int asn1_write_tagged_int(unsigned char **p, const unsigned char *start, int val, int tag) in asn1_write_tagged_int() argument 258 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(p, start, tag)); in asn1_write_tagged_int() 273 int mbedtls_asn1_write_tagged_string(unsigned char **p, const unsigned char *start, int tag, in mbedtls_asn1_write_tagged_string() argument 284 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(p, start, tag)); in mbedtls_asn1_write_tagged_string()
|
D | gcm.c | 509 unsigned char *tag, size_t tag_len) in mbedtls_gcm_finish() argument 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() 566 unsigned char *tag) 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() 597 const unsigned char *tag, in mbedtls_gcm_auth_decrypt() argument 615 diff |= tag[i] ^ check_tag[i]; in mbedtls_gcm_auth_decrypt()
|
/mbedtls-3.5.0/include/mbedtls/ |
D | asn1.h | 99 #define MBEDTLS_ASN1_IS_STRING_TAG(tag) \ argument 100 ((tag) < 32u && ( \ 101 ((1u << (tag)) & ((1u << MBEDTLS_ASN1_BMP_STRING) | \ 155 int tag; /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */ member 258 size_t *len, int tag); 413 int tag); 527 int (*cb)(void *ctx, int tag,
|
D | ccm.h | 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); 515 unsigned char *tag, size_t tag_len);
|
D | gcm.h | 174 unsigned char *tag); 215 const unsigned char *tag, 354 unsigned char *tag, size_t tag_len);
|
D | chachapoly.h | 304 unsigned char tag[16]); 336 const unsigned char tag[16],
|
/mbedtls-3.5.0/tests/scripts/ |
D | generate_pkcs7_tests.py | 129 tag = data[tag_i] 130 print("Looking at ans1: offset " + str(i) + " tag = " + tag + \ 134 if tag == "02": 141 reasons.append("Change tag " + tag + " to " + new_tag) 154 if tag in ["30", "a0", "31"]: 158 reasons.append("Change contents of tag " + tag + " to contain \ 169 if tag in ["30", "a0", "31"]:
|
D | gen_gcm_encrypt.pl | 77 my $tag = get_val("Tag"); 87 print(":\"$tag\"");
|
D | gen_gcm_decrypt.pl | 93 my $tag = get_val("Tag"); 103 print(":\"$tag\"");
|
/mbedtls-3.5.0/tests/src/drivers/ |
D | test_driver_aead.c | 352 uint8_t *tag, in mbedtls_test_transparent_aead_finish() argument 367 tag, tag_size, tag_length); in mbedtls_test_transparent_aead_finish() 371 ciphertext_length, tag, tag_size, in mbedtls_test_transparent_aead_finish() 378 (void) tag; in mbedtls_test_transparent_aead_finish() 393 const uint8_t *tag, in mbedtls_test_transparent_aead_verify() argument 434 mbedtls_psa_safer_memcmp(tag, check_tag, tag_length) in mbedtls_test_transparent_aead_verify()
|
/mbedtls-3.5.0/programs/psa/ |
D | aead_demo.c | 213 unsigned char tag[PSA_AEAD_TAG_MAX_SIZE]; in aead_encrypt() local 225 tag, sizeof(tag), &olen_tag)); in aead_encrypt() 227 memcpy(p, tag, olen_tag); in aead_encrypt()
|