Commit graph

16 commits

Author SHA1 Message Date
pinkforest(she/her)
cb42e87096
Fixes curve25519_dalek_bits defaults for cross and wasm (#465)
build.rs was using cfg(target) but it has to evaluate this from env TARGET
as build.rs cfg(target) in build context is the builder host and not the target.

This change fixes curve25519_dalek_bits lottery to determine the correct
automatic curve25119_dalek_bits with the help of platforms crate.

As discussed in #456 this also prepares for well known defaults for wasm and
arm serial backend via cfg(curve25519_dalek_bits = "64")

If the wasm32 or armv7 are going to be u64 serial by default these will be
followed up on later.
2022-12-09 21:09:24 -05:00
Tony Arcieri
cc304c29ff
Use --cfg curve25519_dalek_backend to select backend (#455)
Crate features are intended to be additive, whereas only 1-of-N possible
backends can be selected.

Features can also be activated by transitive dependencies, which leads
to a problem of different dependences selecting conflicting backends.
Using `--cfg` instead moves all backend selection control to the
toplevel executable.

This commit switches to the following RUSTFLAGS to enable backends:

- `--cfg curve25519_dalek_backend="fiat"`: uses `fiat-crypto`
- `--cfg curve25519_dalek_backend="simd"`: uses nightly-only SIMD
2022-12-09 03:42:52 -05:00
Michael Rosenberg
f5dada3834
Updates to README (#453)
* Restructure README and CHANGELOG
* Explain semver policy
* Specify feature flags and backends more explicitly
* Remove nightly from the CI bc that didn't belong there
* Add @pinkforest to thankyou list

Co-authored-by: pinkforest <36498018+pinkforest@users.noreply.github.com>
2022-12-09 03:30:44 -05:00
Tony Arcieri
1e490bd001
Fix --no-default-features test warnings; consolidate CI jobs (#461)
Previously `cargo test --no-default-features` would succeed but with
warnings. This commit fixes all of those warnings and tests
`--no-default-features` in CI to ensure that in perpetuity.
2022-12-08 23:26:18 -05:00
Tony Arcieri
1013560fe4
Remove std feature (#459)
All of the existing usages of `std` can be replaced with `alloc`.

They are legacy usages from before when liballoc was stabilized.
2022-12-08 15:05:59 -05:00
pinkforest(she/her)
2190332b67
Add target u32/u64 backend override (#454)
As suggested in #453 it is sometimes feasible to
select the backend bits via an override.

This change provides `cfg(curve25519_dalek_bits)`
to override the bits used in serial or fiat target backend.
2022-12-08 11:52:42 -05:00
pinkforest(she/her)
e01bb1bdc6
Fix all clippy warnings replay (#441)
Also fixes CI not running on all branches

Co-authored-by: Anthony Ramine <nox@nox.paris>
2022-12-04 03:40:51 -05:00
Tony Arcieri
7d275100bf
CI: fix build-simd job (#436)
The `RUSTFLAGS` were getting applied to build scripts, which caused them
to crash with SIGILL.

According to this issue, RUSTFLAGS won't be applied to build scripts
when cross-compiling by passing the `--target` attribute:

https://github.com/rust-lang/cargo/issues/4423

This attempts to work around the problem by explicitly passing:

    --target x86_64-unknown-linux-gnu
2022-11-13 23:21:24 -05:00
Tony Arcieri
081f632d91
Implement simplified backend selection (#428)
As proposed in #414, this commit changes the backend selection approach,
introspecting `target_pointer_width` to select `u32_backend` vs
`u64_backend` (or `fiat_u32_backend`/`fiat_u64_backend` if the
`fiat_backend` feature is enabled).

This helps eliminate the use of non-additive features, and also the
rather confusing errors that happen if multiple backends are selected
(i.e. thousands of lines of rustc errors).

The selection logic checks if `target_pointer_width = "64"` and uses the
64-bit backend, or falls back to the 32-bit backend otherwise. This
means the crate will always have a valid backend regardless of the
pointer width, although there may be odd edge cases for exotic platforms
which would optimally use the 64-bit backend but have a non-"64" target
pointer width for whatever reason. We can handle those cases as they
come up.
2022-11-13 12:17:42 -05:00
Michael Rosenberg
8fa201639a
Fix AVX2 and AVX-512 builds (#419)
Build was broken by 5758b8c.
This adds a regression test to CI so it doesn't happen again
2022-10-28 13:10:44 -04:00
Michael Rosenberg
3a94bf8a8e
Cherry-picked Github actions from 1f9e527 2022-10-28 12:15:50 -04:00
Michael Rosenberg
5758b8cce1
Updated to edition 2021 (#413) 2022-10-18 13:45:59 -04:00
Michael Rosenberg
51572dae8d
Relax zeroize dependency and bump MSRV (#412) 2022-10-17 15:08:34 -04:00
Isis Lovecruft
ee0c6baa45
Add Github action to test with nightly compilers. 2021-09-23 21:13:26 +00:00
Isis Lovecruft
897f526d42
Run Github actions on any push, and PRs to main and develop. 2021-08-04 01:20:15 +00:00
Henry de Valence
6b37b25563
Add Github Actions
This replaces the Travis CI workflows.

(cherry picked from commit d66a5a81f87dae29d0bb1a41bec26c57e6909c28)
Signed-off-by: Isis Lovecruft <isis@patternsinthevoid.net>

I discarded the portion of the original commit which removed TravisCI.
2021-08-04 01:14:27 +00:00