22 #include <openssl/crypto.h>
23 #include <openssl/err.h>
24 #include <openssl/rand.h>
26 using namespace basis;
39 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
56 LOG(
"prior to crypto debug init");
57 CRYPTO_malloc_debug_init();
58 LOG(
"prior to dbg set options");
59 CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
60 LOG(
"prior to mem ctrl");
61 CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
63 LOG(
"prior to rand seed");
65 LOG(
"after rand seed");
71 LOG(
"prior to crypto cleanup");
72 CRYPTO_cleanup_all_ex_data();
90 for (
int i = 0; i < length; i++)
91 seed +=
abyte(c_rando.inclusive(0, 255));
A very common template for a dynamic array of bytes.
provides some initialization for the RSA and blowfish crypto.
a platform-independent way to acquire random numbers in a specific range.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
The guards collection helps in testing preconditions and reporting errors.
unsigned char abyte
A fairly important unit which is seldom defined...
const ssl_init & static_ssl_initializer()
the main method for accessing the SSL initialization support.
A logger that sends to the console screen using the standard output device.
An extension to floating point primitives providing approximate equality.
A dynamic container class that holds any kind of object via pointers.
#define SAFE_STATIC_CONST(type, func_name, parms)
this version returns a constant object instead.
byte_array random_bytes(int length)