comparison libtomcrypt/tests/common.h @ 1471:6dba84798cd5

Update to libtomcrypt 1.18.1, merged with Dropbear changes
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 21:44:05 +0800
parents
children e9dba7abd939
comparison
equal deleted inserted replaced
1470:8bba51a55704 1471:6dba84798cd5
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2 *
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
5 *
6 * The library is free for all purposes without any express
7 * guarantee it works.
8 */
9 #ifndef DEMOS_COMMON_H_
10 #define DEMOS_COMMON_H_
11
12 #include <tomcrypt.h>
13
14 extern prng_state yarrow_prng;
15
16 #ifdef LTC_VERBOSE
17 #define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0)
18 #define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0)
19 #else
20 #define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0)
21 #define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0)
22 #endif
23
24 void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm);
25
26 void print_hex(const char* what, const void* v, const unsigned long l);
27
28 #endif /* DEMOS_COMMON_H_ */
29
30 /* ref: $Format:%D$ */
31 /* git commit: $Format:%H$ */
32 /* commit time: $Format:%ai$ */