diff options
author | Matt Johnston <matt@ucc.asn.au> | 2018-02-09 21:44:05 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2018-02-09 21:44:05 +0800 |
commit | 4f2eb1914bdac3ed3ee504ad86061281dbe0d074 (patch) | |
tree | 078293375c3f3ee2d485cf9559a08d65d460786a /libtomcrypt/tests/common.h | |
parent | d72f50ff3284e15124a0f233c26339229fe305ac (diff) |
Update to libtomcrypt 1.18.1, merged with Dropbear changes
Diffstat (limited to 'libtomcrypt/tests/common.h')
-rw-r--r-- | libtomcrypt/tests/common.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libtomcrypt/tests/common.h b/libtomcrypt/tests/common.h new file mode 100644 index 0000000..410db1e --- /dev/null +++ b/libtomcrypt/tests/common.h @@ -0,0 +1,32 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#ifndef DEMOS_COMMON_H_ +#define DEMOS_COMMON_H_ + +#include <tomcrypt.h> + +extern prng_state yarrow_prng; + +#ifdef LTC_VERBOSE +#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) +#define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) +#else +#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) +#define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) +#endif + +void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm); + +void print_hex(const char* what, const void* v, const unsigned long l); + +#endif /* DEMOS_COMMON_H_ */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ |