1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

// #![deny(missing_docs)]
#[cfg(any(
    all(feature = "ed25519", feature = "blsttc"),
    all(feature = "bad_crypto", feature = "ed25519"),
    all(feature = "bad_crypto", feature = "blsttc"),
    not(any(feature = "ed25519", feature = "blsttc", feature = "bad_crypto"))
))]
compile_error!("Must enable either `ed25519`, `blsttc` or `bad_crypto` feature flags");

pub mod brb_membership;

#[cfg(feature = "bad_crypto")]
pub mod bad_crypto;
#[cfg(feature = "blsttc")]
pub mod blsttc;
#[cfg(feature = "ed25519")]
pub mod ed25519;

pub use crate::brb_membership::{Ballot, Generation, Reconfig, SignedVote, State, Vote, VoteMsg};

#[cfg(feature = "bad_crypto")]
pub use crate::bad_crypto::{PublicKey, SecretKey, Signature};
#[cfg(feature = "blsttc")]
pub use crate::blsttc::{PublicKey, SecretKey, Signature};
#[cfg(feature = "ed25519")]
pub use crate::ed25519::{PublicKey, SecretKey, Signature};

pub mod error;
pub use crate::error::Error;
pub type Result<T> = std::result::Result<T, Error>;