mimblewimble / rust-secp256k1-zkp

ZKP fork for rust-secp256k1, adds wrappers for range proofs, pedersen commitments, etc
Creative Commons Zero v1.0 Universal
56 stars 51 forks source link

Remove 4th argument in secp256k1_bulletproof_generators_create #15

Closed jaspervdm closed 6 years ago

jaspervdm commented 6 years ago

Looking at https://github.com/mimblewimble/secp256k1-zkp/blob/testnet3/src/modules/bulletproofs/main_impl.h#L30, the method secp256k1_bulletproof_generators_create only has 3 arguments: a context, a blinding generator and a number. However in https://github.com/mimblewimble/rust-secp256k1-zkp/blob/testnet3/src/ffi.rs#L476 (and all places where it is called) there is a 4th argument precomp_n. I think this argument doesn't do anything and should be removed.

garyyu commented 6 years ago

Yes, indeed. Thanks @jaspervdm

/** Allocates and initializes a list of NUMS generators, along with precomputation data
 *  Returns a list of generators, or NULL if allocation failed.
 *  Args:          ctx: pointer to a context object (cannot be NULL)
 *  In:   blinding_gen: generator that blinding factors will be multiplied by (cannot be NULL)
 *                   n: number of NUMS generators to produce
 */
SECP256K1_API secp256k1_bulletproof_generators *secp256k1_bulletproof_generators_create(
    const secp256k1_context* ctx,
    const secp256k1_generator *blinding_gen,
    size_t n
) SECP256K1_ARG_NONNULL(1);
garyyu commented 6 years ago

@jaspervdm included in https://github.com/mimblewimble/rust-secp256k1-zkp/pull/20 and you can close this issue since pr already merged.