HomePhabricator

[secp256k1] Simulated int128 type.

Description

[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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D19574

Details

Provenance
Russell O'Connor <roconnor@blockstream.io>Authored on Jul 27 2022, 15:09
PiRKCommitted on Feb 23 2026, 09:00
PiRKPushed on Feb 23 2026, 09:00
Reviewer
Restricted Project
Differential Revision
D19574: [secp256k1] Simulated int128 type.
Parents
rABCe58090722e37: [secp256k1] Remove usage of CHECK from non-test file
Branches
Unknown
Tags
Unknown

Event Timeline