Skip to content

Commit ba90a01

Browse files
committed
Merge #799: secp256k1-sys: fix lowmemory feature
37876a7 secp256k1-sys: fix `lowmemory` feature (Andrew Poelstra) Pull request description: When upstream switched to multicomb they changed the #define flags needed to reduce the size of the ecmult_gen precomp table. We should have updated our bulid.rs. Before this change, on my system the secp256k1-sys rlib with the lowmemory feature has size 630602. After this change, it has size 610090, a 3.3% reduction. Probably not worth backporting, although it's not a breaking change and we totally could backport it. Fixes #795 ACKs for top commit: tcharding: ACK 37876a7 Tree-SHA512: 6470a297f601a3f47c423f3e2c128c30d969fc397733b73acd9781d2b6e9760b80e113c4e7f024cda22c0bca6e3072cdaf90e403f6d7196809f55f5b573b99cc
2 parents 2038b5e + 37876a7 commit ba90a01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

secp256k1-sys/build.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ fn main() {
3535

3636
if cfg!(feature = "lowmemory") {
3737
base_config.define("ECMULT_WINDOW_SIZE", Some("4")); // A low-enough value to consume negligible memory
38-
base_config.define("ECMULT_GEN_PREC_BITS", Some("2"));
38+
base_config.define("COMB_BLOCKS", Some("2"));
39+
base_config.define("COMB_TEETH", Some("5"));
3940
} else {
40-
base_config.define("ECMULT_GEN_PREC_BITS", Some("4"));
4141
base_config.define("ECMULT_WINDOW_SIZE", Some("15")); // This is the default in the configure file (`auto`)
42+
base_config.define("COMB_BLOCKS", Some("43"));
43+
base_config.define("COMB_TEETH", Some("6"));
4244
}
4345
base_config.define("USE_EXTERNAL_DEFAULT_CALLBACKS", Some("1"));
4446
#[cfg(feature = "recovery")]

0 commit comments

Comments
 (0)