theStack
commented at 1:25 AM on May 27, 2024:
contributor
This PR is an attempt at tidying up test util functions, as suggested in #1491. The following changes are done:
rename _group_element... functions to _ge...
rename _field_element... functions to _fe...
move random_ helpers from tests.c to testutil.h (the alternative would be testrand.h, but to my understanding, this one is meant to contain the actual RNG implementation rather than helpers using it; happy to move the helpers there if that is preferred though)
prefix testutil.h functions with testutil_
prefix testrand.h functions with testrand_ (this is currently done in a sloppy way by simply dropping the secp256k1_ prefix, so some functions don't have the full prefix, like e.g. testrand256; naming suggestions welcome)
Note that the already existing function `random_fe_magnitude` is removed
and the call-sites are adapted to pass the magnitude range of 8
(the maximum for secp256k1_fe_mul and secp256k1_fe_sqr) explicitly.
0fef8479be
tests: refactor: move `random_` helpers from tests.c to testutil.h
Can be reviewed via `--color-moved=dimmed-zebra`.
0c6bc76dcd
tests: refactor: add `testutil_` prefix to testutil.h functions0ee7453a99
tests: refactor: drop `secp256k1_` prefix from testrand.h functions
The rename was done with the following command:
$ sed -i 's/secp256k1_testrand/testrand/g' $(git grep -l secp256k1_testrand)
e73f6f8fd9
theStack force-pushed on May 27, 2024
real-or-random approved
real-or-random
commented at 12:34 PM on May 27, 2024:
contributor
utACKe73f6f8fd9158a044c6fb22653105446f3542bb0
real-or-random added the label assurance on May 27, 2024
real-or-random added the label refactor/smell on May 27, 2024
sipa
commented at 4:01 PM on May 27, 2024:
contributor
What is up with the macOS CI?
real-or-random
commented at 8:42 PM on May 27, 2024:
contributor
This is a metadata mirror of the GitHub repository
bitcoin-core/secp256k1.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:52 UTC