|
ATLAS Offline Software
|
Go to the documentation of this file.
32 if (
arg ==
"-c" ) doCheck =
true;
44 std::cout << std::endl;
45 std::cout <<
"Blinding keys generated:" << std::endl;
46 std::cout <<
" Private key: " <<
keys.first << std::endl;
47 std::cout <<
" Public key: " <<
keys.second << std::endl;
48 std::cout << std::endl;
52 srand(
static_cast<unsigned>(
time(0)));
54 std::cout <<
"Encryption test:" << std::endl;
56 for (
int i=0;
i<nChecks; ++
i) {
58 static_cast <float>(
rand())/(
static_cast <float> (RAND_MAX));
62 if ( dec ==
val ) ++nOK;
63 if (
i == 0 || dec !=
val ) {
64 std::cout <<
" Test # " <<
i << std::endl;
65 std::cout <<
" val = " <<
val << std::endl;
66 std::cout <<
" enc = " << enc << std::endl;
67 std::cout <<
" dec = " << dec << std::endl;
69 std::cout <<
" => worked!" << std::endl;
71 std::cout <<
" => FAILED!" << std::endl;
75 std::cout << std::endl;
76 std::cout <<
"Summary:" << std::endl;
77 std::cout <<
" nChecks: " << std::setw(12) << nChecks << std::endl;
78 std::cout <<
" nOK : " << std::setw(12) << nOK << std::endl;
79 std::cout <<
" nFailed: " << std::setw(12) << nChecks - nOK << std::endl;
virtual ULLI_t encrypt(ULLI_t x)
Encrypt a positive integer value.
virtual std::pair< std::string, std::string > genKeyPair()
Generate private and public keys.
Provide simple asymmetric encryption for blinding of float values.
Provide simple asymmetric encryption for blinding of float values.
int main(int argc, char *argv[])
virtual ULLI_t decrypt(ULLI_t x)
Decrypt a positive integer value.
def time(flags, cells_name, *args, **kw)
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...