409 Commits

Author SHA1 Message Date
Brian Smith
183ce8066b CI: mk/check-symbol-prefixes.sh: Use llvm-tools-preview llvm-nm. 2024-01-13 18:12:27 -08:00
Brian Smith
a94849dc26 mk/check-symbol-prefixes.sh: Make target argument mandatory. 2024-01-13 18:12:27 -08:00
Brian Smith
317a062bf4 ec suite_b: De-duplicate to_mont. 2023-12-04 14:36:50 -08:00
Brian Smith
c89b5c6e28 ec suite_b: Split scalar inversion API into variable- and constant- time. 2023-12-04 14:36:50 -08:00
Brian Smith
07aff69462 EC: Fix support for curves like P-521 in the code generator.
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.
2023-11-13 12:45:39 -08:00
Brian Smith
d87972edc9 EC: Add C code generation to mk/generate_curves.py.
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.
2023-11-13 12:45:39 -08:00
Brian Smith
6613481632 Add P-521 to mk/generate_curves.py.
Add preliminary support for P-521 but don't sync the existing
(semi-)generated code with it.
2023-10-25 13:46:08 -07:00
Brian Smith
e83cf0c0bb Add simplified elliptic curve code generator.
Add a tool to generate and/or verify NIST curve boilerplate.

