This refactoring PR takes use of the secp256k1_{read,write}_be32
helpers (introduced in PR #1093, commit 8d89b9e6e562000cdb91a70a85fae5e4817cec8a) in the scalar <-> byte array conversion functions, for both the 8x32 and 4x64 implementations. (An alternative for the latter would be to introduce special helpers for reading/writing uint64_t in big endian secp256k1_{read,write}_be64
).
Verified via objdump -D libsecp256k1.a
that secp256k1_scalar_set_b32
for 4x64 compiles to the same code on master and the PR (secp256k1_scalar_get_b32
is apparently always inlined) on amd64 with clang 13.0.0.