Skip to content

Commit

Permalink
[example] use sysrand to fill secureRandomBytes array
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar authored and mratsim committed May 18, 2024
1 parent 39a4f24 commit afba7d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples-c/ethereum_bls_signatures.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ int main(){
{ message, 32 }
};
const ctt_eth_bls_signature sigs[3] = { sig, sig, sig };
byte srb[32] = {0}; // just a bunch of zeros as random "secure" bytes.

// Use constantine's `sysrand` to fill the secure random bytes
byte srb[32];
if(!ctt_csprng_sysrand(srb, 32)){
printf("Failed to fill `srb` using `sysrand`\n");
exit(1);
}

bls_status = ctt_eth_bls_batch_verify(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));
Expand Down

0 comments on commit afba7d6

Please sign in to comment.