mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-08 21:18:03 -05:00
37 lines
847 B
C++
37 lines
847 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(bool warning)
|
|
{
|
|
#if defined(INSECURE) or defined(INSECURE_FAKE)
|
|
if (warning)
|
|
cerr << "WARNING: insecure preprocessing" << endl;
|
|
#else
|
|
(void) warning;
|
|
insecure("preprocessing");
|
|
#endif
|
|
}
|