Andreas Fackler
c486b93631
Make several types Ord, PartialOrd.
...
Also fixes some new Clippy and rustfmt issues and extends documentation.
6 years ago
Sebastian Geisler
7a077846c9
Add documentation to secret keys pointing to SerdeSecret
6 years ago
David Irvine
43f615c953
Cargo fix update. Also update dependencies, minus lazy static due to issues with criterion.
6 years ago
Andreas Fackler
dbb9fae896
Version 0.3.0
6 years ago
Andreas Fackler
9ab09897bd
Update docs.rs link.
6 years ago
Andreas Fackler
8b6fa87cdc
Export serde_impl::FieldWrap.
6 years ago
Andreas Fackler
a14e7d1867
Migrate to rand 0.6.
6 years ago
Andreas Fackler
1b1df40c67
Upgrade to Rust 1.31.0 and edition 2018.
6 years ago
Andreas Fackler
c2d63b214a
Add missing_docs lint, extend docs.
6 years ago
Andreas Fackler
c7eda7a14a
Make serialization less wasteful.
...
This removes the unneeded length from key and signature representation,
removing 8 bytes from each. Also adds `from_bytes` and `to_bytes`
methods to convert keys and signatures.
6 years ago
Andreas Fackler
05cde32d01
Instead of macro_use, use use.
7 years ago
Andreas Fackler
1d613c2113
Make hash_g2 public.
...
This function can be useful, to avoid redundant hashing of a long message.
7 years ago
Andreas Fackler
29b40fffa7
Use hex_fmt 0.2.0.
7 years ago
Andreas Fackler
2ca1d2ef7d
Fix negative overflow, add interpolation test. ( #52 )
7 years ago
Andreas Fackler
20de873356
Replace HexBytes with the hex_fmt crate.
7 years ago
Marc Brinkmann
d133bb6d79
Mocktography ( #49 )
...
Added mocktography (feature `use-insecure-test-only-mock-crypto) and factored out CI execution script.
7 years ago
Andreas Fackler
d9da30835f
Reorder: public imports come last.
7 years ago
Andreas Fackler
3d324bb8d7
Optimize polynomial interpolation in the curve.
...
Slightly reduce the number of multiplication and division operations in
the scalar field.
7 years ago
Andreas Fackler
214e5f81cf
Remove try_ methods.
7 years ago
Andreas Fackler
ad11ceaed6
Remove mlock.
...
It currently causes too many problems to be practical. We will re-enable
it once we have a dedicated allocator for locked memory.
7 years ago
Andreas Fackler
191cf0b741
Reexport pairing.
...
Since we are reexporting some of the pairing types, we should also
export pairing itself, to make all the matching traits available and
avoid version conflicts.
7 years ago
Andreas Fackler
0efdad4d69
Prepare for adding mock cryptography for testing.
...
* Add a feature flag (that doesn't do anything yet).
* Give `clear_fr` a stronger type to prevent mistakes and ensure the
right amount of memory gets cleared.
* Re-export the engine and related types from `lib.rs`.
7 years ago
Marc Brinkmann
d69590bedc
Convert all uses of `Bls12` and friends to refer to root `lib.rs` instead of importing from pairing directly.
7 years ago
Andreas Fackler
84e8b69a24
Validate polynomial degrees: fix panics.
7 years ago
Andreas Fackler
0bb41bd990
Merge xor_vec and hash_bytes.
...
They are only used together, and the API of `xor_vec` is a bit dangerous
since it silently stops at the minimum of the two arguments' lengths.
7 years ago
Marc Brinkmann
3645668bff
Add an API that allows specifying the RNG to be used for encryption.
7 years ago
DrPeterVanNostrand
5f09f96345
Added type for clearing temporary values.
7 years ago
DrPeterVanNostrand
72d1c607f8
Added 'try_' constructors to secret types.
7 years ago
Andreas Fackler
a03d258e9d
Use Formatter debug helpers. Hide SecretKeyShares.
...
Output "..." in the `Debug` implementation of `SecretKeyShare`, to make
it consistent with `SecretKey`.
7 years ago
Marc Brinkmann
a7cd6e0529
Update to Rust `beta` channel.
7 years ago
DrPeterVanNostrand
69ff326430
Added env-var 'MLOCK_SECRETS' to disable memory locks.
7 years ago
DrPeterVanNostrand
8f6dce18f2
Added mlocking for secret types.
7 years ago
Andreas Fackler
2d17d0e783
Replace ring with tiny-keccak.
7 years ago
Vladimir Komendantskiy
bf98f1271f
removed protobuf support
7 years ago
Vladimir Komendantskiy
b7ab849a16
converted errors from error_chain to failure
7 years ago
Vladimir Komendantskiy
394e4ce140
separated crypto module from hbbft crate
7 years ago
Andreas Fackler
da3bc0b930
Remove output and message queue from HoneyBadger.
7 years ago
Andreas Fackler
23e8ebe967
Accept more types in threshold crypto API.
...
This removes some unnecessary allocation and conversion by accepting
more primitive types and references as the index in threshold decryption
and signing, and as the argument to a polynomial.
7 years ago
Andreas Fackler
a78a14fa9d
Separate keys and key shares.
7 years ago
c0gent
368430be1c
Add `Copy` to `PublicKey` derived impls.
7 years ago
Peter van Nostrand
77a5829c1d
Replaced clear-on-drop with 'std::ptr::write_volatile'.
7 years ago
Marc Brinkmann
8af4b502ae
Added `RandomAdversary` and the necessary auxiliary functions.
...
Random adversaries are created for `broadcast` and `honey_badger`. Random value generation was added for all type-dependencies of these algorithms, causing the `Rand` trait to be implement for a large portion of the codebase.
Additionally, `MessageWithSender` turned into an actual struct, making it much easier to handle. Tuple-like construction is still available through `MessageWithSender::new()`.
7 years ago
Andreas Fackler
1f3768f2b6
Add coin docs, change parity computation.
...
This makes the signature parity computation take into account all bits,
not just the last one of each byte.
7 years ago
Marc Brinkmann
b7d12585f8
Implemented `Rand` for `SecretKey`.
7 years ago
Andreas Fackler
51b87b8bae
Add node transaction messages to Dynamic HB.
7 years ago
Andreas Fackler
c0cef3b50b
Avoid redundant key computations.
7 years ago
Andreas Fackler
e3a401bcb9
Make SyncKeyGen NodeUid-aware.
...
This allows the caller to address nodes by ID instead of by index.
Also contains a few other minor changes that will be needed for
`DynamicHoneyBadger`.
7 years ago
Vladimir Komendantskiy
17fdffa90f
threshold encryption of proposals in HoneyBadger
7 years ago
Andreas Fackler
0c66e16010
Remove generic E: Engine from crypto.
7 years ago
Andreas Fackler
81cbe5a63b
Implement SyncKeyGen.
...
This is a _synchronous_ key generation algorithm. We will use it in
`DynamicHoneyBadger`, on top of `HoneyBadger` to satisfy the synchrony
requirements.
It can also be used independently e.g. on top of a blockchain.
7 years ago