Files
MP-SPDZ/Tools/benchmarking.cpp
2022-04-19 15:13:19 +02:00

35 lines
794 B
C++

/*
* benchmarking.cpp
*
*/
#include "benchmarking.h"
void insecure(string message, bool warning)
{
#ifdef INSECURE
if (warning)
cerr << "WARNING: insecure " << message << endl;
#else
(void)warning;
string msg = "You are trying to use insecure benchmarking functionality for "
+ message + ".\nYou can activate this at compile time "
"by adding -DINSECURE to the compiler options.\n"
"Make sure to run 'make clean' as well before compiling.";
cerr << msg << endl;
#ifdef INSECURE_EXCEPTION
throw exception();
#endif
exit(1);
#endif
}
void insecure_fake()
{
#if defined(INSECURE) or defined(INSECURE_FAKE)
cerr << "WARNING: insecure preprocessing" << endl;
#else
insecure("preprocessing");
#endif
}