31 std::cout<<
"\n c++ verificatum verifier\n\n"
32 <<
"To use this software, use the following line:\n\n"
33 <<
"./cppverifier <protInfo.xml> <roProof>\n\n"
34 <<
"Where <protInfo.xml> is an xml file desciring the "
35 <<
"protocol info and <roProof> is the path to the "
36 <<
"proof directory.\n"
54 std::string res = str1;
55 res.push_back(separator);
56 res.insert(res.end(),str2.begin(),str2.end());
71 std::string
getPath(std::string dir, std::string type,
unsigned int l)
75 res.push_back(
'0' + l/10);
76 res.push_back(
'0' + l%10);
98 std::string &configFile,
99 std::string &path2roDir)
109 configFile.assign(argv[1]);
110 path2roDir.assign(argv[2]);
127 int main(
int argc,
char ** argv)
134 std::cout<<
"1. Must be done by hand."<<std::endl;
139 std::cout<<
"2. Initialising public parameters"<<std::endl;
140 std::string protInfo, roProof;
151 std::cout<<
"3. Setting up the prefix for the RO"<<std::endl;
152 std::vector<uint8_t> content, rho;
161 std::cout<<
"4. Reading the joint public key"<<std::endl;
168 std::cout<<
"5. Reading individual public keys"<<std::endl;
171 for (
unsigned int l=1; l<=k; l++)
173 std::cout<<
" reading key #"<<l<<std::endl;
180 std::cout<<
"\nREJECT: $\\prod_{l=1}^{k} y_l \\noteq pk$"<<std::endl;
184 std::cout<<
" We do have $\\prod_{l=1}^{k} y_l \\eq pk$"<<std::endl;
189 std::cout<<
"6. Reading the 0th array of input ciphertexts"<<std::endl;
191 std::cout<<
" reading cipher text #0"<<std::endl;
194 unsigned int N = LlMinus1.
size();
196 std::cout<<
" N="<<N<<
", N_0="<<N0<<std::endl;
201 unsigned int lambda = config->
getThres();
202 std::cout<<
"7. PROOFS OF SHUFFLE for l=1.."<<lambda<<std::endl;
203 for (
unsigned int l=1; l<=lambda; l++)
205 std::cout<<
" l="<<l<<std::endl;
213 readingWasOK, config, rho, N0, ul, tauPos, sigmaPos);
216 std::cout<<
" a) Proof of shuffle of commitments could not be initialized."<<std::endl;
221 std::cout<<
" a) Proof of shuffle of commitments went wrong so ul=h"<<std::endl;
225 std::cout<<
" a) Proof of shuffle of commitments passed."<<std::endl;
232 tl.assign(N0,
false);
233 for (
unsigned int i=0; i<N; i++)
238 unsigned int hammingWeight = 0;
239 for (
unsigned int i=0; i<N0; i++)
242 if (hammingWeight != N)
244 tl.assign(N0,
false);
245 for (
unsigned int i=0; i<N; i++)
250 std::cout<<
" b) Keep list parsed."<<std::endl;
255 std::cout<<
" c) array of ciphertext L_"<<l<<
" read."<<std::endl;
261 readingWasOK, config, rho, ul, N, R, C, pk, LlMinus1, Ll, tauCCPos, sigmaCCPos);
262 if ( (!readingWasOK) || (!commitmentConsistent.
isEverythingOK()) )
264 std::cout<<
" d) Proof of commitment consistent shuffle went wrong..."<<std::endl;
267 std::cout<<
"\nREJECT: Algorithm 18 rejected and $L_{l-1} \\neq L_l$ "<<std::endl;
270 std::cout<<
" ... but L_{l-1} \\eq L_l$"<<std::endl;
274 std::cout<<
" d) Proof of commitment consistent shuffle passed."<<std::endl;
283 std::cout<<
"8. PROOF OF DECRYPTION for l=1.."<<k<<std::endl;
285 for (
unsigned int l=1; l<=k; l++)
298 std::cout<<
" a-case) x_l could be read and $y_l \\eq g^{x_l}$"<<std::endl;
300 fl = C.
pdec(xl,LlMinus1);
301 std::cout<<
" f_l set to $PDec_{x_l}(L_{l-1})"<<std::endl;
306 std::cout<<
" b-case) x_l could not be read or $y_l \\noteq g^{x_l}$"<<std::endl;
316 readingWasOK, config, rho, N, y.
getElmt(l-1), C, M, Llambda, fl, taul, sigmal);
319 std::cout<<
"\nREJECT: Algorithm 18 rejected because it could not read the data it needed."
323 else if (!correctDecryption.isEverythingOK())
325 std::cout<<
"\nREJECT: Algorithm 18 rejected because $y^v y' \\noteq g^{k_x}$ or $PDec_{k_x}(A) \\noteq B^v B'."
330 std::cout<<
" Proof of correct decryption was OK for l="<<l<<std::endl;
338 std::cout<<
"9. Verifying output"<<std::endl;
345 std::cout<<
"\nREJECT: $m \\noteq TDec(L_{\\lambda}), \\prod_{l=1}^k f_l$"<<std::endl;
349 std::cout<<
" ... Output correct!"<<std::endl;
353 std::cout<<
"\nACCEPT"<<std::endl;