Page MenuHomePhabricator

[secp256k1] Simulated int128 type.
ClosedPublic

Authored by PiRK on Fri, Feb 13, 15:59.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC74456b63078e: [secp256k1] Simulated int128 type.
Summary

Abstracts the int128 type and provides an native version, if available, or a implements it using a pair of int64_t's.
This is activated by setting the configuration flag --with-test-override-wide-multiply=int128_struct.

Tidy #includes of int128.h and int128_impl.h

After this commit, int128.h and int128_impl.h are included as follows:

  • .c files which use int128 include int128_impl.h (after util.h)
  • .h files which use int128 include int128.h (after util.h)

This list is exhaustive. util.h needs to included first because it sets
up necessary #defines.

Add int128_struct tests

This is a backport of secp256k1#1000

Test Plan
cmake ..  -GNinja -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct
ninja check-secp256k1

CI

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK published this revision for review.Fri, Feb 13, 17:28
PiRK added inline comments.
src/secp256k1/src/scalar_4x64_impl.h
111–115 ↗(On Diff #58321)

Note to reviewers: this area of the code was the only conflict, so watch more closely (see D18158)

The rest of the backport did not require any change from the source material (except the CMakeList.txt).

This revision is now accepted and ready to land.Mon, Feb 16, 09:56
This revision was automatically updated to reflect the committed changes.