Skip to content

Commit

Permalink
Better lowmemory feature with precomputed ECMULT
Browse files Browse the repository at this point in the history
  • Loading branch information
devrandom committed May 16, 2021
1 parent a66f581 commit 439d188
Show file tree
Hide file tree
Showing 2 changed files with 1,167 additions and 2 deletions.
6 changes: 4 additions & 2 deletions secp256k1-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ fn main() {
.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 neglible memory
.include("depend/config")
.define("USE_ECMULT_STATIC_PRECOMPUTATION", Some("1"));
} else {
base_config.define("ECMULT_WINDOW_SIZE", Some("15")); // This is the default in the configure file (`auto`)
}
Expand Down
Loading

0 comments on commit 439d188

Please sign in to comment.