Home
last modified time | relevance | path

Searched refs:tag (Results 1 – 25 of 58) sorted by relevance

123

/mbedtls-3.4.0/tests/suites/
Dtest_suite_ccm.data29 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 …]
Dtest_suite_gcm.function13 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,
99 ASSERT_ALLOC( output, tag->len );
100 TEST_EQUAL( 0, mbedtls_gcm_finish( ctx, NULL, 0, &olen, output, tag->len ) );
102 ASSERT_COMPARE( output, tag->len, tag->x, tag->len );
112 const data_t *tag,
129 ASSERT_ALLOC( output_tag, tag->len );
[all …]
Dtest_suite_ccm.function13 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 );
147 unsigned char tag[18];
[all …]
Dtest_suite_asn1parse.function27 unsigned char tag;
29 /* First get the length, skipping over the tag. */
36 /* Since we have a valid element start (tag and length), retrieve and
37 * check the tag. */
38 tag = start[0];
39 TEST_EQUAL( mbedtls_asn1_get_tag( p, end, &len2, tag ^ 1 ),
42 TEST_EQUAL( mbedtls_asn1_get_tag( p, end, &len2, tag ), 0 );
47 switch( tag & 0x1f )
112 /* No further testing implemented for this tag. */
191 static int traverse_callback( void *ctx, int tag,
[all …]
Dtest_suite_cipher.function383 unsigned char tag[16];
435 memset( tag, 0, sizeof( tag ) );
477 TEST_EQUAL( expected, mbedtls_cipher_write_tag( &ctx_enc, tag, sizeof(tag) ) );
498 TEST_EQUAL( expected, mbedtls_cipher_check_tag( &ctx_dec, tag, sizeof(tag) ) );
785 data_t * clear, data_t * ad, data_t * tag,
798 ((void) tag);
821 /* decode buffer and check tag->x */
833 TEST_EQUAL( tag_expected, mbedtls_cipher_check_tag( &ctx, tag->x, tag->len ) );
850 data_t * ad, data_t * cipher, data_t * tag,
854 * Take an AEAD ciphertext + tag and perform a pair
[all …]
Dtest_suite_oid.function21 asn1_buf.tag = MBEDTLS_ASN1_OID;
45 asn1_buf.tag = MBEDTLS_ASN1_OID;
69 ext_oid.tag = MBEDTLS_ASN1_OID;
93 md_oid.tag = MBEDTLS_ASN1_OID;
Dtest_suite_x509write.function86 * - 1 byte for MBEDTLS_ASN1_OID tag
310 unsigned char tag, sz;
416 x.tag = MBEDTLS_ASN1_OID; \
492 // UTC tag if before 2050, 2 digits less for year
514 tag = *p++;
516 if( tag == MBEDTLS_ASN1_UTC_TIME || tag == MBEDTLS_ASN1_GENERALIZED_TIME )
518 // Check correct tag and time written
519 TEST_ASSERT( before_tag == tag );
522 tag = *p++;
524 TEST_ASSERT( after_tag == tag );
[all …]
/mbedtls-3.4.0/library/
Dasn1parse.c99 size_t *len, int tag ) in mbedtls_asn1_get_tag() argument
104 if( **p != tag ) in mbedtls_asn1_get_tag()
133 int tag, int *val ) in asn1_get_tagged_int() argument
138 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, tag ) ) != 0 ) in asn1_get_tagged_int()
247 int (*cb)( void *ctx, int tag, in mbedtls_asn1_traverse_sequence_of() argument
266 unsigned char const tag = *(*p)++; in mbedtls_asn1_traverse_sequence_of() local
268 if( ( tag & tag_must_mask ) != tag_must_val ) in mbedtls_asn1_traverse_sequence_of()
274 if( ( tag & tag_may_mask ) == tag_may_val ) in mbedtls_asn1_traverse_sequence_of()
278 ret = cb( ctx, tag, *p, len ); in mbedtls_asn1_traverse_sequence_of()
324 int tag; member
[all …]
Dpsa_crypto_aead.c138 uint8_t *tag; in mbedtls_psa_aead_encrypt() local
153 tag = ciphertext + plaintext_length; in mbedtls_psa_aead_encrypt()
165 tag, operation.tag_length ) ); in mbedtls_psa_aead_encrypt()
179 operation.tag_length, tag ) ); in mbedtls_psa_aead_encrypt()
199 tag ) ); in mbedtls_psa_aead_encrypt()
204 (void) tag; in mbedtls_psa_aead_encrypt()
254 const uint8_t *tag = NULL; in mbedtls_psa_aead_decrypt() local
264 plaintext_size, &tag ); in mbedtls_psa_aead_decrypt()
278 tag, operation.tag_length ) ); in mbedtls_psa_aead_decrypt()
291 tag, operation.tag_length, in mbedtls_psa_aead_decrypt()
[all …]
Dccm.c449 unsigned char *tag, size_t tag_len ) in mbedtls_ccm_finish() argument
478 if( tag != NULL ) in mbedtls_ccm_finish()
479 memcpy( tag, ctx->y, tag_len ); in mbedtls_ccm_finish()
492 unsigned char *tag, size_t tag_len ) in ccm_auth_crypt() argument
510 if( ( ret = mbedtls_ccm_finish( ctx, tag, tag_len ) ) != 0 ) in ccm_auth_crypt()
523 unsigned char *tag, size_t tag_len ) in mbedtls_ccm_star_encrypt_and_tag() argument
526 add, add_len, input, output, tag, tag_len ) ); in mbedtls_ccm_star_encrypt_and_tag()
533 unsigned char *tag, size_t tag_len ) in mbedtls_ccm_encrypt_and_tag() argument
536 add, add_len, input, output, tag, tag_len ) ); in mbedtls_ccm_encrypt_and_tag()
563 const unsigned char *tag, size_t tag_len ) in ccm_auth_decrypt() argument
[all …]
Dx509.c85 serial->tag = *(*p)++; in mbedtls_x509_get_serial()
188 if( alg->tag != ( MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) in x509_get_hash_alg()
200 md_oid.tag = *p; in x509_get_hash_alg()
254 if( params->tag != ( MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) in mbedtls_x509_get_rsassa_pss_params()
401 oid->tag = **p; in x509_get_attr_type_value()
421 val->tag = *(*p)++; in x509_get_attr_type_value()
661 unsigned char tag; in mbedtls_x509_get_time() local
667 tag = **p; in mbedtls_x509_get_time()
669 if( tag == MBEDTLS_ASN1_UTC_TIME ) in mbedtls_x509_get_time()
671 else if( tag == MBEDTLS_ASN1_GENERALIZED_TIME ) in mbedtls_x509_get_time()
[all …]
Dchachapoly.c259 unsigned char tag[16] ) in chachapoly_crypt_and_tag()
275 ret = mbedtls_chachapoly_finish( ctx, tag ); in chachapoly_crypt_and_tag()
288 unsigned char tag[16] ) in mbedtls_chachapoly_encrypt_and_tag()
292 input, output, tag ) ); in mbedtls_chachapoly_encrypt_and_tag()
300 const unsigned char tag[16], in mbedtls_chachapoly_auth_decrypt()
318 diff |= tag[i] ^ check_tag[i]; in mbedtls_chachapoly_auth_decrypt()
Dcipher.c1090 unsigned char *tag, size_t tag_len ) in mbedtls_cipher_write_tag() argument
1116 tag, tag_len ) ); in mbedtls_cipher_write_tag()
1128 (mbedtls_chachapoly_context*) ctx->cipher_ctx, tag ) ); in mbedtls_cipher_write_tag()
1136 const unsigned char *tag, size_t tag_len ) in mbedtls_cipher_check_tag() argument
1181 if( mbedtls_ct_memcmp( tag, check_tag, tag_len ) != 0 ) in mbedtls_cipher_check_tag()
1204 if( mbedtls_ct_memcmp( tag, check_tag, tag_len ) != 0 ) in mbedtls_cipher_check_tag()
1319 unsigned char *tag, size_t tag_len ) in mbedtls_cipher_aead_encrypt() argument
1336 if( output == NULL || tag != output + ilen ) in mbedtls_cipher_aead_encrypt()
1359 input, output, tag_len, tag ) ); in mbedtls_cipher_aead_encrypt()
1368 tag, tag_len ) ); in mbedtls_cipher_aead_encrypt()
[all …]
Dasn1write.c95 int mbedtls_asn1_write_tag( unsigned char **p, const unsigned char *start, unsigned char tag ) in mbedtls_asn1_write_tag() argument
100 *--(*p) = tag; in mbedtls_asn1_write_tag()
228 static int asn1_write_tagged_int( unsigned char **p, const unsigned char *start, int val, int tag ) in asn1_write_tagged_int() argument
252 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, tag ) ); in asn1_write_tagged_int()
267 int mbedtls_asn1_write_tagged_string( unsigned char **p, const unsigned char *start, int tag, in mbedtls_asn1_write_tagged_string() argument
277 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, tag ) ); in mbedtls_asn1_write_tagged_string()
Dx509_crt.c317 if( a->tag == b->tag && in x509_string_cmp()
324 if( ( a->tag == MBEDTLS_ASN1_UTF8_STRING || a->tag == MBEDTLS_ASN1_PRINTABLE_STRING ) && in x509_string_cmp()
325 ( b->tag == MBEDTLS_ASN1_UTF8_STRING || b->tag == MBEDTLS_ASN1_PRINTABLE_STRING ) && in x509_string_cmp()
354 if( a->oid.tag != b->oid.tag || in x509_name_cmp()
476 uid->tag = **p; in x509_get_uid()
649 unsigned char tag; in x509_get_subject_alt_name() local
666 tag = **p; in x509_get_subject_alt_name()
671 if( ( tag & MBEDTLS_ASN1_TAG_CLASS_MASK ) != in x509_get_subject_alt_name()
709 buf->tag = tag; in x509_get_subject_alt_name()
818 policy_oid.tag = MBEDTLS_ASN1_OID; in x509_get_certificate_policies()
[all …]
Dgcm.c489 unsigned char *tag, size_t tag_len ) in mbedtls_gcm_finish() argument
516 memcpy( tag, ctx->base_ectr, tag_len ); in mbedtls_gcm_finish()
533 tag[i] ^= ctx->buf[i]; in mbedtls_gcm_finish()
549 unsigned char *tag ) in mbedtls_gcm_crypt_and_tag() argument
564 if( ( ret = mbedtls_gcm_finish( ctx, NULL, 0, &olen, tag, tag_len ) ) != 0 ) in mbedtls_gcm_crypt_and_tag()
576 const unsigned char *tag, in mbedtls_gcm_auth_decrypt() argument
595 diff |= tag[i] ^ check_tag[i]; in mbedtls_gcm_auth_decrypt()
/mbedtls-3.4.0/include/mbedtls/
Dasn1.h99 #define MBEDTLS_ASN1_IS_STRING_TAG( tag ) \ argument
100 ( ( tag ) < 32u && ( \
101 ( ( 1u << ( tag ) ) & ( ( 1u << MBEDTLS_ASN1_BMP_STRING ) | \
156 int tag; /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */ member
262 size_t *len, int tag );
417 int tag );
531 int (*cb)( void *ctx, int tag,
Dccm.h183 unsigned char *tag, size_t tag_len );
232 unsigned char *tag, size_t tag_len );
269 const unsigned char *tag, size_t tag_len );
315 const unsigned char *tag, size_t tag_len );
516 unsigned char *tag, size_t tag_len );
Dgcm.h175 unsigned char *tag );
216 const unsigned char *tag,
355 unsigned char *tag, size_t tag_len );
Dchachapoly.h306 unsigned char tag[16] );
338 const unsigned char tag[16],
Dasn1write.h69 unsigned char tag );
222 int tag, const char *text,
/mbedtls-3.4.0/tests/src/drivers/
Dtest_driver_aead.c374 uint8_t *tag, in mbedtls_test_transparent_aead_finish() argument
392 tag, tag_size, tag_length ); in mbedtls_test_transparent_aead_finish()
396 ciphertext_length, tag, tag_size, in mbedtls_test_transparent_aead_finish()
403 (void) tag; in mbedtls_test_transparent_aead_finish()
418 const uint8_t *tag, in mbedtls_test_transparent_aead_verify() argument
463 mbedtls_psa_safer_memcmp( tag, check_tag, tag_length ) in mbedtls_test_transparent_aead_verify()
/mbedtls-3.4.0/programs/psa/
Daead_demo.c212 unsigned char tag[PSA_AEAD_TAG_MAX_SIZE]; in aead_encrypt() local
224 tag, sizeof( tag ), &olen_tag ) ); in aead_encrypt()
226 memcpy( p, tag, olen_tag ); in aead_encrypt()
/mbedtls-3.4.0/tests/scripts/
Dgen_gcm_encrypt.pl77 my $tag = get_val("Tag");
87 print(":\"$tag\"");
Dgen_gcm_decrypt.pl93 my $tag = get_val("Tag");
103 print(":\"$tag\"");

123