/openthread-3.4.0/third_party/mbedtls/repo/tests/suites/ |
D | test_suite_camellia.function | 21 unsigned char buf[16] = { 0 }; 32 buf, 41 buf, 51 buf, buf ) ); 55 buf, buf ) ); 59 NULL, buf ) ); 63 buf, NULL ) ); 69 sizeof( buf ), 70 buf, buf, buf ) ); 74 sizeof( buf ), [all …]
|
D | test_suite_blowfish.function | 21 unsigned char buf[16] = { 0 }; 22 size_t const valid_keylength = sizeof( buf ) * 8; 33 buf, 43 buf, buf ) ); 47 buf, buf ) ); 51 NULL, buf ) ); 55 buf, NULL ) ); 61 sizeof( buf ), 62 buf, buf, buf ) ); 66 sizeof( buf ), [all …]
|
D | test_suite_pkwrite.function | 16 unsigned char buf[5000]; 22 memset( buf, 0, sizeof( buf ) ); 28 ret = mbedtls_pk_write_pubkey_pem( &key, buf, sizeof( buf )); 31 pem_len = strlen( (char *) buf ); 34 for( buf_index = pem_len; buf_index < sizeof( buf ); ++buf_index ) 36 TEST_ASSERT( buf[buf_index] == 0 ); 45 TEST_ASSERT( memcmp( (char *) buf, (char *) check_buf, ilen ) == 0 ); 56 unsigned char buf[5000]; 62 memset( buf, 0, sizeof( buf ) ); 68 ret = mbedtls_pk_write_key_pem( &key, buf, sizeof( buf )); [all …]
|
D | test_suite_ecdsa.function | 21 unsigned char buf[42] = { 0 }; 33 buf, sizeof( buf ), 38 buf, sizeof( buf ), 43 buf, sizeof( buf ), 48 buf, sizeof( buf ), 53 NULL, sizeof( buf ), 58 buf, sizeof( buf ), 64 buf, sizeof( buf ), 70 buf, sizeof( buf ), 76 buf, sizeof( buf ), [all …]
|
D | test_suite_ecdh.function | 62 unsigned char buf[42] = { 0 }; 64 size_t const buflen = sizeof( buf ); 111 mbedtls_ecdh_make_params( NULL, &olen, buf, buflen, 115 mbedtls_ecdh_make_params( &ctx, NULL, buf, buflen, 123 mbedtls_ecdh_make_params( &ctx, &olen, buf, buflen, NULL, NULL ) ); 127 (const unsigned char**) &buf, 128 buf ) ); 131 buf ) ); 133 mbedtls_ecdh_read_params( &ctx, NULL, buf ) ); 136 (const unsigned char**) &buf, [all …]
|
D | test_suite_shax.function | 18 unsigned char buf[64] = { 0 }; 19 size_t const buflen = sizeof( buf ); 30 mbedtls_sha1_update_ret( NULL, buf, buflen ) ); 35 mbedtls_sha1_finish_ret( NULL, buf ) ); 40 mbedtls_internal_sha1_process( NULL, buf ) ); 45 mbedtls_sha1_ret( NULL, buflen, buf ) ); 47 mbedtls_sha1_ret( buf, buflen, NULL ) ); 79 unsigned char buf[64] = { 0 }; 80 size_t const buflen = sizeof( buf ); 95 mbedtls_sha256_update_ret( NULL, buf, buflen ) ); [all …]
|
D | test_suite_x509write.function | 33 static int x509_crt_verifycsr( const unsigned char *buf, size_t buflen ) 42 if( mbedtls_x509_csr_parse( &csr, buf, buflen ) != 0 ) 85 unsigned char buf[4096]; 108 ret = mbedtls_x509write_csr_pem( &req, buf, sizeof( buf ), 112 pem_len = strlen( (char *) buf ); 114 for( buf_index = pem_len; buf_index < sizeof( buf ); ++buf_index ) 116 TEST_ASSERT( buf[buf_index] == 0 ); 125 TEST_ASSERT( memcmp( buf, check_buf, pem_len - 1 ) == 0 ); 127 der_len = mbedtls_x509write_csr_der( &req, buf, sizeof( buf ), 135 ret = mbedtls_x509write_csr_der( &req, buf, (size_t)( der_len - 1 ), [all …]
|
D | test_suite_pk.function | 208 unsigned char buf[1]; 234 buf, &len, 242 buf, &len, 250 buf, &len, 257 buf, sizeof( buf ), 264 buf, sizeof( buf ) ) == 271 buf, sizeof( buf ) ) == 331 unsigned char buf[1]; 332 unsigned char *p = buf; 336 void *options = buf; [all …]
|
D | test_suite_rsa.function | 28 unsigned char buf[42] = { 0 }; 88 mbedtls_rsa_public( NULL, buf, buf ) ); 90 mbedtls_rsa_public( &ctx, NULL, buf ) ); 92 mbedtls_rsa_public( &ctx, buf, NULL ) ); 96 buf, buf ) ); 99 NULL, buf ) ); 102 buf, NULL ) ); 107 sizeof( buf ), buf, 108 buf ) ); 112 sizeof( buf ), buf, [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/library/ |
D | x509write_crt.c | 139 unsigned char buf[9]; in mbedtls_x509write_crt_set_basic_constraints() local 140 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_basic_constraints() 143 memset( buf, 0, sizeof(buf) ); in mbedtls_x509write_crt_set_basic_constraints() 152 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_int( &c, buf, in mbedtls_x509write_crt_set_basic_constraints() 155 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_bool( &c, buf, 1 ) ); in mbedtls_x509write_crt_set_basic_constraints() 158 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_x509write_crt_set_basic_constraints() 159 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, in mbedtls_x509write_crt_set_basic_constraints() 166 is_ca, buf + sizeof(buf) - len, len ) ); in mbedtls_x509write_crt_set_basic_constraints() 173 unsigned char buf[MBEDTLS_MPI_MAX_SIZE * 2 + 20]; /* tag, length + 2xMPI */ in mbedtls_x509write_crt_set_subject_key_identifier() local 174 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_subject_key_identifier() [all …]
|
D | x509write_csr.c | 94 unsigned char buf[4] = {0}; in mbedtls_x509write_csr_set_key_usage() local 98 c = buf + 4; in mbedtls_x509write_csr_set_key_usage() 100 ret = mbedtls_asn1_write_named_bitstring( &c, buf, &key_usage, 8 ); in mbedtls_x509write_csr_set_key_usage() 116 unsigned char buf[4] = {0}; in mbedtls_x509write_csr_set_ns_cert_type() local 120 c = buf + 4; in mbedtls_x509write_csr_set_ns_cert_type() 122 ret = mbedtls_asn1_write_named_bitstring( &c, buf, &ns_cert_type, 8 ); in mbedtls_x509write_csr_set_ns_cert_type() 136 unsigned char *buf, in x509write_csr_der_internal() argument 157 c = buf + size; in x509write_csr_der_internal() 159 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_x509_write_extensions( &c, buf, in x509write_csr_der_internal() 164 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in x509write_csr_der_internal() [all …]
|
D | pkwrite.c | 116 unsigned char buf[MBEDTLS_ECP_MAX_PT_LEN]; in pk_write_ec_pubkey() local 120 &len, buf, sizeof( buf ) ) ) != 0 ) in pk_write_ec_pubkey() 129 memcpy( *p, buf, len ); in pk_write_ec_pubkey() 225 int mbedtls_pk_write_pubkey_der( mbedtls_pk_context *key, unsigned char *buf, size_t size ) in mbedtls_pk_write_pubkey_der() argument 236 PK_VALIDATE_RET( buf != NULL ); in mbedtls_pk_write_pubkey_der() 238 c = buf + size; in mbedtls_pk_write_pubkey_der() 240 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_pk_write_pubkey( &c, buf, key ) ); in mbedtls_pk_write_pubkey_der() 242 if( c - buf < 1 ) in mbedtls_pk_write_pubkey_der() 253 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_pk_write_pubkey_der() 254 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_BIT_STRING ) ); in mbedtls_pk_write_pubkey_der() [all …]
|
D | entropy.c | 264 unsigned char buf[MBEDTLS_ENTROPY_MAX_GATHER]; in entropy_gather_internal() local 280 buf, MBEDTLS_ENTROPY_MAX_GATHER, &olen ) ) != 0 ) in entropy_gather_internal() 291 buf, olen ) ) != 0 ) in entropy_gather_internal() 301 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in entropy_gather_internal() 333 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_func() local 381 memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_func() 389 if( ( ret = mbedtls_sha512_finish_ret( &ctx->accumulator, buf ) ) != 0 ) in mbedtls_entropy_func() 399 if( ( ret = mbedtls_sha512_update_ret( &ctx->accumulator, buf, in mbedtls_entropy_func() 406 if( ( ret = mbedtls_sha512_ret( buf, MBEDTLS_ENTROPY_BLOCK_SIZE, in mbedtls_entropy_func() 407 buf, 0 ) ) != 0 ) in mbedtls_entropy_func() [all …]
|
D | pem.c | 139 unsigned char *buf, size_t buflen, in pem_des_decrypt() argument 154 des_iv, buf, buf ); in pem_des_decrypt() 167 unsigned char *buf, size_t buflen, in pem_des3_decrypt() argument 182 des3_iv, buf, buf ); in pem_des3_decrypt() 197 unsigned char *buf, size_t buflen, in pem_aes_decrypt() argument 212 aes_iv, buf, buf ); in pem_aes_decrypt() 231 unsigned char *buf; in mbedtls_pem_read_buffer() local 348 if( ( buf = mbedtls_calloc( 1, len ) ) == NULL ) in mbedtls_pem_read_buffer() 351 if( ( ret = mbedtls_base64_decode( buf, len, &len, s1, s2 - s1 ) ) != 0 ) in mbedtls_pem_read_buffer() 353 mbedtls_platform_zeroize( buf, len ); in mbedtls_pem_read_buffer() [all …]
|
D | ecdh.c | 298 unsigned char *buf, size_t blen, in ecdh_make_params_internal() argument 332 if( ( ret = mbedtls_ecp_tls_write_group( &ctx->grp, &grp_len, buf, in ecdh_make_params_internal() 336 buf += grp_len; in ecdh_make_params_internal() 340 &pt_len, buf, blen ) ) != 0 ) in ecdh_make_params_internal() 355 unsigned char *buf, size_t blen, in mbedtls_ecdh_make_params() argument 362 ECDH_VALIDATE_RET( buf != NULL ); in mbedtls_ecdh_make_params() 372 return( ecdh_make_params_internal( ctx, olen, ctx->point_format, buf, blen, in mbedtls_ecdh_make_params() 380 buf, blen, f_rng, p_rng ) ); in mbedtls_ecdh_make_params() 384 ctx->point_format, buf, blen, in mbedtls_ecdh_make_params() 394 const unsigned char **buf, in ecdh_read_params_internal() argument [all …]
|
/openthread-3.4.0/third_party/tcplp/lib/ |
D | bitmap.c | 39 void bmp_init(uint8_t* buf, size_t numbytes) { in bmp_init() argument 40 memset(buf, 0x00, numbytes); in bmp_init() 43 #define _bmp_getrangeinfo(buf, start, len, first_bit_id, first_byte_ptr, last_bit_id, last_byte_ptr… argument 46 first_byte_ptr = buf + (start >> 3); \ 52 void bmp_setrange(uint8_t* buf, size_t start, size_t len) { in bmp_setrange() argument 58 _bmp_getrangeinfo(buf, start, len, first_bit_id, first_byte_set, in bmp_setrange() 76 void bmp_clrrange(uint8_t* buf, size_t start, size_t len) { in bmp_clrrange() argument 82 _bmp_getrangeinfo(buf, start, len, first_bit_id, first_byte_clear, in bmp_clrrange() 100 size_t bmp_countset(uint8_t* buf, size_t buflen, size_t start, size_t limit) { in bmp_countset() argument 108 first_byte = *(buf + curr_index); in bmp_countset() [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/3rdparty/everest/library/ |
D | x25519.c | 60 unsigned char *buf, size_t blen, in mbedtls_x25519_make_params() argument 75 *buf++ = MBEDTLS_ECP_TLS_NAMED_CURVE; in mbedtls_x25519_make_params() 76 *buf++ = MBEDTLS_ECP_TLS_CURVE25519 >> 8; in mbedtls_x25519_make_params() 77 *buf++ = MBEDTLS_ECP_TLS_CURVE25519 & 0xFF; in mbedtls_x25519_make_params() 78 *buf++ = MBEDTLS_X25519_KEY_SIZE_BYTES; in mbedtls_x25519_make_params() 81 Hacl_Curve25519_crypto_scalarmult( buf, ctx->our_secret, base ); in mbedtls_x25519_make_params() 84 if( memcmp( buf, base, MBEDTLS_X25519_KEY_SIZE_BYTES) == 0 ) in mbedtls_x25519_make_params() 91 const unsigned char **buf, const unsigned char *end ) in mbedtls_x25519_read_params() argument 93 if( end - *buf < MBEDTLS_X25519_KEY_SIZE_BYTES + 1 ) in mbedtls_x25519_read_params() 96 if( ( *(*buf)++ != MBEDTLS_X25519_KEY_SIZE_BYTES ) ) in mbedtls_x25519_read_params() [all …]
|
D | everest.c | 54 unsigned char *buf, size_t blen, in mbedtls_everest_make_params() argument 59 return mbedtls_x25519_make_params( x25519_ctx, olen, buf, blen, f_rng, p_rng ); in mbedtls_everest_make_params() 63 const unsigned char **buf, in mbedtls_everest_read_params() argument 67 return mbedtls_x25519_read_params( x25519_ctx, buf, end ); in mbedtls_everest_read_params() 82 unsigned char *buf, size_t blen, in mbedtls_everest_make_public() argument 87 return mbedtls_x25519_make_public( x25519_ctx, olen, buf, blen, f_rng, p_rng ); in mbedtls_everest_make_public() 91 const unsigned char *buf, size_t blen ) in mbedtls_everest_read_public() argument 94 return mbedtls_x25519_read_public ( x25519_ctx, buf, blen ); in mbedtls_everest_read_public() 98 unsigned char *buf, size_t blen, in mbedtls_everest_calc_secret() argument 103 return mbedtls_x25519_calc_secret( x25519_ctx, olen, buf, blen, f_rng, p_rng ); in mbedtls_everest_calc_secret()
|
/openthread-3.4.0/third_party/mbedtls/repo/programs/pkey/ |
D | dh_client.c | 84 unsigned char buf[2048]; in main() local 162 memset( buf, 0, sizeof( buf ) ); in main() 164 if( ( ret = mbedtls_net_recv( &server_fd, buf, 2 ) ) != 2 ) in main() 170 n = buflen = ( buf[0] << 8 ) | buf[1]; in main() 171 if( buflen < 1 || buflen > sizeof( buf ) ) in main() 180 memset( buf, 0, sizeof( buf ) ); in main() 182 if( ( ret = mbedtls_net_recv( &server_fd, buf, n ) ) != (int) n ) in main() 188 p = buf, end = buf + buflen; in main() 217 if( ( ret = mbedtls_sha1_ret( buf, (int)( p - 2 - buf ), hash ) ) != 0 ) in main() 237 if( ( ret = mbedtls_dhm_make_public( &dhm, (int) dhm.len, buf, n, in main() [all …]
|
D | dh_server.c | 83 unsigned char buf[2048]; in main() local 211 memset( buf, 0, sizeof( buf ) ); in main() 213 if( ( ret = mbedtls_dhm_make_params( &dhm, (int) mbedtls_mpi_size( &dhm.P ), buf, &n, in main() 223 if( ( ret = mbedtls_sha1_ret( buf, n, hash ) ) != 0 ) in main() 229 buf[n ] = (unsigned char)( rsa.len >> 8 ); in main() 230 buf[n + 1] = (unsigned char)( rsa.len ); in main() 233 0, hash, buf + n + 2 ) ) != 0 ) in main() 244 ( ret = mbedtls_net_send( &client_fd, buf, buflen ) ) != (int) buflen ) in main() 256 memset( buf, 0, sizeof( buf ) ); in main() 259 if( ( ret = mbedtls_net_recv( &client_fd, buf, n ) ) != (int) n ) in main() [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/programs/test/ |
D | benchmark.c | 284 unsigned char buf[BUFSIZE]; variable 402 memset( buf, 0xAA, sizeof( buf ) ); in main() 407 TIME_AND_TSC( "MD4", mbedtls_md4_ret( buf, BUFSIZE, tmp ) ); in main() 412 TIME_AND_TSC( "MD5", mbedtls_md5_ret( buf, BUFSIZE, tmp ) ); in main() 417 TIME_AND_TSC( "RIPEMD160", mbedtls_ripemd160_ret( buf, BUFSIZE, tmp ) ); in main() 422 TIME_AND_TSC( "SHA-1", mbedtls_sha1_ret( buf, BUFSIZE, tmp ) ); in main() 427 TIME_AND_TSC( "SHA-256", mbedtls_sha256_ret( buf, BUFSIZE, tmp, 0 ) ); in main() 432 TIME_AND_TSC( "SHA-512", mbedtls_sha512_ret( buf, BUFSIZE, tmp, 0 ) ); in main() 441 TIME_AND_TSC( "ARC4", mbedtls_arc4_crypt( &arc4, BUFSIZE, buf, buf ) ); in main() 455 mbedtls_des3_crypt_cbc( &des3, MBEDTLS_DES_ENCRYPT, BUFSIZE, tmp, buf, buf ) ); in main() [all …]
|
D | udp_proxy.c | 242 char *buf; in get_options() local 263 buf = mbedtls_calloc( 1, len + 1 ); in get_options() 264 if( buf == NULL ) in get_options() 269 memcpy( buf, q, len + 1 ); in get_options() 271 delay_list[ (*delay_cnt)++ ] = buf; in get_options() 408 static int ctx_buffer_flush( ctx_buffer *buf ) in ctx_buffer_flush() argument 413 ellapsed_time(), buf->description, in ctx_buffer_flush() 414 (unsigned) buf->len, buf->num_datagrams, in ctx_buffer_flush() 415 ellapsed_time() - buf->packet_lifetime ); in ctx_buffer_flush() 417 ret = mbedtls_net_send( buf->ctx, buf->data, buf->len ); in ctx_buffer_flush() [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/programs/ssl/ |
D | ssl_mail_client.c | 179 unsigned char buf[1024]; in do_handshake() local 180 memset(buf, 0, 1024); in do_handshake() 193 mbedtls_strerror( ret, (char *) buf, 1024 ); in do_handshake() 195 mbedtls_printf( " failed\n ! mbedtls_ssl_handshake returned %d: %s\n\n", ret, buf ); in do_handshake() 223 mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ", in do_handshake() 225 mbedtls_printf( "%s\n", buf ); in do_handshake() 230 static int write_ssl_data( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ) in write_ssl_data() argument 234 mbedtls_printf("\n%s", buf); in write_ssl_data() 235 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_data() 247 static int write_ssl_and_get_response( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ) in write_ssl_and_get_response() argument [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/programs/util/ |
D | pem2der.c | 123 static int load_file( const char *path, unsigned char **buf, size_t *n ) in load_file() argument 142 ( *buf = mbedtls_calloc( 1, *n + 1 ) ) == NULL ) in load_file() 148 if( fread( *buf, 1, *n, f ) != *n ) in load_file() 151 free( *buf ); in load_file() 152 *buf = NULL; in load_file() 158 (*buf)[*n] = '\0'; in load_file() 166 static int write_file( const char *path, unsigned char *buf, size_t n ) in write_file() argument 173 if( fwrite( buf, 1, n, f ) != n ) in write_file() 189 char buf[1024]; in main() local 197 memset( buf, 0, sizeof(buf) ); in main() [all …]
|
/openthread-3.4.0/third_party/mbedtls/repo/programs/x509/ |
D | cert_write.c | 224 char buf[1024]; in main() local 251 memset( buf, 0, 1024 ); in main() 479 mbedtls_strerror( ret, buf, 1024 ); in main() 481 ret, buf ); in main() 494 mbedtls_strerror( ret, buf, 1024 ); in main() 496 "returned -0x%04x - %s\n\n", (unsigned int) -ret, buf ); in main() 514 mbedtls_strerror( ret, buf, 1024 ); in main() 516 "returned -0x%04x - %s\n\n", (unsigned int) -ret, buf ); in main() 524 mbedtls_strerror( ret, buf, 1024 ); in main() 526 "returned -0x%04x - %s\n\n", (unsigned int) -ret, buf ); in main() [all …]
|