22#include <openssl/crypto.h>
23#include <openssl/err.h>
24#include <openssl/provider.h>
25#include <openssl/rand.h>
39#define ALWAYS_LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
42 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
61 LOG(
"prior to provider setup");
63 c_legacy_provider = OSSL_PROVIDER_load(
NULL_POINTER,
"legacy");
64 if (!c_legacy_provider) {
65 ALWAYS_LOG(
"failed to load legacy openssl provider! mega boofer fail!");
69 c_default_provider = OSSL_PROVIDER_load(
NULL_POINTER,
"default");
70 if (!c_default_provider) {
71 ALWAYS_LOG(
"failed to load default openssl provider! mega flopsweat fail!");
74 LOG(
"after provider setup");
76 LOG(
"prior to rand seed");
78 LOG(
"after rand seed");
84 LOG(
"prior to crypto cleanup");
88 if (c_default_provider) OSSL_PROVIDER_unload(c_default_provider);
89 if (c_legacy_provider) OSSL_PROVIDER_unload(c_legacy_provider);
91 CRYPTO_cleanup_all_ex_data();
99 for (
int i = 0; i < length; i++)
A very common template for a dynamic array of bytes.
provides some initialization for the RSA and blowfish crypto.
const mathematics::chaos & randomizer() const
provides a random number generator for any encryption routines.
basis::byte_array random_bytes(int length) const
can be used to generate a random array of "length" bytes.
a platform-independent way to acquire random numbers in a specific range.
int inclusive(int low, int high) const
< Returns a pseudo-random number r, such that "low" <= r <= "high".
#define NULL_POINTER
The value representing a pointer to nothing.
#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)