@@ -151,6 +151,8 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
151
151
vector<Sharing*>& sharings = party->GetSharings ();
152
152
Circuit *bc, *yc, *ac;
153
153
154
+ if (quiet) {std::cout << " Running operation test quietly." << std::endl;}
155
+
154
156
for (uint32_t r = 0 ; r < num_test_runs; r++) {
155
157
for (uint32_t i = 0 ; i < nops; i++) {
156
158
Circuit* circ = sharings[test_ops[i].sharing ]->GetCircuitBuildRoutine ();
@@ -286,8 +288,7 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
286
288
shrout = circ->PutOUTGate (shrres, ALL);
287
289
288
290
if (!quiet){
289
- std::cout << " Running test no. " << i << " on operation " << test_ops[i].opname ;
290
- std::cout << std::endl;
291
+ std::cout << " Running test no. " << i << " on operation " << test_ops[i].opname << std::endl;
291
292
}
292
293
293
294
party->ExecCircuit ();
@@ -299,8 +300,13 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
299
300
}
300
301
party->Reset ();
301
302
302
- if (!ignore_verification){
303
- assert (verify == c);
303
+ if (!ignore_verification) {
304
+ if (verify != c) {
305
+ std::cerr << " ERROR in test verification! " << std::endl;
306
+ std::cerr << get_role_name (role) << " " << test_ops[i].opname << " : values: a = " << a
307
+ << " , b = " << b << " , c = " << c << " , verify = " << verify << std::endl;
308
+ exit (EXIT_FAILURE);
309
+ }
304
310
}
305
311
}
306
312
}
@@ -550,24 +556,31 @@ int32_t test_vector_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen, u
550
556
551
557
party->Reset ();
552
558
for (uint32_t j = 0 ; j < nvals; j++) {
553
- if (!quiet)
559
+ if (!quiet){
554
560
std::cout << " \t " << get_role_name (role) << " " << test_ops[i].opname << " : values[" << j <<
555
561
" ]: a = " << avec[j] << " , b = " << bvec[j] << " , c = " << cvec[j] << " , verify = " <<
556
562
verifyvec[j] << std::endl;
563
+ }
557
564
if (!ignore_verification){
558
- assert (verifyvec[j] == cvec[j]);
565
+ if (verifyvec[j] != cvec[j]){
566
+ std::cerr << " ERROR in test verification! " << std::endl;
567
+ std::cerr << " \t " << get_role_name (role) << " " << test_ops[i].opname << " : values[" << j <<
568
+ " ]: a = " << avec[j] << " , b = " << bvec[j] << " , c = " << cvec[j] << " , verify = " <<
569
+ verifyvec[j] << std::endl;
570
+ exit (EXIT_FAILURE);
571
+ }
559
572
}
560
-
573
+
561
574
}
562
- free (cvec);
575
+ std:: free (cvec);
563
576
}
564
577
}
565
578
566
- free (sa);
567
- free (sb);
568
- free (avec);
569
- free (bvec);
570
- free (verifyvec);
579
+ std:: free (sa);
580
+ std:: free (sb);
581
+ std:: free (avec);
582
+ std:: free (bvec);
583
+ std:: free (verifyvec);
571
584
572
585
return EXIT_SUCCESS;
573
586
@@ -614,6 +627,3 @@ int32_t read_test_options(int32_t* argcp, char*** argvp, e_role* role, uint32_t*
614
627
615
628
return EXIT_SUCCESS;
616
629
}
617
-
618
-
619
-
0 commit comments