mimblewimble / secp256k1-zkp

Fork of secp256k1-zkp for the Grin/MimbleWimble project
MIT License
32 stars 41 forks source link

aggsig verify: inefficiently allocation every time #27

Open garyyu opened 5 years ago

garyyu commented 5 years ago

https://github.com/mimblewimble/secp256k1-zkp/blob/master/src/modules/aggsig/main_impl.h#L498-L499

    /* just going to inefficiently allocate every time */
    secp256k1_scratch_space *scratch = secp256k1_scratch_space_create(ctx, 1024*4096);

Mark here: This line need an optimization, to avoid 4M bytes RAM allocation on each call. Will give a PR on this.

garyyu commented 5 years ago

Another place: https://github.com/mimblewimble/secp256k1-zkp/blob/master/src/modules/aggsig/main_impl.h#L566

    scratch = secp256k1_scratch_space_create(ctx, 1024*4096);