Skip to content

Commit

Permalink
[examples] extend example to use parallel batch_verify version
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed May 9, 2024
1 parent ccf6f1e commit 75405fb
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions examples-c/ethereum_bls_signatures.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ int main(){
printf("Signature verification failure: status %d - %s\n", bls_status, ctt_eth_bls_status_to_string(bls_status));
exit(1);
}

printf("Example BLS signature/verification protocol completed successfully\n");


Expand All @@ -73,5 +72,26 @@ int main(){
}

printf("Example BLS batch verification completed successfully\n");

// ------------------------------
// Batch verification, parallel
// ------------------------------

// and now try to use a threadpool and do the same in parallel

struct ctt_threadpool* tp = ctt_threadpool_new(4);
printf("Constantine: Threadpool init successful.\n");
bls_status = ctt_eth_bls_batch_verify_parallel(tp, pkeys, messages, sigs, 3, srb);
if (bls_status != cttEthBls_Success) {
printf("Batch verification failure: status %d - %s\n", bls_status, ctt_eth_bls_status_to_string(bls_status));
exit(1);
}
printf("Example parallel BLS batch verification completed successfully\n");

ctt_threadpool_shutdown(tp);
printf("Constantine: Threadpool shutdown successful.\n");



return 0;
}
}

0 comments on commit 75405fb

Please sign in to comment.