Page MenuHomePhabricator

variable signing precompute table
ClosedPublic

Authored by deadalnix on Feb 28 2020, 02:36.

Details

Summary

make ECMULT_GEN_PREC_BITS configurable

ecmult_static_context.h: add compile time config assertion (#3) - Prevents accidentally using a file which was generated with a
different configuration.

README: mention valgrind issue

With --with-ecmult-gen-precision=8, valgrind needs a max stack size
adjustment to not run into a stack switching heuristic:

http://valgrind.org/docs/manual/manual-core.html

-max-stackframe= [default: 2000000]
The maximum size of a stack frame. If the stack pointer moves by more than this amount then Valgrind will assume that the program is switching to a different stack.

You may need to use this option if your program has large stack-allocated arrays.

basic-config: undef ECMULT_WINDOW_SIZE before (re-)defining it

This is a backport of libsecp256k1 PR337

Test Plan

Run make and cmake build and check the pass.
Pass random values to SECP256K1_ECMULT_GEN_PRECISION and check that cmake fails.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
secppr337
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9638
Build 17176: Default Diff Build & Tests
Build 17175: arc lint + arc unit

Event Timeline

Fabien added inline comments.
src/secp256k1/CMakeLists.txt
211 ↗(On Diff #16596)

Hum, not sure the message is really helpful :)

Fabien requested changes to this revision.Feb 28 2020, 14:08
This revision now requires changes to proceed.Feb 28 2020, 14:08
Fabien added inline comments.
src/secp256k1/CMakeLists.txt
216

You can use your variable to avoid duplicating the values:

message(FATAL_ERROR "SECP256K1_ECMULT_GEN_PRECISION should be one of ${VALID_PRECISIONS}")

You can even join with ", " if you want to make it prettier.

This revision is now accepted and ready to land.Mar 2 2020, 07:30
This revision was automatically updated to reflect the committed changes.