Lines Matching refs:buf
78 unsigned char buf[2048]; in main() local
194 memset( buf, 0, sizeof( buf ) ); in main()
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()
223 ( ret = mbedtls_net_send( &client_fd, buf, buflen ) ) != (int) buflen ) in main()
235 memset( buf, 0, sizeof( buf ) ); in main()
237 if( ( ret = mbedtls_net_recv( &client_fd, buf, n ) ) != (int) n ) in main()
243 if( ( ret = mbedtls_dhm_read_public( &dhm, buf, dhm.len ) ) != 0 ) in main()
255 if( ( ret = mbedtls_dhm_calc_secret( &dhm, buf, sizeof( buf ), &n, in main()
263 mbedtls_printf( "%02x", buf[n] ); in main()
276 mbedtls_aes_setkey_enc( &aes, buf, 256 ); in main()
277 memcpy( buf, PLAINTEXT, 16 ); in main()
278 mbedtls_aes_crypt_ecb( &aes, MBEDTLS_AES_ENCRYPT, buf, buf ); in main()
280 if( ( ret = mbedtls_net_send( &client_fd, buf, 16 ) ) != 16 ) in main()