add do_compare_testvector()

This commit is contained in:
Steffen Jaeckel 2018-02-17 17:26:30 +01:00
parent 4d17d1328d
commit ecd3fb714d
2 changed files with 11 additions and 0 deletions

View file

@ -61,6 +61,15 @@ void print_hex(const char* what, const void* v, const unsigned long l)
}
}
int do_compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which)
{
if (compare_testvector(is, is_len, should, should_len, what, which) == 0) {
return CRYPT_OK;
} else {
return CRYPT_FAIL_TESTVECTOR;
}
}
prng_state yarrow_prng;
/* ref: $Format:%D$ */

View file

@ -25,6 +25,8 @@ void run_cmd(int res, int line, const char *file, const char *cmd, const char *a
void print_hex(const char* what, const void* v, const unsigned long l);
int do_compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which);
#endif /* DEMOS_COMMON_H_ */
/* ref: $Format:%D$ */