Commit Graph
28 Commits
Author SHA1 Message Date
daxpeddaandGitHub 1af4f470c3 Update to curve25519-dalek pre-release (#61) 2022-02-14 12:54:03 -08:00
daxpeddaandGitHub 9eee936140 Move to ZeroizeOnDrop (#54)
* Move from `Zeroize` to `ZeroizeOnDrop`

* Pin pre-release dependencies
2022-01-28 03:37:55 -08:00
daxpeddaandGitHub b59b359aa3 General improvements (#56)
* Apply Rust traits to all public types and other improvements

* Move methods into appropriate section

* Check for zero scalars

* Change element and scalar de/serialization from `GenericArray` to slice

* Customize `serde` serialization
2022-01-27 16:38:17 -08:00
daxpeddaandGitHub b01b8ed409 Document all Errors (#55)
* Document all `Error`s

* Fix inaccuracies
2022-01-24 20:55:02 -08:00
daxpeddaandGitHub 16e072dcd4 Group trait overhaul part 2 (#53)
* Rely on elliptic-curve for hash-to-curve and P-256 implementations

* Update MSRV

* Remove unnecessary `#[macro_use]`

* Re-introduce `CipherSuite`

* Provide types for length shortcuts

* Remove `SUITE_ID` from `Group`

* Blanket implementation for RustCrypto `Curve`s

* Remove the p256 crate feature

* Rename `ristretto_*` crate features to `ristretto-*` for consistency

* Remove unnecessary allowed Clippy lints

* Remove some unnecessary constraints
2022-01-21 13:52:09 -08:00
daxpeddaandGitHub 652fd1d1d0 Group trait overhaul (#52)
* Decouple element from `Group`

* Change `SUITE_ID` to `u16` and rework `get_context_string()`

* Rework scalar de-serialization

* Rename `Group` methods

- `random_nonzero_scalar` -> `random_scalar`
- `scalar_as_bytes` -> `serialize_scalar`
- `scalar_invert` -> `invert_scalar`

* Rework element de-serialization

* Rename and remove `Group` methods

`to_arr` -> `serialize_elem`
`base_point` -> `base_elem`
`is_identity` -> removed
`identity` -> `identity_elem`
`zero_scalar` -> hidden behind `cfg(test)`

* Sort `Group` methods

* Rework `expand_message_xmd` and remove utility

* Improve P256 `hash_to_scalar`
2022-01-18 03:34:28 -08:00
daxpeddaandGitHub e7675437e6 Embrace digest::Output (#51) 2022-01-03 15:45:05 -08:00
daxpeddaandGitHub d316ce4c8d batch_evaluate without alloc (#48)
* `no_alloc` alternative to `VerifiableServer::batch_evaluate()`

* Rename `PreparedT` to `PreparedTscalar`
2021-12-29 03:14:28 -05:00
daxpeddaandGitHub 1c5e965446 Reduce version requirement (#50) 2021-12-28 06:18:14 -05:00
daxpeddaandGitHub 55ef981a3f General Improvements (#47)
* Introduce `Result` shorthand, re-export and rename `InternalError`

* Re-export some public API relevant types

* Move `deserialize`

* Remove branch in `i2osp`

* Make `serialize` and `serialize_owned` methods

* Update p256
2021-12-25 16:54:27 -05:00
daxpeddaandGitHub b2f6d5eac8 Update to digest 0.10 (#36) 2021-12-23 15:58:00 -05:00
daxpeddaandGitHub 5228474f05 Remove custom Serde implementation (#44)
* Serialize `BlindedElement` as `GenericArray`

* Don't hold input

* Remove allocations from `VerifiableClient::batch_finalize`

* Remove all allocation from serialization

* Remove required `alloc` support.

* Fix accidental usage of 1.57 API

* Let `VerifiableClient::batch_finalize` return a concrete type

* Simplify de-serialization

* Remove custom Serde implementation
2021-12-23 15:03:38 -05:00
daxpeddaandGitHub 6669a0c4e6 Introduce ristretto255 crate feature (#35) 2021-12-23 01:50:48 -05:00
daxpeddaandGitHub 140f9e063d Configure Rustfmt and Taplo (#38)
* Configure rustfmt

* Add Taplo configuration and run in CI
2021-12-22 19:17:03 -05:00
daxpeddaandGitHub 4700d4b725 Add Dependabot (#37) 2021-12-21 14:17:13 -05:00
daxpeddaandGitHub b1b315f23c General improvements (#34)
* Minor improvements

* Fix `Debug` implementation

* Fix de-serialization

* Fix accidental usage of nightly

* Fix MSRV warning

* Replace macro with derive-where

* Add `rust-version` into `Cargo.toml`

* Move Serde trait implementation macro to `serialization` module

* Add ability to test without a Ristretto backend

* Improve docs

* Fix testing multiple backends together

* Implement `Ord` and `PartialOrd`

* `no_std` by default

* Remove unnecessary `doc_cfg`

* Remove dev-dependency on self

* Implement `Ord` and `PartialOrd` for `InternalError`

* Remove base64 encoding for serde

* Only take references

* Remove unnecessary qualifications from super-trait times
2021-12-21 14:17:02 -05:00
daxpeddaandGitHub 7613610859 Add cargo-audit to CI (#40) 2021-12-21 14:15:34 -05:00
daxpeddaandGitHub 14830f1436 Remove allocations by serialize (#29)
* Changed `expand_message_xmd` input to `Iterator`

* Changed `hash_to_scalar` input to `Iterator`

* Fix rustfmt

* Add documentation for private helper types

* Fix documentation

* Improve `chain!()` syntax bias

* Move helper functions to `mod util`
2021-10-15 16:56:21 -07:00
daxpeddaandGitHub de91fafdb3 Group improvements (#28)
* Implement `ConstantTimeEq` for `Group` and `Group::Scalar`

* Changed `expand_message_xmd` `dst` parameter to `GenericArray<u8, D>`

* Remove allocation for `dst_prime` in `expand_message_xmd`

* Remove allocation for `msg_prime` and `b` in `expand_message_xmd`

* Remove unnecessary references in `expand_message_xmd`

* Return `GenericArray` from `expand_message_xmd`

* Oxidize loop in `expand_message_xmd`

* Remove allocation for `b` in `expand_message_xmd`

* Remove allocation for `xor`

* De-duplicate code in `expand_message_xmd`

* Remove unnecessary features

* Make ristretto optional and export all backends

* Make `rand` optional

* Fix wrong documentation

* Document `rand` feature

* Remove empty line

* Fix rustfmt

* Fix testing with other backends

* Iterate by value in `expand_message_xmd`

* Fix typo

* Rename `ristretto_x` features to `ristretto255_x`

* Remove `rand` re-export

* Improve `expand_message_xmd` loop

* Remove unnecessary `#[doc(cfg())]`

* Remove unnecessary `pub(crate)` for `mod p256`

* Fix `p256` only build

* Rename `serialize` feature to `serde`

* Fix missing `Cargo.toml` update
2021-10-14 11:09:00 -07:00
daxpeddaandGitHub 5ac52388ff Reduce allocations and some general code improvements (#26)
* Remove unnecessary paths

* Remove unnecessary conversion for `G::from_scalar_slice`

* Remove unnecessary allocations

* Return `GenericArray` from `get_context_string`

* Use `zip()` instead instead of indexing

* Changed `compute_composites` input to `Iterator`s

* Changed `generate_proof` input to `Iterator`s

* Changed `verify_proof` input to `Iterator`s

* Reduce allocations in `verifiable_unblind`

* Changed `verifiable_unblind` input to `Iterator`s

* Changed `batch_finalize` input to `Iterator`s
Removed `BatchFinalizeInput`

* Reduce allocations in `VerifiableClient::finalize`

* Changed `finalize_after_unblind` input to `Iterator`s

* Changed `batch_evaluate` input to `Iterator`s

* Reduce allocations in `evaluate`

* Changed `blind` input to `Into<Vec<u8>>`

* Remove note about `BatchFinalizeInput` from documentation

* Remove `Metadata`

* Changed `blind` input to `Vec<u8>`

* General improvements to test code

* Fix rustdoc

* Remove unnecessarily installed components
2021-10-12 15:07:47 -07:00
fab7528a69 Improvements (#24)
* Remove manual `Debug` impl for `InternalError`

* Remove unnecessary `#[macro_use]`

* Remove unnecessary  `tuple` handling in macro

* Improve serialization macro impl

* Improve `impl_traits_for` macro

* Re-direct `Drop` implementation

* Improve macro readability

* Fix rustdoc warnings

* Rust 1.51 has no support for `rustdoc` lints

* Change `i2osp` output to `GenericArray` from `Vec`

* Reduce calls to `to_vec()` and simplify conversion

* Adding zeroize tests

Co-authored-by: Kevin Lewi <[email protected]>
2021-10-10 17:51:12 -07:00
daxpeddaandGitHub c93600498e Add clippy::cargo and remove dependencies (#23) 2021-10-05 17:52:08 -07:00
daxpeddaandGitHub 6fb4cad59c Remove CipherSuite (#20)
* Remove `Hash`

* Remove `CipherSuite`

* Remove single field `struct`s
2021-10-05 15:53:18 -07:00
daxpeddaandGitHub 2d8780476a Use Clippy on test code too (#22) 2021-10-05 15:19:20 -07:00
daxpeddaandGitHub a3db6cd9d2 P256 improvements (#21)
* P256 improvements

* Fix Rust 1.51 compilation
2021-10-04 13:50:29 -07:00
daxpeddaandGitHub a1ab892bdb P256 improvements (#18) 2021-09-30 14:00:58 -07:00
daxpeddaandGitHub ad04f224af Improve documentation on docs.rs (#17) 2021-09-30 14:00:32 -07:00
daxpeddaandGitHub 7be67b26de Re-export simd_backend (#19) 2021-09-30 12:34:29 -07:00