Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 178) sorted by relevance

12345678

/mbedtls-development/library/
A Dasn1write.c39 if( len < 0x80 ) in mbedtls_asn1_write_len()
114 size_t len = 0; in mbedtls_asn1_write_raw_buffer() local
119 len = size; in mbedtls_asn1_write_raw_buffer()
120 (*p) -= len; in mbedtls_asn1_write_raw_buffer()
130 size_t len = 0; in mbedtls_asn1_write_mpi() local
139 (*p) -= len; in mbedtls_asn1_write_mpi()
151 len += 1; in mbedtls_asn1_write_mpi()
221 len++; in mbedtls_asn1_write_bool()
238 len += 1; in asn1_write_tagged_int()
249 len += 1; in asn1_write_tagged_int()
[all …]
A Dx509write_crt.c141 size_t len = 0; in mbedtls_x509write_crt_set_basic_constraints() local
166 is_ca, buf + sizeof(buf) - len, len ) ); in mbedtls_x509write_crt_set_basic_constraints()
175 size_t len = 0; in mbedtls_x509write_crt_set_subject_key_identifier() local
181 ret = mbedtls_sha1( buf + sizeof( buf ) - len, len, in mbedtls_x509write_crt_set_subject_key_identifier()
186 len = 20; in mbedtls_x509write_crt_set_subject_key_identifier()
195 0, buf + sizeof(buf) - len, len ); in mbedtls_x509write_crt_set_subject_key_identifier()
203 size_t len = 0; in mbedtls_x509write_crt_set_authority_key_identifier() local
209 ret = mbedtls_sha1( buf + sizeof( buf ) - len, len, in mbedtls_x509write_crt_set_authority_key_identifier()
214 len = 20; in mbedtls_x509write_crt_set_authority_key_identifier()
229 0, buf + sizeof( buf ) - len, len ); in mbedtls_x509write_crt_set_authority_key_identifier()
[all …]
A Dasn1parse.c123 size_t len; in mbedtls_asn1_get_bool() local
128 if( len != 1 ) in mbedtls_asn1_get_bool()
142 size_t len; in asn1_get_tagged_int() local
161 --len; in asn1_get_tagged_int()
201 size_t len; in mbedtls_asn1_get_mpi() local
208 *p += len; in mbedtls_asn1_get_mpi()
258 size_t len; in mbedtls_asn1_traverse_sequence_of() local
309 --( *len ); in mbedtls_asn1_get_bitstring_null()
357 cur->buf.len = len; in asn1_get_sequence_of_cb()
384 size_t len; in mbedtls_asn1_get_alg() local
[all …]
A Dx509_create.c240 size_t len = 0; in x509_write_name() local
256 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_name()
261 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_name()
273 size_t len = 0; in mbedtls_x509_write_names() local
282 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in mbedtls_x509_write_names()
294 size_t len = 0; in mbedtls_x509_write_sig() local
299 len = size; in mbedtls_x509_write_sig()
300 (*p) -= len; in mbedtls_x509_write_sig()
307 len += 1; in mbedtls_x509_write_sig()
324 size_t len = 0; in x509_write_extension() local
[all …]
A Dpkwrite.c76 size_t len = 0; in pk_write_rsa_pubkey() local
85 len += ret; in pk_write_rsa_pubkey()
91 len += ret; in pk_write_rsa_pubkey()
115 size_t len = 0; in pk_write_ec_pubkey() local
128 *p -= len; in pk_write_ec_pubkey()
143 size_t len = 0; in pk_write_ec_param() local
180 size_t len = 0; in mbedtls_pk_write_pubkey() local
251 len += 1; in mbedtls_pk_write_pubkey_der()
317 size_t len = 0; in mbedtls_pk_write_key_der() local
342 len += ret; in mbedtls_pk_write_key_der()
[all …]
A Dx509write_csr.c149 size_t len = 0; in x509write_csr_der_internal() local
163 if( len ) in x509write_csr_der_internal()
165 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in x509write_csr_der_internal()
171 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in x509write_csr_der_internal()
182 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in x509write_csr_der_internal()
189 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in x509write_csr_der_internal()
198 len += pub_len; in x509write_csr_der_internal()
211 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in x509write_csr_der_internal()
278 c2 -= len; in x509write_csr_der_internal()
283 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c2, buf, len ) ); in x509write_csr_der_internal()
[all …]
A Dentropy_poll.c78 *olen = len; in mbedtls_platform_entropy_poll()
141 size_t len; in sysctl_arnd_wrapper() local
148 len = buflen > 256 ? 256 : buflen; in sysctl_arnd_wrapper()
151 buflen -= len; in sysctl_arnd_wrapper()
152 buf += len; in sysctl_arnd_wrapper()
188 *olen = len; in mbedtls_platform_entropy_poll()
198 read_len = fread( output, 1, len, file ); in mbedtls_platform_entropy_poll()
199 if( read_len != len ) in mbedtls_platform_entropy_poll()
206 *olen = len; in mbedtls_platform_entropy_poll()
227 if( len < use_len ) in mbedtls_nv_seed_poll()
[all …]
A Dpkparse.c246 size_t len; in pk_group_from_specified() local
285 p += len; in pk_group_from_specified()
322 p += len; in pk_group_from_specified()
330 p += len; in pk_group_from_specified()
364 p += len; in pk_group_from_specified()
528 size_t len; in pk_get_rsapubkey() local
546 *p += len; in pk_get_rsapubkey()
556 *p += len; in pk_get_rsapubkey()
615 size_t len; in mbedtls_pk_parse_subpubkey() local
710 size_t len; in pk_parse_key_pkcs1_der() local
[all …]
A Dx509.c150 size_t len; in x509_get_hash_alg() local
171 p += md_oid.len; in x509_get_hash_alg()
210 size_t len; in mbedtls_x509_get_rsassa_pss_params() local
351 size_t len; in x509_get_attr_type_value() local
359 end = *p + len; in x509_get_attr_type_value()
569 len -= 2; in x509_parse_time()
580 len--; in x509_parse_time()
632 size_t len; in mbedtls_x509_get_sig() local
645 sig->len = len; in mbedtls_x509_get_sig()
648 *p += len; in mbedtls_x509_get_sig()
[all …]
A Decjpake.c172 size_t len; in ecjpake_write_len_point() local
185 *p += 4 + len; in ecjpake_write_len_point()
335 size_t len; in ecjpake_zkp_write() local
355 *p += len; in ecjpake_zkp_write()
358 if( end < *p || (size_t)( end - *p ) < 1 + len || len > 255 ) in ecjpake_zkp_write()
366 *p += len; in ecjpake_zkp_write()
430 size_t len; in ecjpake_kkp_write() local
440 *p += len; in ecjpake_kkp_write()
769 if( len < *olen ) in mbedtls_ecjpake_derive_secret()
1009 while( len > 0 ) in ecjpake_lgc()
[all …]
A Dx509_crt.c322 a->len == b->len && in x509_string_cmp()
330 a->len == b->len && in x509_string_cmp()
359 a->oid.len != b->oid.len || in x509_name_cmp()
832 policy_oid.len = len; in x509_get_certificate_policies()
865 buf->len = policy_oid.len; in x509_get_certificate_policies()
1137 p += crt->raw.len - len; in x509_crt_parse_der_core()
1317 if( crt->sig_oid.len != sig_oid2.len || in x509_crt_parse_der_core()
1320 sig_params1.len != sig_params2.len || in x509_crt_parse_der_core()
1594 len = MAX_PATH - len; in mbedtls_x509_crt_parse_path()
1725 cur_oid.len = len; in x509_get_other_name()
[all …]
/mbedtls-development/tests/suites/
A Dtest_suite_ccm.function26 TEST_EQUAL( input->len, expected_output->len );
28 TEST_EQUAL( 0, mbedtls_ccm_set_lengths( ctx, add->len, input->len, tag->len ) );
53 ASSERT_COMPARE( output, tag->len, tag->x, tag->len );
187 const size_t expected_tag_len = result->len - msg->len;
201 TEST_EQUAL( mbedtls_ccm_encrypt_and_tag( &ctx, msg->len, iv->x, iv->len, add->x, add->len,
209 .len = msg->len };
360 iv[source_address->len + frame_counter->len] = sec_level;
439 iv[source_address->len + frame_counter->len] = sec_level;
494 TEST_EQUAL( msg->len, result->len );
511 ASSERT_COMPARE( output, tag->len, tag->x, tag->len );
[all …]
A Dtest_suite_gcm.function19 size_t n2 = input->len - n1;
24 TEST_ASSERT( n1 <= input->len );
26 TEST_EQUAL( input->len, expected_output->len );
55 ASSERT_COMPARE( output, tag->len, tag->x, tag->len );
78 TEST_EQUAL( input->len, expected_output->len );
102 ASSERT_COMPARE( output, tag->len, tag->x, tag->len );
133 ASSERT_COMPARE( output_tag, tag->len, tag->x, tag->len );
152 ASSERT_COMPARE( output, tag->len, tag->x, tag->len );
215 ASSERT_COMPARE( output, src_str->len, dst->x, dst->len );
259 …ret = mbedtls_gcm_auth_decrypt( &ctx, src_str->len, iv_str->x, iv_str->len, add_str->x, add_str->l…
[all …]
A Dtest_suite_hmac_drbg.function8 size_t len;
15 if( len > ctx->len )
18 memcpy( buf, ctx->p, len );
20 ctx->p += len;
21 ctx->len -= len;
48 entropy.len = sizeof( buf );
191 p_entropy.len = entropy->len;
198 memcpy( data + p_entropy.len, custom->x, custom->len );
200 data, p_entropy.len + custom->len ) == 0 );
238 p_entropy.len = entropy->len;
[all …]
A Dtest_suite_psa_crypto_hash.function24 input->x, input->len ) );
28 ASSERT_COMPARE( expected_hash->x, expected_hash->len,
48 input->len ) );
51 expected_hash->len ) );
67 uint32_t len = 0;
77 input->x, len ) );
80 input->x + len, input->len - len ) );
82 input->x + len, input->len - len ) );
87 ASSERT_COMPARE( expected_hash->x, expected_hash->len,
93 ASSERT_COMPARE( expected_hash->x, expected_hash->len,
[all …]
A Dtest_suite_aria.function82 ASSERT_COMPARE( output, expected_output->len,
112 ASSERT_COMPARE( output, expected_output->len,
138 ASSERT_COMPARE( output, expected_output->len,
164 ASSERT_COMPARE( output, expected_output->len,
191 ASSERT_COMPARE( output, expected_output->len,
192 expected_output->x, expected_output->len );
217 ASSERT_COMPARE( output, expected_output->len,
218 expected_output->x, expected_output->len );
243 ASSERT_COMPARE( output, expected_output->len,
244 expected_output->x, expected_output->len );
[all …]
A Dtest_suite_poly1305.function23 src_str->len, mac ) == 0 );
25 ASSERT_COMPARE( mac, expected_mac->len,
26 expected_mac->x, expected_mac->len );
39 ASSERT_COMPARE( mac, expected_mac->len,
40 expected_mac->x, expected_mac->len );
48 if( src_str->len >= 1 )
57 ASSERT_COMPARE( mac, expected_mac->len,
58 expected_mac->x, expected_mac->len );
64 if( src_str->len >= 2 )
74 ASSERT_COMPARE( mac, expected_mac->len,
[all …]
A Dtest_suite_chacha20.function22 TEST_ASSERT( src_str->len == expected_output_str->len );
23 TEST_ASSERT( key_str->len == 32U );
24 TEST_ASSERT( nonce_str->len == 12U );
31 ASSERT_COMPARE( output, expected_output_str->len,
32 expected_output_str->x, expected_output_str->len );
44 TEST_ASSERT( mbedtls_chacha20_update( &ctx, src_str->len, src_str->x, output ) == 0 );
46 ASSERT_COMPARE( output, expected_output_str->len,
47 expected_output_str->x, expected_output_str->len );
59 TEST_ASSERT( mbedtls_chacha20_update( &ctx, src_str->len - 1,
62 ASSERT_COMPARE( output, expected_output_str->len,
[all …]
A Dtest_suite_pkcs1_v21.function24 info.length = rnd_buf->len;
38 if( message_str->len == 0 )
42 &info, message_str->len,
47 ASSERT_COMPARE( output, ctx.len, result_str->x, result_str->len );
89 if( result_str->len == 0 )
135 info.length = rnd_buf->len;
167 ASSERT_COMPARE( output, ctx.len, result_str->x, result_str->len );
171 info.length = rnd_buf->len;
180 ASSERT_COMPARE( output, ctx.len, result_str->x, result_str->len );
264 memcpy( hash_result, message_str->x, message_str->len );
[all …]
/mbedtls-development/tests/src/
A Drandom.c42 size_t len ) in mbedtls_test_rnd_std_rand() argument
50 for( i = 0; i < len; ++i ) in mbedtls_test_rnd_std_rand()
56 arc4random_buf( output, len ); in mbedtls_test_rnd_std_rand()
64 size_t len ) in mbedtls_test_rnd_zero_rand() argument
69 memset( output, 0, len ); in mbedtls_test_rnd_zero_rand()
84 use_len = len; in mbedtls_test_rnd_buffer_rand()
85 if( len > info->length ) in mbedtls_test_rnd_buffer_rand()
95 if( len - use_len > 0 ) in mbedtls_test_rnd_buffer_rand()
124 while( len > 0 ) in mbedtls_test_rnd_pseudo_rand()
126 size_t use_len = ( len > 4 ) ? 4 : len; in mbedtls_test_rnd_pseudo_rand()
[all …]
A Dasn1_helpers.c34 size_t len; in mbedtls_test_asn1_skip_integer() local
37 TEST_EQUAL( mbedtls_asn1_get_tag( p, end, &len, in mbedtls_test_asn1_skip_integer()
43 TEST_ASSERT( len <= (size_t)( end - *p) ); in mbedtls_test_asn1_skip_integer()
48 if( ( len == 1 && ( *p )[0] == 0 ) || in mbedtls_test_asn1_skip_integer()
49 ( len > 1 && ( *p )[0] == 0 && ( ( *p )[1] & 0x80 ) != 0 ) ) in mbedtls_test_asn1_skip_integer()
52 --len; in mbedtls_test_asn1_skip_integer()
54 if( min_bits == 0 && len == 0 ) in mbedtls_test_asn1_skip_integer()
58 actual_bits = 8 * ( len - 1 ); in mbedtls_test_asn1_skip_integer()
67 TEST_ASSERT( ( ( *p )[len-1] & 1 ) != 0 ); in mbedtls_test_asn1_skip_integer()
68 *p += len; in mbedtls_test_asn1_skip_integer()
/mbedtls-development/programs/ssl/
A Dssl_test_common_source.c59 size_t len = 0; in nss_keylog_export() local
70 len += sprintf( nss_keylog_line + len, in nss_keylog_export()
75 len += sprintf( nss_keylog_line + len, in nss_keylog_export()
79 len += sprintf( nss_keylog_line + len, " " ); in nss_keylog_export()
83 len += sprintf( nss_keylog_line + len, in nss_keylog_export()
87 len += sprintf( nss_keylog_line + len, "\n" ); in nss_keylog_export()
88 nss_keylog_line[ len ] = '\0'; in nss_keylog_export()
104 if( fwrite( nss_keylog_line, 1, len, f ) != len ) in nss_keylog_export()
150 tmp_buf = mbedtls_calloc( 1, len ); in ssl_check_record()
153 memcpy( tmp_buf, buf, len ); in ssl_check_record()
[all …]
A Dssl_mail_client.c238 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_data()
258 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_and_get_response()
269 len = sizeof( data ) - 1; in write_ssl_and_get_response()
286 len = ret; in write_ssl_and_get_response()
287 for( i = 0; i < len; i++ ) in write_ssl_and_get_response()
316 if( len && ( ret = mbedtls_net_send( sock_fd, buf, len ) ) <= 0 ) in write_and_get_response()
324 len = sizeof( data ) - 1; in write_and_get_response()
334 data[len] = '\0'; in write_and_get_response()
336 len = ret; in write_and_get_response()
337 for( i = 0; i < len; i++ ) in write_and_get_response()
[all …]
/mbedtls-development/programs/fuzz/
A Dcommon.c29 if( len > INT_MAX ) { in dummy_send()
32 return( (int) len ); in dummy_send()
35 int fuzz_recv( void *ctx, unsigned char *buf, size_t len ) in fuzz_recv() argument
44 if( len > INT_MAX ) { in fuzz_recv()
47 if( len + biomemfuzz->Offset > biomemfuzz->Size ) { in fuzz_recv()
49 len = biomemfuzz->Size - biomemfuzz->Offset; in fuzz_recv()
51 memcpy(buf, biomemfuzz->Data + biomemfuzz->Offset, len); in fuzz_recv()
52 biomemfuzz->Offset += len; in fuzz_recv()
53 return( (int) len ); in fuzz_recv()
83 for (i=0; i<len; i++) { in dummy_entropy()
[all …]
/mbedtls-development/programs/test/
A Dudp_proxy.c239 size_t len; in get_options() local
400 size_t len; member
452 if( sizeof( buf->data ) - buf->len < len ) in ctx_buffer_append()
461 memcpy( buf->data + buf->len, data, len ); in ctx_buffer_append()
463 buf->len += len; in ctx_buffer_append()
467 return( (int) len ); in ctx_buffer_append()
505 unsigned len; member
592 if( p->len <= 13 ) in send_packet()
719 cur.len = ret; in handle_message()
909 outbuf[0].len = 0; in main()
[all …]

Completed in 54 milliseconds

12345678