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
Michael Rosenberg
01672bfc63
Applied @pinkforest's patch to make make doc build on non-x86_64 arches
2022-11-26 13:53:51 -05:00
Michael Rosenberg
791ba170b1
Cleanup: enabled doc_auto_cfg and doc_cfg_hide
2022-11-26 06:34:48 -05:00
pinkforest
289cc52fef
Document backend mod as INTERNALS:
2022-11-26 22:20:18 +11:00
Michael Rosenberg
a35ca1e9cf
Added cfg_attr everywhere possible, and simplified cfg over std/alloc
2022-11-26 05:53:28 -05:00
pinkforest
ad7c755f49
Documentation migrate to docs.rs hosted
...
This change migrates all the documentation from dalek.rs
to docs.rs hosted and fixed the backend documentation
generation that was broken.
2022-11-26 11:26:25 +11:00
Michael Rosenberg
969940e954
Wibble
2022-11-24 02:37:07 -05:00
Michael Rosenberg
a743ea5348
Fixed doc warnings
2022-11-24 02:37:05 -05:00
Tony Arcieri
f88cf6836b
Use include_str! for .md inclusion in rustdoc ( #434 )
...
Previously a now-removed nightly-only feature was used, but now that
it's stable, `include_str!` can be used for all of these cases.
2022-11-14 00:22:50 -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
d2bf310330
cargo fmt
2022-10-28 17:00:24 -04:00
Michael Rosenberg
a959787c2e
Added more #[rusfmt::skip]
2022-10-28 16:58:40 -04:00
Michael Rosenberg
95b368a431
Whitespace formatting fixes on the [rustfmt::skip] functions
2022-10-28 16:32:45 -04:00
Michael Rosenberg
6d906bb70c
Added #[rustfmt::skip] where necessary
2022-10-28 13:51:20 -04:00
Michael Rosenberg
a32f56ba36
Undid the bad reformatting job from 5758b8c
2022-10-28 13:22:49 -04: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
5758b8cce1
Updated to edition 2021 ( #413 )
2022-10-18 13:45:59 -04:00
Isis Lovecruft
b9710d59f2
Minor documentation fixes.
2021-08-03 22:49:09 +00:00
isis agora lovecruft
5eca140010
Merge pull request #351 from isislovecruft/fix/cleanup-elligator
...
Trivial cleanups to Elligator2 encoding
2021-04-13 23:31:14 +00:00
isis agora lovecruft
cecc821f40
Merge pull request #342 from huitseeker/fiat4_with_u32
...
Serial backends w/formally-verified field arithmetic for 32 & 64 bits
2021-04-13 23:23:41 +00:00
Isis Lovecruft
ee90202a58
Trivial cleanups to Elligator2 encoding.
...
cf. https://github.com/dalek-cryptography/curve25519-dalek/pull/336
2021-04-13 00:24:50 +00:00
Isis Lovecruft
1491f0db36
Update copyright years.
2021-03-25 04:10:55 +00:00
isis agora lovecruft
b79a276806
Merge pull request #336 from huitseeker/elligator2
...
Elligator2 mapping for curve25519
2021-03-25 03:13:41 +00:00
zgfzgf
08bf6ebf08
fix build warning
2021-02-03 17:46:01 +08:00
François Garillot
abd1922456
Add a fiat_u32 backend based on fiat-crypto as well.
...
Renames fiat backend directory to fiat_u64 and does the additional plumbing required to make fiat_{u32, u64}_backend equal alternatives.
Adds a few comments.
2021-01-11 15:45:24 -08:00
François Garillot
a9e50eab36
implement conditional assign with fiat__25519_cmovznz_u64
2021-01-11 09:30:30 -08:00
François Garillot
4ce680d3aa
Update the fiat backend to use the fiat-crypto package
...
https://crates.io/crates/fiat-crypto
2021-01-11 09:30:30 -08:00
François Garillot
d684e13f09
Add a fiat_u64_backend option to curve25519-dalek
...
This uses https://github.com/calibra/rust-curve25519-fiat/ to implement a new 64bit serial backend for dalek.
Co-authored-by: Zoe Parakevopoulou <zoopar@fb.com>
2021-01-11 09:30:07 -08:00
Isis Lovecruft
77ec974212
Whitespace fixes for 3267a5d merge.
2021-01-08 00:33:37 +00:00
Isis Lovecruft
3267a5d75d
Merge remote-tracking branch '3for/comment-fix' into develop
2021-01-08 00:27:34 +00:00
François Garillot
8aa1458941
Implements an Elligator2 map for Curve25519
...
This implementation:
- is agnostic on the hash used to pick a field element, even though SHA512 is commonly used,
- follows https://tools.ietf.org/id/draft-irtf-cfrg-hash-to-curve-10.html closely
- tests the outputs of the function using libsignal's implementation.
2020-10-21 17:38:22 -04:00
Stephane Raux
608f8cd594
Make crate feature alloc work with stable Rust
...
`println!` was removed in the test as the corresponding test for `u32` does not have it.
2020-10-20 18:15:00 -07:00
Isis Lovecruft
4423394ed8
Fix warning that a temporary value isn't used.
2019-10-28 19:12:00 +00:00
Trangar
ae4bf40e28
Added constants to reduce recalculations in elligator_risteretto_flavor
2019-10-28 11:48:33 +01:00
Henry de Valence
d0ea313e99
Remove broken impl Zeroize for FieldElement2625x4.
...
This implementation is broken because the packed_simd types don't implement `Zeroize`.
2019-10-25 15:38:50 -07:00
Tony Arcieri
9480844b8d
Switch from clear_on_drop to zeroize ( fixes #281 )
...
`zeroize` is WASM-friendly as it has no dependencies on C compilers.
Instead uses Rust's own volatile write semantics and compiler fences to
ensure zeroization is not elided by the compiler.
2019-10-23 16:39:21 -07:00
Henry de Valence
620d17ef40
Merge pull request #293 from dalek-cryptography/remove-build-rs
...
Remove build.rs constants generation.
2019-10-23 14:44:46 -07:00
Henry de Valence
574217694e
Remove build.rs.
...
This was more useful at the time when we were determining, e.g., optimal lookup
table sizes and could regenerate them more easily, but it came at a massive
complexity cost. It also meant that we were unable to implement backend
autoselection. This commit removes the `build.rs` entirely. In the future, a
different `build.rs` could be added that auto-selects a backend, but it seems
like the current default-u64 setup has been working fine.
2019-10-23 14:20:38 -07:00
Isis Lovecruft
7c5ba69491
Update copyright year.
2019-10-23 19:43:56 +00:00
Isis Lovecruft
028c0b9d4d
Fix typo in 64-bit scalar implementation code comment.
2019-10-23 19:35:57 +00:00
François Garillot
9785f56c0f
Rust fixes for some clippy warnings
...
Clippy lints with instances in the project but NOT applied here, since they seem consistently at odds with the projects' style:
- [unreadable literal](https://rust-lang.github.io/rust-clippy/master/#unreadable_literal )
- [cast lossless](https://rust-lang.github.io/rust-clippy/master/#cast_lossless )
- [assign op pattern](https://rust-lang.github.io/rust-clippy/master/#assign_op_pattern )
2019-10-05 12:02:08 -07:00
François Garillot
023fdf2a2c
Rust added support for the ? operator on Option in 1.22
...
This converts a few instances of an early-returning unwrap to it.
2019-10-05 11:44:36 -07:00
root
2d0c5323cb
errata and basepoint_odd_lookup_table test for better understanding
2019-09-04 13:15:09 +08:00
root
8da05f7e90
errata and basepoint_odd_lookup_table test for better understanding
2019-09-04 12:38:02 +08:00
root
f6015c66c2
errata for comment
2019-09-03 10:38:23 +08:00
Henry de Valence
cfa09d859f
Use upstream IFMA intrinsics now that they exist.
2019-08-06 17:14:31 -07:00
Pratyush Mishra
912fe4794f
Fix link to AVX2 and IFMA docs
2019-08-06 16:53:54 -07:00
Henry de Valence
5c18bfb6a7
Update doc(include) paths.
...
Since https://github.com/rust-lang/rust/pull/60938 the path root changed and
these new paths are required to compile on nightly.
Closes #268 .
2019-07-31 14:54:24 -07:00
Daan Sprenkels
e4c086ab59
Fix a typo in AVX2
...
Last two (least significant) limbs should be `z8`, `z9`. Were probably
copy-paste typos.
2019-07-22 14:17:23 +02:00