add compare_testvector() prototype to tomcrypt_misc.h
This commit is contained in:
		
							parent
							
								
									9a29428f8e
								
							
						
					
					
						commit
						03f0674985
					
				@ -101,7 +101,11 @@ int crc32_test(void);
 | 
			
		||||
 | 
			
		||||
/* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */
 | 
			
		||||
#if defined(LTC_TEST) && defined(LTC_TEST_DBG)
 | 
			
		||||
void print_hex(const char* what, const void* p, const unsigned long l);
 | 
			
		||||
void print_hex(const char* what, const void* v, const unsigned long l);
 | 
			
		||||
int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which);
 | 
			
		||||
#else
 | 
			
		||||
#define compare_testvector(is, is_len, should, should_len, what, which) \
 | 
			
		||||
   (((is_len) != (should_len)) || (XMEMCMP((is), (should), (is_len)) != 0))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* $Source$ */
 | 
			
		||||
 | 
			
		||||
@ -81,7 +81,9 @@ extern const struct ltc_prng_descriptor no_prng_desc;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void print_hex(const char* what, const void* v, const unsigned long l);
 | 
			
		||||
#ifndef compare_testvector
 | 
			
		||||
int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which);
 | 
			
		||||
#endif
 | 
			
		||||
int sorter(const void *a, const void *b);
 | 
			
		||||
void tally_results(int type);
 | 
			
		||||
ulong64 rdtsc (void);
 | 
			
		||||
 | 
			
		||||
@ -35,6 +35,7 @@ void print_hex(const char* what, const void* v, const unsigned long l)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifndef compare_testvector
 | 
			
		||||
int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which)
 | 
			
		||||
{
 | 
			
		||||
   int res = 0;
 | 
			
		||||
@ -51,6 +52,7 @@ int compare_testvector(const void* is, const unsigned long is_len, const void* s
 | 
			
		||||
 | 
			
		||||
   return res;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct list results[100];
 | 
			
		||||
int no_results;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user