diff options
author | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
commit | a2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch) | |
tree | ad3d6c4fcc8dd0f403f8105598943616246fe172 /checks/common.h |
Initial checkin1.5.6
Diffstat (limited to 'checks/common.h')
-rw-r--r-- | checks/common.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/checks/common.h b/checks/common.h new file mode 100644 index 000000000..f887997fd --- /dev/null +++ b/checks/common.h @@ -0,0 +1,35 @@ +// common code for the validation and benchmark code +// this file is in the public domain + +#ifndef BOTANCHECK_COMMON_H__ +#define BOTANCHECK_COMMON_H__ + +#include <vector> +#include <string> + +struct algorithm + { + algorithm(const char* t, const char* n, + u32bit k = 0, u32bit i = 0) : + type(t), name(n), filtername(n), keylen(k), ivlen(i) {} + algorithm(const char* t, const char* n, + const char* f, u32bit k = 0, u32bit i = 0) : + type(t), name(n), filtername(f), keylen(k), ivlen(i) {} + std::string type, name, filtername; + u32bit keylen, ivlen, weight; + }; + +std::vector<algorithm> get_algos(); + +void strip_comments(std::string& line); +void strip_newlines(std::string& line); +void strip(std::string& line); +std::vector<std::string> parse(const std::string& line); + +std::string hex_encode(const byte in[], u32bit len); +Botan::SecureVector<byte> decode_hex(const std::string&); + +Botan::u64bit get_clock(); +Botan::u64bit get_ticks(); + +#endif |