Values for P-521 have an odd number of limbs in 32-bit mode, which
means we can't keep using `TOBN`, and also Montgomery-encoded
values are different for 32-bit and 64-bit.
Generate some of the C boilerplate, particularly the large constants.
The output is written into target/curves/, and can be merged into
the actual code in crypto/fipsmodule/ec/ using a two-way merge tool;
this is the same as the Rust code generation.
Changes to gfp_p{256,384}.c are due to differences in the generator's
output:
* The generator doesn't generate trailing commas in arrays.
* The generator consistently avoids adding leading zeros to hex
constants, and consistently format values less than 10 in decimal;
the exiting code used a mix of styles.
* The generator wraps arrays consistently; the existing code used a
mix of wrapping styles.
* The generator does not nest constants in the functions that need
them. This was changed to support future refactorings.
Don't warn during `cargo build` or `cargo test`, but deny them
in `mk/clippy.sh` so that they are caught in CI. Limit `cargo build`
warnings to things that matter during the edit/test cycle.
When `$ANDROID_NDK_HOME` is set, `mk/cargo.sh` will use it to locate the
NDK tools. Thus, we need to ensure that the hack is applied to
`$ANDROID_NDK_HOME` when that is set.
I am not sure why I added this line; perhaps it was unintentially left in
when the script was being debugged.
Use Android NDK 25 since that's GitHub Actions is moving to. SDK level
is the minimum supported, and there are no longer target-specific
allases for `llvm-ar`; update cargo.sh accordingly.
Use the environment variables recommended by the Android documentation.
Work around compatibility issue with Rust and Android NDKs.
Remove out-of-date documentation aboud building for Android.
I agree to license my contributions to each file under the terms given at the top of each file I changed.
Co-authored-by: Marc-André Moreau <marcandre.moreau@gmail.com>
Eliminate the extra Cargo.toml that was used just for this feature. It was
too error-prone to keep it in sync with the real Cargo.toml. Having one
Cargo.toml will allow us to reliably use the `CARGO_MANIFEST_LINKS` value
to keep the symbol prefix in sync with the `links` field in Cargo.toml in
the near future.
`cargo clippy` failed with an error but this didn't cause mk/cargo.sh
to fail because it didn't contain `set -e`. Thus the `clippy` job has
been passing when it shouldn't.
Add the "bash strict mode" to the script.
I verified the other shell scripts use the "bash strict mode" already.