Sync the existing P-256 and P-384 code with the generator.
2023-10-25 13:46:08 -07:00
Brian Smith
8348897d92 CI: Add wasm32-wasi to CI. 2023-10-14 16:50:18 -07:00
JanKaul
2019d8482f Add support for wasm32-wasi.
[The files changed in this commit were part of the original PR. The
original PR also changed other files, but those changes were removed.]
2023-10-14 16:50:18 -07:00
Brian Smith
99ab6db360 Add arm-unknown-linux-gnueabi testing to CI.
Replace arm-unknown-linux-gnueabihf in `test` since we already have
another gnueabihf target.
2023-10-13 17:45:30 -07:00
Brian Smith
e7aedb26c6 Change documentation & unnecessary qualification warnings.
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.
2023-10-13 16:11:25 -07:00
Brian Smith
bafde9dba7 Clippy: Move lint configuration to lib.rs. 2023-10-13 16:11:25 -07:00
Brian Smith
8edeead004 Minimize scope of clippy::upper_case_acronyms. 2023-10-13 15:03:55 -07:00
Brian Smith
691a4dbb31 mk/clippy.sh: Remove --allow entries for lints that aren't triggered. 2023-10-13 15:03:55 -07:00
Brian Smith
3eb07737f1 build.rs: Address clippy::ptr_arg. 2023-10-13 15:03:55 -07:00
Brian Smith
64cd0b997e Remove target-dir workaround for Clippy cache issues.
For a long while this hasn't been needed. See
https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-152
2023-10-13 15:03:31 -07:00
Brian Smith
00d639339a Add support for 64-bit big-endian PowerPC.
Not added to CI. We need to find a better solution for supporting PowerPC
(and s390x and other less-common archs) in CI.
2023-10-01 21:29:33 -07:00
ZHAI Xiaojuan
3d592b27bf Add support for LoongArch64 2023-10-01 18:43:17 -07:00
Brian Smith
6e82dd3c75 Add powerpc-unknown-linux-gnu support. 2023-10-01 18:25:37 -07:00
Ulrich Weigand
baa823bb4d Basic support for s390x target 2023-10-01 14:33:16 -07:00
Eric Richter
3161c01ec5 CI: add powerpc64le-unknown-linux-gnu as a target
Signed-off-by: Eric Richter <erichte@linux.ibm.com>
2023-09-30 17:18:58 -07:00
Brian Smith
e5908b9626 CI: Use riscv64-linux-gnu-gcc as RISC-V linker. 2023-09-30 11:46:06 -07:00
leso-kn
1e1e8e1ee6 Add support for riscv64
Co-authored-by: Alan Mock <alan@alanmock.com>
Co-authored-by: Patrick Elsen <pelsen@xfbs.net>
Signed-off-by: leso-kn <info@lesosoftware.com>
2023-09-30 11:46:06 -07:00
Brian Smith
4328252946 CI: Use LLVM 16 tools.
Rust now uses LLVM 16 and writes object files that LLVM 15's `nm` cannot
fully understand.
2023-09-03 15:32:26 -07:00
Brian Smith
95948b3977 CI: Install the latest (currently) version of the LTS NDK. 2023-02-16 13:10:43 -08:00
Brian Smith
ffcd828b62 CI: Fix Android builds in GitHub Actions.
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.
2023-02-15 13:52:07 -08:00
Brian Smith
54520a3652 Adjust MIPSEL CI build system changes.
Take MIPSEL out of the GitHub Actions configuration because it fails to
link, and because it makes the build matrix too large.
2022-11-11 16:57:21 -08:00
Linus Unnebäck
ce24e188e0 Add mipsel to Github Actions CI setup 2022-11-11 15:10:16 -08:00
Brian Smith
7d395fb62b CI: Use -Cinstrument-coverage 2022-11-03 14:47:14 -07:00
Brian Smith
f5bd88cc0a Use the getrandom crate to implement ring::rand. 2022-10-29 11:14:38 -07:00
Brian Smith
0d18da865a Always use llvm-nm in mk/check-symbol-prefixes.sh.
Don't try to use binutils `nm` or the Android SDK `llvm-nm`, since they don't
support LLVM's "opaque pointers".
2022-10-21 07:53:11 -07:00
Brian Smith
a93fbbe8b3 CI: Use LLVM 15 so llvm-nm works in opaque pointer mode. 2022-10-19 23:49:17 -07:00
Brian Smith
bd5f1c4105 Use llvm-nm for checking symbol prefixes for targets for which we use clang. 2022-10-19 23:49:17 -07:00
Brian Smith
9098bd6e30 Address latest clippy warnings. 2022-10-19 23:49:17 -07:00
Brian Smith
32e007fc88 Use Android NDK 25 and work around Rust/Android incompatibilities.
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.
2022-10-19 23:49:17 -07:00
Brian Smith
431069e97f CI: Fix ---all-targets typo in clippy invocation. 2022-04-07 17:40:03 -07:00
Brian Smith
8820c150ea Use LLVM 14 in CI/CD for coverage. 2022-02-20 17:51:04 -08:00
Brian Smith
d97ae1fd08 wasm32: Make wasm32_c the default and only mode; remove the "wasm32_c" feature.
Always require a C compilare for wasm32, instead of trying to provide a subset
of the functionality.
2021-10-06 15:53:02 -07:00
Alexander Ovchinnikov
ceb5b90f6e Enable building and running on Windows ARM64
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>
2021-08-16 12:28:42 -07:00
Brian Smith
609a0f809a Address clippy::len_zero. 2021-05-11 18:34:48 -07:00
Brian Smith
b86067da4e Address clippy::vec_init_then_push. 2021-05-11 18:34:48 -07:00
Brian Smith
38cb28332b PBKDF2: Avoid slice indexing. 2021-05-11 16:47:23 -07:00
Brian Smith
ee7f888940 Address clippy::redundant_slicing warnings. 2021-05-11 16:47:23 -07:00
Brian Smith
a839093b51 Enable clippy::from_over_into lint. 2021-05-11 15:57:51 -07:00
Brian Smith
b4600fa244 Sync mk/clippy.sh with webpki. 2021-05-11 15:57:51 -07:00
Brian Smith
badca90d14 Simplify assembly pre-generation mechanism.
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.
2021-05-03 13:36:20 -07:00
Brian Smith
fed04d72db CI/CD: Add a check that verifies symbol renaming was done well enough. 2021-05-02 22:09:07 -07:00
Brian Smith
e03cb68e53 CI/CD: Always use LLVM 12. 2021-04-29 16:37:41 -07:00
Brian Smith
4f30438640 CI/CD: Fix error handling in mk/clippy.sh.
`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.
2021-04-29 16:07:38 -07:00