Skip to content

Commit

Permalink
Test the reordering attack on BinaryAgreement using net framework
Browse files Browse the repository at this point in the history
  • Loading branch information
d33a94975ba60d59 committed Oct 27, 2018
1 parent 45ce045 commit 04b224e
Show file tree
Hide file tree
Showing 5 changed files with 471 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/binary_agreement/binary_agreement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use {DistAlgorithm, NetworkInfo, NodeIdT, Target};
/// The state of the current epoch's coin. In some epochs this is fixed, in others it starts
/// with in `InProgress`.
#[derive(Debug)]
enum CoinState<N> {
pub enum CoinState<N> {
/// The value was fixed in the current epoch, or the coin has already terminated.
Decided(bool),
/// The coin value is not known yet.
Expand All @@ -20,7 +20,7 @@ enum CoinState<N> {

impl<N> CoinState<N> {
/// Returns the value, if this coin has already decided.
fn value(&self) -> Option<bool> {
pub fn value(&self) -> Option<bool> {
match self {
CoinState::Decided(value) => Some(*value),
CoinState::InProgress(_) => None,
Expand Down
5 changes: 3 additions & 2 deletions src/binary_agreement/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ use rand;
use self::bool_set::BoolSet;
use threshold_sign;

pub use self::binary_agreement::BinaryAgreement;
pub use self::binary_agreement::{BinaryAgreement, CoinState};
pub use self::sbv_broadcast::Message as SbvMessage;

/// An Binary Agreement error.
#[derive(Clone, Eq, PartialEq, Debug, Fail)]
Expand Down Expand Up @@ -146,7 +147,7 @@ impl rand::Rand for MessageContent {
}

#[derive(Clone, Debug)]
struct Nonce(Vec<u8>);
pub struct Nonce(Vec<u8>);

impl Nonce {
pub fn new(
Expand Down
Loading

0 comments on commit 04b224e

Please sign in to comment.