mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Move MIN and MAX macros from PSA tests to helpers.function
This commit is contained in:
		
							parent
							
								
									d76f181617
								
							
						
					
					
						commit
						c08fc1d7e9
					
				@ -202,6 +202,23 @@ typedef struct data_tag
 | 
			
		||||
    ( STATIC_ASSERT_THEN_RETURN( IS_ARRAY_NOT_POINTER( array ),         \
 | 
			
		||||
                                 ARRAY_LENGTH_UNSAFE( array ) ) )
 | 
			
		||||
 | 
			
		||||
/** Return the smaller of two values.
 | 
			
		||||
 *
 | 
			
		||||
 * \param x         An integer-valued expression without side effects.
 | 
			
		||||
 * \param y         An integer-valued expression without side effects.
 | 
			
		||||
 *
 | 
			
		||||
 * \return The smaller of \p x and \p y.
 | 
			
		||||
 */
 | 
			
		||||
#define MIN( x, y ) ( ( x ) < ( y ) ? ( x ) : ( y ) )
 | 
			
		||||
 | 
			
		||||
/** Return the larger of two values.
 | 
			
		||||
 *
 | 
			
		||||
 * \param x         An integer-valued expression without side effects.
 | 
			
		||||
 * \param y         An integer-valued expression without side effects.
 | 
			
		||||
 *
 | 
			
		||||
 * \return The larger of \p x and \p y.
 | 
			
		||||
 */
 | 
			
		||||
#define MAX( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 32-bit integer manipulation macros (big endian)
 | 
			
		||||
 | 
			
		||||
@ -11,8 +11,6 @@
 | 
			
		||||
 | 
			
		||||
#include "psa/crypto.h"
 | 
			
		||||
 | 
			
		||||
#define MAX( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )
 | 
			
		||||
 | 
			
		||||
/** An invalid export length that will never be set by psa_export_key(). */
 | 
			
		||||
static const size_t INVALID_EXPORT_LENGTH = ~0U;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,11 +6,6 @@
 | 
			
		||||
#include "mbedtls/entropy.h"
 | 
			
		||||
#include "mbedtls/entropy_poll.h"
 | 
			
		||||
 | 
			
		||||
/* MAX value support macro */
 | 
			
		||||
#if !defined(MAX)
 | 
			
		||||
#define MAX(a,b) (((a)>(b))?(a):(b))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Calculating the minimum allowed entropy size in bytes */
 | 
			
		||||
#define MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE MAX(MBEDTLS_ENTROPY_MIN_PLATFORM, MBEDTLS_ENTROPY_BLOCK_SIZE)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -12,9 +12,6 @@
 | 
			
		||||
#include "mbedtls/entropy.h"
 | 
			
		||||
#include "mbedtls/entropy_poll.h"
 | 
			
		||||
 | 
			
		||||
#define MIN( x, y ) ( ( x ) < ( y ) ? ( x ) : ( y ) )
 | 
			
		||||
#define MAX( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )
 | 
			
		||||
 | 
			
		||||
#define ENTROPY_MIN_NV_SEED_SIZE                                        \
 | 
			
		||||
    MAX(MBEDTLS_ENTROPY_MIN_PLATFORM, MBEDTLS_ENTROPY_BLOCK_SIZE)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user