mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Avoid unnecessary xxx_copy() calls
The call would anyway check for pointer equality and return early, but it
doesn't hurt to save a function call, and also this follows more uniformly the
pattern that those two lines go together:
    #if defined(MBEDTLS_ECP_RESTARTBLE)
    if( rs_ctx != NULL && ...
			
			
This commit is contained in:
		
							parent
							
								
									5bd38b1144
								
							
						
					
					
						commit
						28d162829b
					
				@ -353,7 +353,8 @@ modn:
 | 
				
			|||||||
    while( mbedtls_mpi_cmp_int( s, 0 ) == 0 );
 | 
					    while( mbedtls_mpi_cmp_int( s, 0 ) == 0 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
 | 
					#if defined(MBEDTLS_ECP_RESTARTABLE)
 | 
				
			||||||
    mbedtls_mpi_copy( r, pr );
 | 
					    if( rs_ctx != NULL && rs_ctx->sig != NULL )
 | 
				
			||||||
 | 
					        mbedtls_mpi_copy( r, pr );
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cleanup:
 | 
					cleanup:
 | 
				
			||||||
 | 
				
			|||||||
@ -1804,7 +1804,8 @@ static int ecp_mul_comb_after_precomp( const mbedtls_ecp_group *grp,
 | 
				
			|||||||
    MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, RR ) );
 | 
					    MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, RR ) );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
 | 
					#if defined(MBEDTLS_ECP_RESTARTABLE)
 | 
				
			||||||
    MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, RR ) );
 | 
					    if( rs_ctx != NULL && rs_ctx->rsm != NULL )
 | 
				
			||||||
 | 
					        MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, RR ) );
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cleanup:
 | 
					cleanup:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user