Skip to content

Commit

Permalink
Reduce size of precomputed signing table (ECMULT_GEN_PREC_BITS) for l…
Browse files Browse the repository at this point in the history
…owmemory
  • Loading branch information
RCasatta committed Jul 21, 2021
1 parent 12e3c66 commit 505b04d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions secp256k1-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ fn main() {
.define("ENABLE_MODULE_ECDH", Some("1"))
.define("ENABLE_MODULE_SCHNORRSIG", Some("1"))
.define("ENABLE_MODULE_EXTRAKEYS", Some("1"))
.define("ECMULT_GEN_PREC_BITS", Some("4"))
// TODO these three should be changed to use libgmp, at least until secp PR 290 is merged
.define("USE_NUM_NONE", Some("1"))
.define("USE_FIELD_INV_BUILTIN", Some("1"))
.define("USE_SCALAR_INV_BUILTIN", Some("1"));

if cfg!(feature = "lowmemory") {
base_config.define("ECMULT_WINDOW_SIZE", Some("4")); // A low-enough value to consume neglible memory
base_config.define("ECMULT_WINDOW_SIZE", Some("4")); // A low-enough value to consume negligible memory
base_config.define("ECMULT_GEN_PREC_BITS", Some("2"));
} else {
base_config.define("ECMULT_GEN_PREC_BITS", Some("4"));
base_config.define("ECMULT_WINDOW_SIZE", Some("15")); // This is the default in the configure file (`auto`)
}
base_config.define("USE_EXTERNAL_DEFAULT_CALLBACKS", Some("1"));
Expand Down

0 comments on commit 505b04d

Please sign in to comment.