Commit Graph

73 Commits

Author SHA1 Message Date
Andreas Fackler d52be00d0e Fix CI.
Fix a few new Clippy lints, and some broken dependencies.
2020-03-20 10:37:31 +01:00
Weiliang Li e43baa4b8b fix some clippy warnings 2019-11-12 11:12:47 +01:00
Weiliang Li d6ffccc06e update tiny-keccak 2019-11-12 11:12:47 +01:00
Weiliang Li 41a955906b rev instead of branch in Cargo.toml 2019-11-12 11:12:47 +01:00
Weiliang Li 0132ee5dd3 Update Cargo.toml 2019-11-12 11:12:47 +01:00
Weiliang Li 7c213fed71 update Cargo.toml 2019-11-12 11:12:47 +01:00
Andreas Fackler 0e50c2f473 Remove non-threshold keys from NetworkInfo. 2019-08-27 20:51:24 +02:00
Andreas Fackler 4b2cff8db7 Increase the Travis timeout. 2019-07-29 12:08:54 +02:00
Andreas Fackler 15f7313706 Extract test framework into hbbft_testing crate. (#404)
* Extract test framework into hbbft_testing crate.

Also update Rust and some dependencies.

* Rename DHB tests.

They are only called `net_dynamic_hb` because we used to have two test
frameworks and two DHB test modules.
2019-04-26 15:54:11 +01:00
Vladimir Komendantskiy 89ba1f6799 using threshold_crypto 0.3.1 2019-04-02 12:42:51 +02:00
Vladimir Komendantskiy 10dbf705e4 using serde derive feature 2019-04-02 12:42:51 +02:00
Andreas Fackler a71611d8f2 Link to the security audit. Update dependencies. (#376)
* Link to the security audit.

* Update dependencies.
2019-01-07 15:16:18 +00:00
Andreas Fackler 108ac574bb Migrate to rand 0.6. (#368)
* Migrate to rand 0.6.

* Prefer SliceRandom where it makes sense.
2018-12-27 10:34:34 +01:00
Andreas Fackler 8689e6501e Remove impossible Reed-Solomon errors. 2018-12-18 09:58:59 +01:00
Demi Marie Obenour 7fb172cda2 Switch to 2018 edition idioms (#359)
* Switch to 2018 edition idioms

* Fix build with Rust 2018.

* Remove unnecessary cloning, make `max_faulty` const.

* Remove unneeded `extern crate` statements.
2018-12-11 14:44:36 +01:00
Vladimir Komendantskiy 99d01bf428
Update the crossbeam dependency to 0.5 (#361)
* updated crossbeam to 0.5

* removed an obsolete Clippy directive
2018-12-10 17:10:13 +00:00
Andreas Fackler 62686afa05 Add a no-simd feature.
This disables SIMD in reed-solomon-erasure to work around problems on
Android.
2018-11-07 11:48:02 +01:00
Andreas Fackler 6375decbc0 Use derivative for configurable Debug impls. (#283) 2018-10-24 13:01:52 +02:00
Andreas Fackler 6bcd6bc499 Replace Coin with ThresholdSign. (#280)
* Avoid redundant hashing in Coin.

* Return the full signature from Coin.

* Rename Coin to ThresholdSign.
2018-10-23 10:49:19 +01:00
Andreas Fackler b3e858a079
Use published threshold_crypto 0.2. (#278)
Also: Follow the soon-to-be-official formatting guidelines:
https://github.com/nrc/rfcs/blob/style-guide/style-guide/cargo.md
2018-10-20 13:42:41 +02:00
Andreas Fackler 8a84109c88 Use threshold_crypto 0.2.0-beta2 to fix overflow. (#273)
* Use threshold_crypto 0.2.0-beta1 to fix overflow.

* Upgrade to hex_fmt 0.2.

* Depend on threshold_crypto 0.2.0-beta2.

This avoids depending on two different versions of hex_fmt.
2018-10-17 12:04:13 +02:00
Andreas Fackler 13b0b04943 Update crypto, add mock crypto for testing. 2018-10-15 13:55:04 +02:00
Andreas Fackler 7345132066 Replace HexBytes with the hex_fmt crate. 2018-10-11 22:24:13 +02:00
c0gent 520083de2e Change license to MIT/Apache-2.0. 2018-10-04 23:32:14 -07:00
Marc Brinkmann 6f0b53436f
Fix test-case shrinking issues (#254)
* Use inverse of `is_bft` function for checking in `average_higher`.

* Inline in `NetworkDimension`.

* Check more invariants when averaging network sizes.

* Added test that finds shrinking regression of `NetworkDimension`.

* Use bijection for shrinking of network dimensions.

* Fix types on dimensions.

* Hide `size` and `faulty` behind accessor methods.

* Make limits dependant on input size.

* Fixed clippy lints.

* Simplify averaging.
2018-10-04 15:52:24 +02:00
Marc Brinkmann d2627272fe
Better proptest persistence through deterministic randomness. (#248)
* Add support for RNG instantiation in proptests.

* Use `proptest` module strategy to create the rng for `net_dynamic_honey_badger`.

* Use seed generation instead of RNG instantiation in tests.

* Remove fixed RNG in `generate_map`.

* `VirtualNet` now supports setting the random generator through the builder.

* Add missing `time_limit` field to `::std::fmt::Debug` trait implementation on `NetBuilder`.

* Pass an instantiated random number generator through `NewNodeInfo` as a convenience.

* Make the random number generator of `DynamicHoneyBadgerBuilder` configurable, at the cost of now requiring mutability to call `build_first_node()`.

* Ensure RNGs are derive from passed in seed in `net_dynamic_hb` tests.

* Correct inappropriate use of `random::Random` instead of `Rng::gen` to generate dependent values in `binary_agreement`.

The original implementation used `rand::random()`, which will always use the `thread_rng`, ignoring the fact that an RNG has actually been passed in.

* Do not use `OsRng` but passed in RNG instead.

* Use reference/non-reference passing of rngs more in line with the `rand` crates conventions.

* Document `rng` field on `DynamicHoneyBadger`.

* Make `SyncKeyGen` work with the extend (`encrypt_with_rng`) API of `threshold_crypto`.

* Use passed-in random number generator in `HoneyBadger`.

* Create `SubRng` crate in new `util` module to replace `create_rng()`.

* Use an RNG seeded from the configure RNG when reinitializing `DynamicHoneyBadger`.

* Use the correct branch of `threshold_crypto` with support for passing RNGs.
2018-10-02 16:24:51 +02:00
Andreas Fackler f743e4bc14 Update authors list. 2018-09-20 20:29:19 +02:00
Andreas Fackler 058044959f Remove itertools dependency. 2018-09-20 11:38:02 +02:00
Marc Brinkmann 23bc38bbeb Enable overflow-checks and fix a bug that slipped through during their absence. (#231)
* Fixed bug in `average_higher`, due to wrong assumptions about operator precendence.

* Enable overflow checks in `--release` tests.

This will hardly impact test performance, as the heavy lifting is done in the threshold crypto crate. Rough benchmarks showed significant differences only when `overflow-checks` was enable for `[profile.release]` (instead of `[profile.bench]`), causing it to be applied to `threshold_crypto` as well.
2018-09-13 12:03:12 +01:00
Marc Brinkmann 0266a4107c Network dimension strategy for property based tests. (#225)
* Added missing debug implementations for various test networking parts.

* Initial proptest parts added, including network dimensions.

* Use a test configuration for proptests.

* Tweaks and documentation.

* Improved documentation for `net_dynamic_hb` test.

* Added two missing `;`.

* Allow insane topology creation.

* Renamed `is_sane()` to `is_bft`, `halfway` to `average_higher` and improved comments per suggestions.

* Rename `NetworkTopology` -> `NetworkDimension`.

* Silence newly added clippy warning.

* Smoothed `README.md`.

* Remove workaround for beta/nightly again.

* Caved in to clippy and changed the bft condition.
2018-09-11 18:11:04 +01:00
DrPeterVanNostrand fb606332f6 Pinned threshold_crypto to version 0.1.0. 2018-08-30 10:52:16 -07:00
Andreas Fackler e4ddd6a079 Replace ring with tiny-keccak. 2018-08-10 09:23:27 +02:00
Andreas Fackler b90a7bf450 Replace merkle.rs with custom implementation. 2018-08-10 09:23:27 +02:00
Vladimir Komendantskiy 77ed1d50d4 separated crypto module into its own crate 2018-07-31 12:15:05 +01:00
Andreas Fackler 47c00016be Remove protobuf support. 2018-07-31 11:58:44 +02:00
c0gent 847a79793e
Replace `chain_error` with `failure`
Changes:

* Remove `error_chain` and convert errors to `failure` types.
* Add variants for each possible error generation point.
2018-07-30 15:14:19 -07:00
Andreas Fackler 9d0f1b3d15 Remove output and message queue from CommonSubset. 2018-07-24 13:12:06 +02:00
Peter van Nostrand 53a891380f Replaced clear-on-drop with 'std::ptr::write_volatile'. 2018-07-13 20:58:30 -04:00
Marc Brinkmann 5336fbe707 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()`.
2018-07-13 13:27:49 +02:00
Andreas Fackler 64e5f49b8d Add more authors to Cargo.toml. 2018-07-09 16:11:13 +02:00
Andreas Fackler fe47291709 Add recommended metadata to Cargo.toml
The Rust API guidelines recommend a set of metadata values:
https://rust-lang-nursery.github.io/api-guidelines/documentation.html#c-metadata
2018-07-04 13:00:36 +02:00
Peter van Nostrand 05da712c20 Added clear-on-drop secret-keys to 'NetworkInfo'. 2018-06-21 12:08:48 -04:00
Andreas Fackler 83f8d61402 Support serde by default.
This removes the `serialization-serde` feature, since serde is already
used internally and therefore a dependency anyway.
2018-06-20 10:21:52 +02:00
Andreas Fackler 6cc2302e61 Implement polynomials for distributed key generation. 2018-06-11 16:45:08 +02:00
Andreas Fackler 015381c88c Print messages and total message size per node in simulation. 2018-05-31 17:22:30 +02:00
Andreas Fackler f970272d3e Add bandwidth and CPU to the simulation. 2018-05-31 14:28:10 +02:00
Andreas Fackler 56ab6a5037 Simplify hash_g2. 2018-05-29 21:59:21 +02:00
Andreas Fackler 527b1c8c17 Use SHA256 and byteorder in hash_g2. 2018-05-29 17:59:50 +02:00
Andreas Fackler d999792234 Implement threshold signatures. 2018-05-29 17:06:02 +02:00
Peter van Nostrand 465f17d9a5 Bumped reed-solomon-erasure crate version, fixed Protobuf error in example. 2018-05-20 19:39:47 -04:00