Originally I was trying to be pedantic and avoid any use of `_t`-
suffixed names. However, this hasn't really accomplished anything
except annoying me, so just do what BoringSSL does.
Revert the names used in the BoringSSL C/asm code to the names used in
BoringSSL. This substantially reduces the diff between *ring* and
BoringSSL for these files.
Use a variant of BoringSSL's symbol prefixing machinery to semi-
automatically prefix FFI symbols with the `GFp_` prefix. The names aren't
all exactly the same as before, because previously we *replaced* a
symbol's original prefix with the `GFp_` prefix; now we're prepending
`GFp_`. In the future we'll use a different prefix entirely.
This paves the way for using different prefixes for each version so that
multiple versions of *ring* can be linked into an executable at once.
Replace `GFp_bn_mul_add_word` with a clearer, simpler implementation.
The new `GFp_limbs_mul_add_limb` avoid explicit branches at the C code
level, unlike the code it replaces. (Obviously, even with the new
"branchless" code the compiler might be able to synthesize branches.)
Refactor the code to make it clearer how (timing) side channels are
avoided, and to make it a total function. Move this generic logic from
`rsa` to `limbs`.
The equivalence assertions between `size_t` and other types is stronger
than what is needed; they were added when `size_t` was the type used
for constant-time operations instead of `crypto_word`, and weren't
removed. Note `Limb` and `BN_ULONG` are aliases for `crypto_word`.
`GFp_BN_mod_exp_mont_consttime`'s API still uses `BIGNUM` but its
implementation no longer does. This removes the last use of
BN_FLG_STATIC_DATA, which will be removed shortly.
These aren't just useful for finite fields over primes GFp. They can
be used for arithmetic in the ring Z/Zn where n isn't prime, as is
the case for RSA arithmetic modulo the public modulus `n`.
Now it is clear now that we're not going to need to disambiguate the
types in this module with other libraries' types, so remove the `GFp_`
prefixes.