Skip to content

Commit

Permalink
Perhaps a malloc error on CI machines
Browse files Browse the repository at this point in the history
  • Loading branch information
sanket1729 committed Jan 21, 2023
1 parent c65e554 commit b89636e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/bulletproofs/bulletproofs_pp_norm_product_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int secp256k1_bulletproofs_pp_rangeproof_norm_product_prove(
size_t scratch_checkpoint;
size_t log_n = secp256k1_bulletproofs_pp_log2(g_len), log_m = secp256k1_bulletproofs_pp_log2(h_len);
size_t n_rounds = log_n > log_m ? log_n : log_m;

printf("n_rounds: %d\n");
/* Check proof sizes.*/
if (*proof_len < 65 * n_rounds + 64) {
return 0;
Expand All @@ -257,8 +257,10 @@ int secp256k1_bulletproofs_pp_rangeproof_norm_product_prove(
gs = (secp256k1_ge*)secp256k1_scratch_alloc(&ctx->error_callback, scratch, (g_len + h_len) * sizeof(secp256k1_ge));
if (ns == NULL || ls == NULL || cs == NULL || gs == NULL) {
secp256k1_scratch_apply_checkpoint(&ctx->error_callback, scratch, scratch_checkpoint);
printf("Failed to allocate memory for proof.\n");
return 0;
}
printf("Here\n");
memcpy(ns, n_vec, g_len * sizeof(secp256k1_scalar));
memcpy(ls, l_vec, h_len * sizeof(secp256k1_scalar));
memcpy(cs, c_vec, h_len * sizeof(secp256k1_scalar));
Expand Down

0 comments on commit b89636e

Please sign in to comment.