mirror of
				https://github.com/Mbed-TLS/mbedtls.git
				synced 2025-10-30 10:45:34 +03:00 
			
		
		
		
	ECDH: Improve ECDH full handshake benchmark
This commit is contained in:
		
				
					committed by
					
						 Janos Follath
						Janos Follath
					
				
			
			
				
	
			
			
			
						parent
						
							6acfbb52d7
						
					
				
				
					commit
					79acf95199
				
			| @@ -988,7 +988,7 @@ int main( int argc, char *argv[] ) | |||||||
|     } |     } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECDH_LEGACY_CONTEXT) | #if defined(MBEDTLS_ECDH_C)  | ||||||
|     if( todo.ecdh ) |     if( todo.ecdh ) | ||||||
|     { |     { | ||||||
|         mbedtls_ecdh_context ecdh_srv, ecdh_cli; |         mbedtls_ecdh_context ecdh_srv, ecdh_cli; | ||||||
| @@ -1006,11 +1006,18 @@ int main( int argc, char *argv[] ) | |||||||
|             mbedtls_ecdh_setup( &ecdh_srv, curve_info->grp_id ); |             mbedtls_ecdh_setup( &ecdh_srv, curve_info->grp_id ); | ||||||
|             mbedtls_ecdh_setup( &ecdh_cli, curve_info->grp_id ); |             mbedtls_ecdh_setup( &ecdh_cli, curve_info->grp_id ); | ||||||
|  |  | ||||||
|  | #if defined(MBEDTLS_ECDH_LEGACY_CONTEXT) | ||||||
|  |             if (mbedtls_ecp_group_load(&ecdh_srv.grp, curve_info->grp_id) != 0 || | ||||||
|  |                 mbedtls_ecdh_gen_public(&ecdh_srv.grp, | ||||||
|  |                     &ecdh_srv.d, | ||||||
|  |                     &ecdh_srv.Q, myrand, NULL) != 0) | ||||||
|  | #else | ||||||
|             if( ecdh_srv.var == MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0 && ( |             if( ecdh_srv.var == MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0 && ( | ||||||
|                 mbedtls_ecp_group_load( &ecdh_srv.ctx.mbed_ecdh.grp, curve_info->grp_id ) != 0 || |                 mbedtls_ecp_group_load( &ecdh_srv.ctx.mbed_ecdh.grp, curve_info->grp_id ) != 0 || | ||||||
|                 mbedtls_ecdh_gen_public( &ecdh_srv.ctx.mbed_ecdh.grp, |                 mbedtls_ecdh_gen_public( &ecdh_srv.ctx.mbed_ecdh.grp, | ||||||
|                                          &ecdh_srv.ctx.mbed_ecdh.d, |                                          &ecdh_srv.ctx.mbed_ecdh.d, | ||||||
|                                          &ecdh_srv.ctx.mbed_ecdh.Q, myrand, NULL ) != 0 )) |                                          &ecdh_srv.ctx.mbed_ecdh.Q, myrand, NULL ) != 0 )) | ||||||
|  | #endif | ||||||
|                 mbedtls_exit( 1 ); |                 mbedtls_exit( 1 ); | ||||||
|  |  | ||||||
|             mbedtls_snprintf( title, sizeof( title ), "ECDHE-%s", curve_info->name ); |             mbedtls_snprintf( title, sizeof( title ), "ECDHE-%s", curve_info->name ); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user