Lines Matching refs:buf
79 unsigned char buf[2048]; in main() local
158 memset( buf, 0, sizeof( buf ) ); in main()
160 if( ( ret = mbedtls_net_recv( &server_fd, buf, 2 ) ) != 2 ) in main()
166 n = buflen = ( buf[0] << 8 ) | buf[1]; in main()
167 if( buflen < 1 || buflen > sizeof( buf ) ) in main()
176 memset( buf, 0, sizeof( buf ) ); in main()
178 if( ( ret = mbedtls_net_recv( &server_fd, buf, n ) ) != (int) n ) in main()
184 p = buf, end = buf + buflen; in main()
215 mbedtls_sha1( buf, (int)( p - 2 - buf ), hash ); 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()
258 mbedtls_printf( "%02x", buf[n] ); in main()
271 mbedtls_aes_setkey_dec( &aes, buf, 256 ); in main()
273 memset( buf, 0, sizeof( buf ) ); in main()
275 if( ( ret = mbedtls_net_recv( &server_fd, buf, 16 ) ) != 16 ) in main()
281 mbedtls_aes_crypt_ecb( &aes, MBEDTLS_AES_DECRYPT, buf, buf ); in main()
282 buf[16] = '\0'; in main()
283 mbedtls_printf( "\n . Plaintext is \"%s\"\n\n", (char *) buf ); in main()