/mbedtls-development/library/ |
A D | common.h | 114 #define MBEDTLS_PUT_UINT32_BE( n, data, offset ) \ argument 116 ( data )[( offset ) ] = MBEDTLS_BYTE_3( n ); \ 117 ( data )[( offset ) + 1] = MBEDTLS_BYTE_2( n ); \ 118 ( data )[( offset ) + 2] = MBEDTLS_BYTE_1( n ); \ 119 ( data )[( offset ) + 3] = MBEDTLS_BYTE_0( n ); \ 152 #define MBEDTLS_PUT_UINT32_LE( n, data, offset ) \ argument 154 ( data )[( offset ) ] = MBEDTLS_BYTE_0( n ); \ 155 ( data )[( offset ) + 1] = MBEDTLS_BYTE_1( n ); \ 156 ( data )[( offset ) + 2] = MBEDTLS_BYTE_2( n ); \ 157 ( data )[( offset ) + 3] = MBEDTLS_BYTE_3( n ); \ [all …]
|
A D | platform.c | 39 ((void) n); in platform_calloc_uninit() 104 ((void) n); in platform_snprintf_uninit() 112 int (*mbedtls_snprintf)( char * s, size_t n, 138 ret = vsnprintf( s, n, fmt, arg ); in mbedtls_platform_win32_vsnprintf() 139 if( ret < 0 || (size_t) ret == n ) in mbedtls_platform_win32_vsnprintf() 141 s[n-1] = '\0'; in mbedtls_platform_win32_vsnprintf() 159 ((void) n); in platform_vsnprintf_uninit() 286 size_t n; in mbedtls_platform_std_nv_seed_read() local 299 return( (int)n ); in mbedtls_platform_std_nv_seed_read() 305 size_t n; in mbedtls_platform_std_nv_seed_write() local [all …]
|
A D | bignum.c | 1472 for( n = B->n; n > 0; n-- ) in mbedtls_mpi_sub_abs() 1475 if( n > A->n ) in mbedtls_mpi_sub_abs() 1487 if( A->n > n ) in mbedtls_mpi_sub_abs() 1488 memcpy( X->p + n, A->p + n, ( A->n - n ) * ciL ); in mbedtls_mpi_sub_abs() 1489 if( X->n > A->n ) in mbedtls_mpi_sub_abs() 1496 for( ; n < X->n && X->p[n] == 0; n++ ) in mbedtls_mpi_sub_abs() 1770 size_t n = A->n; in mbedtls_mpi_mul_int() local 1948 n = X.n - 1; in mbedtls_mpi_div_mpi() 2175 n = N->n; in mpi_montmul() 2176 m = ( B->n < n ) ? B->n : n; in mpi_montmul() [all …]
|
A D | base64.c | 82 size_t i, n; in mbedtls_base64_encode() local 100 n *= 4; in mbedtls_base64_encode() 104 *olen = n + 1; in mbedtls_base64_encode() 108 n = ( slen / 3 ) * 3; in mbedtls_base64_encode() 190 for( i = n = 0; i < slen; i++ ) in mbedtls_base64_decode() 230 n++; in mbedtls_base64_decode() 233 if( n == 0 ) in mbedtls_base64_decode() 243 n = ( 6 * ( n >> 3 ) ) + ( ( 6 * ( n & 0x7 ) + 7 ) >> 3 ); in mbedtls_base64_decode() 244 n -= equals; in mbedtls_base64_decode() 246 if( dst == NULL || dlen < n ) in mbedtls_base64_decode() [all …]
|
A D | camellia.c | 84 #define SBOX1(n) FSb[(n)] argument 85 #define SBOX2(n) (unsigned char)((FSb[(n)] >> 7 ^ FSb[(n)] << 1) & 0xff) argument 86 #define SBOX3(n) (unsigned char)((FSb[(n)] >> 1 ^ FSb[(n)] << 7) & 0xff) argument 87 #define SBOX4(n) FSb[((n) << 1 ^ (n) >> 7) &0xff] argument 171 #define SBOX1(n) FSb[(n)] argument 172 #define SBOX2(n) FSb2[(n)] argument 173 #define SBOX3(n) FSb3[(n)] argument 174 #define SBOX4(n) FSb4[(n)] argument 637 n = ( n + 1 ) & 0x0F; in mbedtls_camellia_crypt_cfb128() 649 n = ( n + 1 ) & 0x0F; in mbedtls_camellia_crypt_cfb128() [all …]
|
A D | psa_its_file.c | 97 size_t n; in psa_its_read_file() local 106 if( n != sizeof( header ) ) in psa_its_read_file() 142 size_t n; in psa_its_get() local 169 n = fread( p_data, 1, data_length, stream ); in psa_its_get() 170 if( n != data_length ) in psa_its_get() 174 *p_data_length = n; in psa_its_get() 191 size_t n; in psa_its_set() local 203 n = fwrite( &header, 1, sizeof( header ), stream ); in psa_its_set() 204 if( n != sizeof( header ) ) in psa_its_set() 208 n = fwrite( p_data, 1, data_length, stream ); in psa_its_set() [all …]
|
A D | dhm.c | 70 int ret, n; in dhm_read_bignum() local 75 n = ( (*p)[0] << 8 ) | (*p)[1]; in dhm_read_bignum() 78 if( (int)( end - *p ) < n ) in dhm_read_bignum() 84 (*p) += n; in dhm_read_bignum() 632 *n = (size_t) size; in load_file() 634 if( *n + 1 == 0 || in load_file() 641 if( fread( *buf, 1, *n, f ) != *n ) in load_file() 653 (*buf)[*n] = '\0'; in load_file() 656 ++*n; in load_file() 667 size_t n; in mbedtls_dhm_parse_dhmfile() local [all …]
|
A D | x509_csr.c | 311 size_t n; in mbedtls_x509_csr_parse_file() local 314 if( ( ret = mbedtls_pk_load_file( path, &buf, &n ) ) != 0 ) in mbedtls_x509_csr_parse_file() 317 ret = mbedtls_x509_csr_parse( csr, buf, n ); in mbedtls_x509_csr_parse_file() 319 mbedtls_platform_zeroize( buf, n ); in mbedtls_x509_csr_parse_file() 336 size_t n; in mbedtls_x509_csr_info() local 341 n = size; in mbedtls_x509_csr_info() 343 ret = mbedtls_snprintf( p, n, "%sCSR version : %d", in mbedtls_x509_csr_info() 347 ret = mbedtls_snprintf( p, n, "\n%ssubject name : ", prefix ); in mbedtls_x509_csr_info() 349 ret = mbedtls_x509_dn_gets( p, n, &csr->subject ); in mbedtls_x509_csr_info() 352 ret = mbedtls_snprintf( p, n, "\n%ssigned using : ", prefix ); in mbedtls_x509_csr_info() [all …]
|
A D | aria.c | 661 size_t n; in mbedtls_aria_crypt_cfb128() local 671 n = *iv_off; in mbedtls_aria_crypt_cfb128() 688 iv[n] = c; in mbedtls_aria_crypt_cfb128() 690 n = ( n + 1 ) & 0x0F; in mbedtls_aria_crypt_cfb128() 700 iv[n] = *output++ = (unsigned char)( iv[n] ^ *input++ ); in mbedtls_aria_crypt_cfb128() 702 n = ( n + 1 ) & 0x0F; in mbedtls_aria_crypt_cfb128() 706 *iv_off = n; in mbedtls_aria_crypt_cfb128() 725 size_t n; in mbedtls_aria_crypt_ctr() local 734 n = *nc_off; in mbedtls_aria_crypt_ctr() 754 n = ( n + 1 ) & 0x0F; in mbedtls_aria_crypt_ctr() [all …]
|
A D | x509_crl.c | 602 size_t n; in mbedtls_x509_crl_parse_file() local 608 ret = mbedtls_x509_crl_parse( chain, buf, n ); in mbedtls_x509_crl_parse_file() 610 mbedtls_platform_zeroize( buf, n ); in mbedtls_x509_crl_parse_file() 630 size_t n; in mbedtls_x509_crl_info() local 635 n = size; in mbedtls_x509_crl_info() 637 ret = mbedtls_snprintf( p, n, "%sCRL version : %d", in mbedtls_x509_crl_info() 643 ret = mbedtls_x509_dn_gets( p, n, &crl->issuer ); in mbedtls_x509_crl_info() 646 ret = mbedtls_snprintf( p, n, "\n%sthis update : " \ in mbedtls_x509_crl_info() 653 ret = mbedtls_snprintf( p, n, "\n%snext update : " \ in mbedtls_x509_crl_info() 692 ret = mbedtls_snprintf( p, n, "\n" ); in mbedtls_x509_crl_info() [all …]
|
A D | net_sockets.c | 224 int n, ret; in mbedtls_net_bind() local 253 n = 1; in mbedtls_net_bind() 255 (const char *) &n, sizeof( n ) ) != 0 ) in mbedtls_net_bind() 351 socklen_t n = (socklen_t) sizeof( client_addr ); in mbedtls_net_accept() local 354 int n = (int) sizeof( client_addr ); in mbedtls_net_accept() local 378 (struct sockaddr *) &client_addr, &n ); in mbedtls_net_accept() 411 n = sizeof( struct sockaddr_storage ); in mbedtls_net_accept() 462 u_long n = 0; in mbedtls_net_set_block() local 463 return( ioctlsocket( ctx->fd, FIONBIO, &n ) ); in mbedtls_net_set_block() 473 u_long n = 1; in mbedtls_net_set_nonblock() local [all …]
|
A D | x509_crt.c | 1548 size_t n; in mbedtls_x509_crt_parse_file() local 1839 size_t n = *size; in x509_info_subject_alt_name() local 1940 *size = n; in x509_info_subject_alt_name() 1961 size_t n = *size; in x509_info_cert_type() local 1974 *size = n; in x509_info_cert_type() 2002 *size = n; in x509_info_key_usage() 2031 *size = n; in x509_info_ext_key_usage() 2060 *size = n; in x509_info_cert_policies() 2075 size_t n; in mbedtls_x509_crt_info() local 2080 n = size; in mbedtls_x509_crt_info() [all …]
|
A D | hkdf.c | 85 size_t n; in mbedtls_hkdf_expand() local 110 n = okm_len / hash_len; in mbedtls_hkdf_expand() 114 n++; in mbedtls_hkdf_expand() 121 if( n > 255 ) in mbedtls_hkdf_expand() 139 for( i = 1; i <= n; i++ ) in mbedtls_hkdf_expand() 176 num_to_copy = i != n ? hash_len : okm_len - where; in mbedtls_hkdf_expand()
|
A D | x509.c | 485 for( ; n > 0; --n ) in x509_parse_int() 744 size_t i, n; in mbedtls_x509_dn_gets() local 754 n = size; in mbedtls_x509_dn_gets() 796 return( (int) ( size - n ) ); in mbedtls_x509_dn_gets() 806 size_t i, n, nr; in mbedtls_x509_serial_gets() local 810 n = size; in mbedtls_x509_serial_gets() 820 ret = mbedtls_snprintf( p, n, "%02X%s", in mbedtls_x509_serial_gets() 831 return( (int) ( size - n ) ); in mbedtls_x509_serial_gets() 844 size_t n = size; in mbedtls_x509_sig_alg_gets() local 877 return( (int)( size - n ) ); in mbedtls_x509_sig_alg_gets() [all …]
|
/mbedtls-development/tests/suites/ |
A D | test_suite_pem.data | 2 …n":"-----END TEST-----\n":"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F":"----… 5 …_pem_write_buffer:"-----START TEST-----\n":"-----END TEST-----\n":"":"-----START TEST-----\n-----E… 8 …_write_buffer:"-----START TEST-----\n":"-----END TEST-----\n":"00":"-----START TEST-----\nAA==\n--… 11 …n":"-----END TEST-----\n":"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F0001020… 14 …n":"-----END TEST-----\n":"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F0001020… 17 …n":"-----END TEST-----\n":"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F0001020… 30 … KEY-----\nProc-Type\: 4,ENCRYPTED\nDEK-Info\: DES-CBC,AA94892A169FA426\n\nMAAA\n-----END EC PRIVA… 34 …----\nProc-Type\: 4,ENCRYPTED\nDEK-Info\: DES-EDE3-CBC,AA94892A169FA426\n\nMAAA\n-----END EC PRIVA… 38 …\: 4,ENCRYPTED\nDEK-Info\: AES-128-CBC,AA94892A169FA426AA94892A169FA426\n\nMAAA\n-----END EC PRIVA…
|
A D | host_test.function | 88 "Usage: %s [OPTIONS] files...\n\n" \ 89 " Command line arguments:\n" \ 93 " %s\n\n" \ 94 " Options:\n" \ 96 " -h | --help Display this information\n\n", \ 142 if( ret-- > buf && *ret == '\n' ) 202 *( q++ ) = '\n'; 344 if( n >= sizeof( buf ) ) 347 if( ret < 0 || (size_t) ret >= n ) 352 memcmp( buf + n, ref + n, sizeof( buf ) - n ) != 0 ) [all …]
|
A D | test_suite_debug.data | 2 debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n" 5 debug_print_msg_threshold:1:1:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n" 17 …_ret:"MyFile":999:"Test return value":0:"MyFile(0999)\: Test return value() returned 0 (-0x0000)\n" 20 …le":999:"Test return value":-0x1000:"MyFile(0999)\: Test return value() returned -4096 (-0x1000)\n" 23 …e":999:"Test return value":-0xFFFF:"MyFile(0999)\: Test return value() returned -65535 (-0xffff)\n" 26 …nt_buf:"MyFile":999:"Test return value":"":"MyFile(0999)\: dumping 'Test return value' (0 bytes)\n" 29 …turn value' (1 bytes)\nMyFile(0999)\: 0000\: 00 .\n" 41 …pi:16:"":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (0 bits) is\:\nMyFile(0999)\: 00\n" 44 …0000000":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (0 bits) is\:\nMyFile(0999)\: 00\n" 47 …0000007":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (3 bits) is\:\nMyFile(0999)\: 07\n" [all …]
|
A D | test_suite_psa_crypto_metadata.function | 297 size_t n; 307 for( n = 1; n <= length; n++ ) 311 key_type, key_bits, n ); 339 for( n = 1; n <= length; n++ ) 343 key_type, key_bits, n ); 381 size_t n; 392 for( n = 1; n <= length; n++ ) 426 size_t n; 434 for( n = 1; n <= tag_length; n++ ) 438 key_type, key_bits, n ); [all …]
|
/mbedtls-development/programs/pkey/ |
A D | dh_client.c | 76 size_t n, buflen; in main() local 165 n = buflen = ( buf[0] << 8 ) | buf[1]; in main() 177 if( ( ret = mbedtls_net_recv( &server_fd, buf, n ) ) != (int) n ) in main() 191 n = mbedtls_dhm_get_len( &dhm ); in main() 192 if( n < 64 || n > 512 ) in main() 207 if( ( n = (size_t) ( end - p ) ) != rsa.MBEDTLS_PRIVATE(len) ) in main() 232 n = mbedtls_dhm_get_len( &dhm ); in main() 233 if( ( ret = mbedtls_dhm_make_public( &dhm, (int) n, buf, n, in main() 240 if( ( ret = mbedtls_net_send( &server_fd, buf, n ) ) != (int) n ) in main() 259 for( n = 0; n < 16; n++ ) in main() [all …]
|
A D | dh_server.c | 76 size_t n, buflen; in main() local 218 if( ( ret = mbedtls_sha1( buf, n, hash ) ) != 0 ) in main() 224 buf[n ] = (unsigned char)( rsa.MBEDTLS_PRIVATE(len) >> 8 ); in main() 225 buf[n + 1] = (unsigned char)( rsa.MBEDTLS_PRIVATE(len) ); in main() 228 32, hash, buf + n + 2 ) ) != 0 ) in main() 234 buflen = n + 2 + rsa.MBEDTLS_PRIVATE(len); in main() 253 n = mbedtls_dhm_get_len( &dhm ); in main() 254 if( ( ret = mbedtls_net_recv( &client_fd, buf, n ) ) != (int) n ) in main() 260 if( ( ret = mbedtls_dhm_read_public( &dhm, buf, n ) ) != 0 ) in main() 279 for( n = 0; n < 16; n++ ) in main() [all …]
|
/mbedtls-development/programs/hash/ |
A D | generic_sum.c | 81 size_t n; in generic_check() local 105 n = sizeof( line ); in generic_check() 107 while( fgets( line, (int) n - 1, f ) != NULL ) in generic_check() 109 n = strlen( line ); in generic_check() 111 if( n < (size_t) 2 * mbedtls_md_get_size( md_info ) + 4 ) in generic_check() 123 if( line[n - 1] == '\n' ) { n--; line[n] = '\0'; } in generic_check() 124 if( line[n - 1] == '\r' ) { n--; line[n] = '\0'; } in generic_check() 150 n = sizeof( line ); in generic_check()
|
/mbedtls-development/programs/util/ |
A D | pem2der.c | 119 static int load_file( const char *path, unsigned char **buf, size_t *n ) in load_file() argument 135 *n = (size_t) size; in load_file() 137 if( *n + 1 == 0 || in load_file() 138 ( *buf = mbedtls_calloc( 1, *n + 1 ) ) == NULL ) in load_file() 144 if( fread( *buf, 1, *n, f ) != *n ) in load_file() 154 (*buf)[*n] = '\0'; in load_file() 162 static int write_file( const char *path, unsigned char *buf, size_t n ) in write_file() argument 169 if( fwrite( buf, 1, n, f ) != n ) in write_file()
|
/mbedtls-development/tests/include/test/ |
A D | macros.h | 247 #define GET_UINT32_BE(n,b,i) \ argument 249 (n) = ( (uint32_t) (b)[(i) ] << 24 ) \ 257 #define PUT_UINT32_BE(n,b,i) \ argument 259 (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ 260 (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ 261 (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ 262 (b)[(i) + 3] = (unsigned char) ( (n) ); \
|
/mbedtls-development/include/mbedtls/ |
A D | platform.h | 135 extern void *mbedtls_calloc( size_t n, size_t size ); 217 int mbedtls_platform_win32_snprintf( char *s, size_t n, const char *fmt, ... ); 221 extern int (*mbedtls_snprintf)( char * s, size_t n, const char * format, ... ); 231 int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n, 253 int mbedtls_platform_win32_vsnprintf( char *s, size_t n, const char *fmt, va_list arg ); 258 extern int (*mbedtls_vsnprintf)( char * s, size_t n, const char * format, va_list arg ); 267 int mbedtls_platform_set_vsnprintf( int (*vsnprintf_func)( char * s, size_t n,
|
/mbedtls-development/programs/psa/ |
A D | psa_constant_names.c | 29 int snprintf( char *s, size_t n, const char *fmt, ... ) in snprintf() argument 35 if( s == NULL || n == 0 || fmt == NULL ) in snprintf() 40 ret = _vsnprintf_s( s, n, _TRUNCATE, fmt, argp ); in snprintf() 42 ret = _vsnprintf( s, n, fmt, argp ); in snprintf() 43 if( ret < 0 || (size_t) ret == n ) in snprintf() 45 s[n-1] = '\0'; in snprintf() 71 size_t n = snprintf(*buffer, buffer_size - *required_size, format, value); in append_integer() local 72 if (n < buffer_size - *required_size) *buffer += n; in append_integer() 73 *required_size += n; in append_integer()
|