Home
last modified time | relevance | path

Searched refs:n (Results 1 – 25 of 117) sorted by relevance

12345

/net-tools-3.7.0/tinydtls-0.8.2/tests/
Dccm-test.c22 int n; in fls() local
23 for (n = 0; i; n++) in fls()
25 return n; in fls()
51 int n; local
59 for (n = 0; n < sizeof(data)/sizeof(struct test_vector); ++n) {
61 if (rijndael_set_key_enc_only(&ctx, data[n].key, 8*sizeof(data[n].key)) < 0) {
66 len = dtls_ccm_encrypt_message(&ctx, data[n].M, data[n].L, data[n].nonce,
67 data[n].msg + data[n].la,
68 data[n].lm - data[n].la,
69 data[n].msg, data[n].la);
[all …]
/net-tools-3.7.0/tinydtls-0.8.2/ecc/
Decc.c163 uint8_t k, n; in fieldMult() local
166 for (n = 0; n < length; n++){ in fieldMult()
167 l = (uint64_t)x[n]*(uint64_t)y[k]; in fieldMult()
168 temp[n+k] = l&0xFFFFFFFF; in fieldMult()
169 temp[n+k+1] = l>>32; in fieldMult()
170 add(&temp[n+k], &result[n+k], &result[n+k], (length * 2) - (n + k)); in fieldMult()
184 uint8_t n; in fieldModP() local
191 for(n=0;n<3;n++) tempm[n]=0; in fieldModP()
192 for(n=3;n<8;n++) tempm[n]=B[n+8]; in fieldModP()
199 for(n=0;n<3;n++) tempm[n]=0; in fieldModP()
[all …]
Dtest_helper.c45 int n; in ecc_printNumber() local
47 for(n = numberLength - 1; n >= 0; n--){ in ecc_printNumber()
48 printf("%08x", x[n]); in ecc_printNumber()
/net-tools-3.7.0/mbedtls-2.4.0/tests/suites/
Dtest_suite_pem.data2n":"-----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--…
11n":"-----END TEST-----\n":"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F0001020…
14n":"-----END TEST-----\n":"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F0001020…
17n":"-----END TEST-----\n":"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F0001020…
Dmain_test.function11 "Expected string (with \"\") for parameter and got: %s\n", *str );
65 "Expected integer for parameter and got: %s\n", str );
109 "FAILED\nSkipping unknown test function '%s'\n",
127 "Usage: %s [OPTIONS] files...\n\n" \
128 " Command line arguments:\n" \
129 " files... One or more test data file. If no file is specified\n" \
130 " the followimg default test case is used:\n" \
131 " %s\n\n" \
132 " Options:\n" \
133 " -v | --verbose Display full information about each test\n" \
[all …]
/net-tools-3.7.0/libcoap/src/
Dencode.c18 int n; in coap_fls() local
19 for (n = 0; i; n++) in coap_fls()
21 return n; in coap_fls()
26 unsigned int i, n = 0; in coap_decode_var_bytes() local
28 n = (n << 8) + buf[i]; in coap_decode_var_bytes()
30 return n; in coap_decode_var_bytes()
35 unsigned int n, i; in coap_encode_var_bytes() local
37 for (n = 0, i = val; i && n < sizeof(val); ++n) in coap_encode_var_bytes()
40 i = n; in coap_encode_var_bytes()
46 return n; in coap_encode_var_bytes()
/net-tools-3.7.0/mbedtls-2.4.0/library/
Dbase64.c80 size_t i, n; in mbedtls_base64_encode() local
90 n = slen / 3 + ( slen % 3 != 0 ); in mbedtls_base64_encode()
92 if( n > ( BASE64_SIZE_T_MAX - 1 ) / 4 ) in mbedtls_base64_encode()
98 n *= 4; in mbedtls_base64_encode()
100 if( ( dlen < n + 1 ) || ( NULL == dst ) ) in mbedtls_base64_encode()
102 *olen = n + 1; in mbedtls_base64_encode()
106 n = ( slen / 3 ) * 3; in mbedtls_base64_encode()
108 for( i = 0, p = dst; i < n; i += 3 ) in mbedtls_base64_encode()
147 size_t i, n; in mbedtls_base64_decode() local
152 for( i = n = j = 0; i < slen; i++ ) in mbedtls_base64_decode()
[all …]
Dplatform.c34 static void *platform_calloc_uninit( size_t n, size_t size ) in platform_calloc_uninit() argument
36 ((void) n); in platform_calloc_uninit()
67 int mbedtls_platform_win32_snprintf( char *s, size_t n, const char *fmt, ... ) in mbedtls_platform_win32_snprintf() argument
73 if( s == NULL || n == 0 || fmt == NULL ) in mbedtls_platform_win32_snprintf()
78 ret = _vsnprintf_s( s, n, _TRUNCATE, fmt, argp ); in mbedtls_platform_win32_snprintf()
80 ret = _vsnprintf( s, n, fmt, argp ); in mbedtls_platform_win32_snprintf()
81 if( ret < 0 || (size_t) ret == n ) in mbedtls_platform_win32_snprintf()
83 s[n-1] = '\0'; in mbedtls_platform_win32_snprintf()
98 static int platform_snprintf_uninit( char * s, size_t n, in platform_snprintf_uninit() argument
102 ((void) n); in platform_snprintf_uninit()
[all …]
Dblowfish.c43 static void mbedtls_zeroize( void *v, size_t n ) { in mbedtls_zeroize() argument
44 volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; in mbedtls_zeroize()
51 #define GET_UINT32_BE(n,b,i) \ argument
53 (n) = ( (uint32_t) (b)[(i) ] << 24 ) \
61 #define PUT_UINT32_BE(n,b,i) \ argument
63 (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
64 (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
65 (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
66 (b)[(i) + 3] = (unsigned char) ( (n) ); \
324 size_t n = *iv_off; in mbedtls_blowfish_crypt_cfb64() local
[all …]
Dcamellia.c52 static void mbedtls_zeroize( void *v, size_t n ) { in mbedtls_zeroize() argument
53 volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; in mbedtls_zeroize()
60 #define GET_UINT32_BE(n,b,i) \ argument
62 (n) = ( (uint32_t) (b)[(i) ] << 24 ) \
70 #define PUT_UINT32_BE(n,b,i) \ argument
72 (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
73 (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
74 (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
75 (b)[(i) + 3] = (unsigned char) ( (n) ); \
111 #define SBOX1(n) FSb[(n)] argument
[all …]
Dbignum.c62 static void mbedtls_mpi_zeroize( mbedtls_mpi_uint *v, size_t n ) { in mbedtls_mpi_zeroize() argument
63 volatile mbedtls_mpi_uint *p = v; while( n-- ) *p++ = 0; in mbedtls_mpi_zeroize()
88 X->n = 0; in mbedtls_mpi_init()
102 mbedtls_mpi_zeroize( X->p, X->n ); in mbedtls_mpi_free()
107 X->n = 0; in mbedtls_mpi_free()
121 if( X->n < nblimbs ) in mbedtls_mpi_grow()
128 memcpy( p, X->p, X->n * ciL ); in mbedtls_mpi_grow()
129 mbedtls_mpi_zeroize( X->p, X->n ); in mbedtls_mpi_grow()
133 X->n = nblimbs; in mbedtls_mpi_grow()
150 if( X->n <= nblimbs ) in mbedtls_mpi_shrink()
[all …]
Ddhm.c61 static void mbedtls_zeroize( void *v, size_t n ) { in mbedtls_zeroize() argument
62 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize()
72 int ret, n; in dhm_read_bignum() local
77 n = ( (*p)[0] << 8 ) | (*p)[1]; in dhm_read_bignum()
80 if( (int)( end - *p ) < n ) in dhm_read_bignum()
83 if( ( ret = mbedtls_mpi_read_binary( X, *p, n ) ) != 0 ) in dhm_read_bignum()
86 (*p) += n; in dhm_read_bignum()
190 #define DHM_MPI_EXPORT(X,n) \ in mbedtls_dhm_make_params() argument
191 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( X, p + 2, n ) ); \ in mbedtls_dhm_make_params()
192 *p++ = (unsigned char)( n >> 8 ); \ in mbedtls_dhm_make_params()
[all …]
Dx509_csr.c64 static void mbedtls_zeroize( void *v, size_t n ) { in mbedtls_zeroize() argument
65 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize()
320 size_t n; in mbedtls_x509_csr_parse_file() local
323 if( ( ret = mbedtls_pk_load_file( path, &buf, &n ) ) != 0 ) in mbedtls_x509_csr_parse_file()
326 ret = mbedtls_x509_csr_parse( csr, buf, n ); in mbedtls_x509_csr_parse_file()
328 mbedtls_zeroize( buf, n ); in mbedtls_x509_csr_parse_file()
344 size_t n; in mbedtls_x509_csr_info() local
349 n = size; in mbedtls_x509_csr_info()
351 ret = mbedtls_snprintf( p, n, "%sCSR version : %d", in mbedtls_x509_csr_info()
355 ret = mbedtls_snprintf( p, n, "\n%ssubject name : ", prefix ); in mbedtls_x509_csr_info()
[all …]
Decp_curves.c557 X->n = len / sizeof( mbedtls_mpi_uint ); in ecp_mpi_load()
568 X->n = 1; in ecp_mpi_set1()
581 const mbedtls_mpi_uint *n, size_t nlen) in ecp_group_load() argument
587 ecp_mpi_load( &grp->N, n, nlen ); in ecp_group_load()
841 end = p + N->n; in ecp_mod_p192()
881 #define MAX32 N->n
887 #define MAX32 N->n * 2
931 C.n = b / 8 / sizeof( mbedtls_mpi_uint) + 1; \
933 memset( Cp, 0, C.n * sizeof( mbedtls_mpi_uint ) ); \
965 C->p[ C->n - 1 ] = ((mbedtls_mpi_uint) -c) << 32; in fix_negative()
[all …]
Dxtea.c46 static void mbedtls_zeroize( void *v, size_t n ) { in mbedtls_zeroize() argument
47 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize()
54 #define GET_UINT32_BE(n,b,i) \ argument
56 (n) = ( (uint32_t) (b)[(i) ] << 24 ) \
64 #define PUT_UINT32_BE(n,b,i) \ argument
66 (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
67 (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
68 (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
69 (b)[(i) + 3] = (unsigned char) ( (n) ); \
Dnet_sockets.c185 int n, ret; in mbedtls_net_bind() local
214 n = 1; in mbedtls_net_bind()
216 (const char *) &n, sizeof( n ) ) != 0 ) in mbedtls_net_bind()
306 socklen_t n = (socklen_t) sizeof( client_addr ); in mbedtls_net_accept() local
309 int n = (int) sizeof( client_addr ); in mbedtls_net_accept() local
325 (struct sockaddr *) &client_addr, &n ); in mbedtls_net_accept()
333 (struct sockaddr *) &client_addr, &n ); in mbedtls_net_accept()
360 if( connect( bind_ctx->fd, (struct sockaddr *) &client_addr, n ) != 0 ) in mbedtls_net_accept()
366 n = sizeof( struct sockaddr_storage ); in mbedtls_net_accept()
368 (struct sockaddr *) &local_addr, &n ) != 0 || in mbedtls_net_accept()
[all …]
Dx509_crl.c70 static void mbedtls_zeroize( void *v, size_t n ) { in mbedtls_zeroize() argument
71 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize()
557 size_t n; in mbedtls_x509_crl_parse_file() local
560 if( ( ret = mbedtls_pk_load_file( path, &buf, &n ) ) != 0 ) in mbedtls_x509_crl_parse_file()
563 ret = mbedtls_x509_crl_parse( chain, buf, n ); in mbedtls_x509_crl_parse_file()
565 mbedtls_zeroize( buf, n ); in mbedtls_x509_crl_parse_file()
584 size_t n; in mbedtls_x509_crl_info() local
589 n = size; in mbedtls_x509_crl_info()
591 ret = mbedtls_snprintf( p, n, "%sCRL version : %d", in mbedtls_x509_crl_info()
595 ret = mbedtls_snprintf( p, n, "\n%sissuer name : ", prefix ); in mbedtls_x509_crl_info()
[all …]
/net-tools-3.7.0/tinydtls-0.8.2/
Ddebug.c107 size_t n = 0; in dtls_strnlen() local
108 while(*s++ && n < maxlen) in dtls_strnlen()
109 ++n; in dtls_strnlen()
110 return n; in dtls_strnlen()
253 int n = 0; in hexdump() local
256 if (n % 16 == 0) in hexdump()
257 printf("%08X ",n); in hexdump()
261 n++; in hexdump()
262 if (n % 8 == 0) { in hexdump()
263 if (n % 16 == 0) in hexdump()
[all …]
Dglobal.h109 memxor(unsigned char *x, const unsigned char *y, size_t n) { in memxor() argument
110 while(n--) { in memxor()
140 int n; in dtls_fls() local
141 for (n = 0; i; n++) in dtls_fls()
143 return n; in dtls_fls()
/net-tools-3.7.0/mbedtls-2.4.0/programs/pkey/
Ddh_client.c75 size_t n, buflen; in main() local
166 n = buflen = ( buf[0] << 8 ) | buf[1]; in main()
178 if( ( ret = mbedtls_net_recv( &server_fd, buf, n ) ) != (int) n ) in main()
208 if( ( n = (size_t) ( end - p ) ) != rsa.len ) in main()
230 n = dhm.len; in main()
231 if( ( ret = mbedtls_dhm_make_public( &dhm, (int) dhm.len, buf, n, in main()
238 if( ( ret = mbedtls_net_send( &server_fd, buf, n ) ) != (int) n ) in main()
250 if( ( ret = mbedtls_dhm_calc_secret( &dhm, buf, sizeof( buf ), &n, in main()
257 for( n = 0; n < 16; n++ ) in main()
258 mbedtls_printf( "%02x", buf[n] ); in main()
Ddh_server.c75 size_t n, buflen; in main() local
196 if( ( ret = mbedtls_dhm_make_params( &dhm, (int) mbedtls_mpi_size( &dhm.P ), buf, &n, in main()
206 mbedtls_sha1( buf, n, hash ); in main()
208 buf[n ] = (unsigned char)( rsa.len >> 8 ); in main()
209 buf[n + 1] = (unsigned char)( rsa.len ); in main()
212 0, hash, buf + n + 2 ) ) != 0 ) in main()
218 buflen = n + 2 + rsa.len; in main()
237 if( ( ret = mbedtls_net_recv( &client_fd, buf, n ) ) != (int) n ) in main()
255 if( ( ret = mbedtls_dhm_calc_secret( &dhm, buf, sizeof( buf ), &n, in main()
262 for( n = 0; n < 16; n++ ) in main()
[all …]
/net-tools-3.7.0/libcoap/tests/
Dtest_sendqueue.c292 size_t n, error = 0; in t_sendqueue_tests_create() local
297 for (n = 1; n < sizeof(node)/sizeof(coap_queue_t *); n++) { in t_sendqueue_tests_create()
298 node[n] = coap_new_node(); in t_sendqueue_tests_create()
299 if (!node[n]) { in t_sendqueue_tests_create()
304 node[n]->id = n; in t_sendqueue_tests_create()
305 node[n]->t = timestamp[n]; in t_sendqueue_tests_create()
310 for (n = 0; n < sizeof(node)/sizeof(coap_queue_t *); n++) { in t_sendqueue_tests_create()
311 if (node[n]) { in t_sendqueue_tests_create()
312 coap_delete_node(node[n]); in t_sendqueue_tests_create()
313 node[n] = NULL; in t_sendqueue_tests_create()
[all …]
/net-tools-3.7.0/virtual-hub/src/
Dgraphs.c29 float **create_matrix(int n) in create_matrix() argument
31 float **matrix = (float **)malloc(n * sizeof(float *)); in create_matrix()
33 for (int i = 0; i < n; i++) { in create_matrix()
34 matrix[i] = (float *)malloc(n * sizeof(float)); in create_matrix()
35 for (int j = 0; j < n; j++) { in create_matrix()
62 void print_matrix(float **m, int n) in print_matrix() argument
64 for (int i = 0; i < n; i++) { in print_matrix()
65 for (int j = 0; j < n; j++) { in print_matrix()
/net-tools-3.7.0/mbedtls-2.4.0/programs/hash/
Dgeneric_sum.c81 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()
/net-tools-3.7.0/mbedtls-2.4.0/programs/util/
Dpem2der.c119 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()

12345