trying to minimize how much we refer to the almighty non-working blowfish at this point.
#include <mathematics/chaos.h>
#include <structures/static_memory_gremlin.h>
-///#include <openssl/blowfish.h>
#include <openssl/err.h>
#include <openssl/evp.h>
namespace crypto {
const int FUDGE = 1024;
- /* extra space for the cipher's block size. blowfish, e.g., is only 8 bytes for
- the cipher block size, so we'd only ever need possibly 8 bytes padding?
- */
-//hmmm: guarantee the fudge space is enough for other algorithms!
-
-//#undef set_key
- // get rid of a macro we don't want.
+ /* extra space for the cipher's block size. */
//#define DEBUG_CRYPTICAL_ENVELOPMENT
// uncomment for noisier version.
for (int i = 0; i < bytes; i++)
new_key[i] = static_ssl_initializer().randomizer().inclusive(0, 255);
-//code that we thought might be necessary but which doesn't help blowfish not suck.
+/*
+ the wipe unused bits code... we thought this might be necessary at one
+ point, but have never found it to help anything. doesn't seem to impede
+ twofish from working properly, but that doesn't mean we leave it turned
+ on. yuck.
+*/
//#define WIPE_UNUSED_BITS
#ifdef WIPE_UNUSED_BITS
// clear the bits that cannot be non-zero for a key whose bits are not evenly divisible by 8.
FUNCDEF("ctor");
LOG("prior to provider setup");
- // new code needed because blowfish is considered legacy code now. ugh.
+ // load the legacy provider to get access to blowfish and other antiques.
c_legacy_provider = OSSL_PROVIDER_load(NULL_POINTER, "legacy");
if (!c_legacy_provider) {
ALWAYS_LOG("failed to load legacy openssl provider! mega boofer fail!");
namespace crypto {
-//! provides some initialization for the RSA and blowfish crypto.
+//! provides some initialization for the cryptography engines.
/*!
This class does the SSL initialization needed before any functions can
be used. It also sets up the random seed for SSL. NOTE: you should never
very bottom and it will be managed globally for the entire program.
*/
-// we define NEWER_OPENSSL for those places where we're using more recent versions.
-// this forces the code to choose newer methods over deprecated ones.
+/*
+ we define NEWER_OPENSSL for those places where we're using more recent versions.
+ this forces the code to choose newer methods over deprecated ones.
+*/
#if OPENSSL_VERSION_NUMBER > 0x10100000L
#define NEWER_OPENSSL
#endif
byte_array junk(1);
int written;
outcome ret = write(junk, written);
- if (ret != OKAY) ret;
+ if (ret != OKAY) return ret;
if (!truncate())
return FAILURE;
}
LOG("starting blowfish test...");
#endif
- // a known hack--we have bad failures in this test, thanks to openssl as far
- // as we can tell. so we signal not to fail in the test results.
+ /*
+ a known hack--we have bad failures in this test, thanks to openssl as far
+ as we can tell. so we signal not to fail in the test results.
+ */
set_failures_are_critial(false);
int left = THREAD_COUNT;
bool failures_are_critical() const { return c_fail_on_errors; }
/*!<
- * report whether we consider test errors to be a critical failure. if true, then any
- * error causes a non-zero exit return from the unit test. if false, then the successful
- * zero exit occurs instead. this allows a test which is known to fail to not break the
- * build (ahem, borked blowfish!).
+ * report whether we consider test errors to be a critical failure.
+ * if true (which is the default), then any error causes a non-zero exit
+ * return from the unit test. if set to false (optional), then the
+ * successful zero exit occurs even when errors are seen in the tests.
+ * this keeps a test which is known to fail from breaking the build.
*/
void set_failures_are_critial(bool are_failures_critical)
{ c_fail_on_errors = are_failures_critical; } //<! setter for test fail flag.