mirror of https://github.com/poanetwork/hbbft.git
removed the obsolete Bls12 type parameters
This commit is contained in:
parent
5778cedb1c
commit
4c2e92e63d
|
@ -6,7 +6,6 @@ use std::rc::Rc;
|
||||||
use std::{cmp, iter};
|
use std::{cmp, iter};
|
||||||
|
|
||||||
use bincode;
|
use bincode;
|
||||||
use pairing::bls12_381::Bls12;
|
|
||||||
use rand;
|
use rand;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
@ -55,11 +54,11 @@ pub struct HoneyBadger<Tx, NodeUid> {
|
||||||
/// Received decryption shares for an epoch. Each decryption share has a sender and a
|
/// Received decryption shares for an epoch. Each decryption share has a sender and a
|
||||||
/// proposer. The outer `BTreeMap` has epochs as its key. The next `BTreeMap` has proposers as
|
/// proposer. The outer `BTreeMap` has epochs as its key. The next `BTreeMap` has proposers as
|
||||||
/// its key. The inner `BTreeMap` has the sender as its key.
|
/// its key. The inner `BTreeMap` has the sender as its key.
|
||||||
received_shares: BTreeMap<u64, BTreeMap<NodeUid, BTreeMap<NodeUid, DecryptionShare<Bls12>>>>,
|
received_shares: BTreeMap<u64, BTreeMap<NodeUid, BTreeMap<NodeUid, DecryptionShare>>>,
|
||||||
/// Decoded accepted proposals.
|
/// Decoded accepted proposals.
|
||||||
decrypted_selections: BTreeMap<NodeUid, Vec<u8>>,
|
decrypted_selections: BTreeMap<NodeUid, Vec<u8>>,
|
||||||
/// Ciphertexts output by Common Subset in an epoch.
|
/// Ciphertexts output by Common Subset in an epoch.
|
||||||
ciphertexts: BTreeMap<u64, BTreeMap<NodeUid, Ciphertext<Bls12>>>,
|
ciphertexts: BTreeMap<u64, BTreeMap<NodeUid, Ciphertext>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Tx, NodeUid> DistAlgorithm for HoneyBadger<Tx, NodeUid>
|
impl<Tx, NodeUid> DistAlgorithm for HoneyBadger<Tx, NodeUid>
|
||||||
|
@ -228,7 +227,7 @@ where
|
||||||
sender_id: &NodeUid,
|
sender_id: &NodeUid,
|
||||||
epoch: u64,
|
epoch: u64,
|
||||||
proposer_id: NodeUid,
|
proposer_id: NodeUid,
|
||||||
share: DecryptionShare<Bls12>,
|
share: DecryptionShare,
|
||||||
) -> HoneyBadgerResult<()> {
|
) -> HoneyBadgerResult<()> {
|
||||||
if let Some(ciphertext) = self
|
if let Some(ciphertext) = self
|
||||||
.ciphertexts
|
.ciphertexts
|
||||||
|
@ -265,8 +264,8 @@ where
|
||||||
fn verify_decryption_share(
|
fn verify_decryption_share(
|
||||||
&self,
|
&self,
|
||||||
sender_id: &NodeUid,
|
sender_id: &NodeUid,
|
||||||
share: &DecryptionShare<Bls12>,
|
share: &DecryptionShare,
|
||||||
ciphertext: &Ciphertext<Bls12>,
|
ciphertext: &Ciphertext,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let sender: u64 = *self.netinfo.node_index(sender_id).unwrap() as u64;
|
let sender: u64 = *self.netinfo.node_index(sender_id).unwrap() as u64;
|
||||||
let pk = self.netinfo.public_key_set().public_key_share(sender);
|
let pk = self.netinfo.public_key_set().public_key_share(sender);
|
||||||
|
@ -405,7 +404,7 @@ where
|
||||||
cs_output: BTreeMap<NodeUid, Vec<u8>>,
|
cs_output: BTreeMap<NodeUid, Vec<u8>>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
for (proposer_id, v) in cs_output {
|
for (proposer_id, v) in cs_output {
|
||||||
let mut ciphertext: Ciphertext<Bls12>;
|
let mut ciphertext: Ciphertext;
|
||||||
if let Ok(ct) = bincode::deserialize(&v) {
|
if let Ok(ct) = bincode::deserialize(&v) {
|
||||||
ciphertext = ct;
|
ciphertext = ct;
|
||||||
} else {
|
} else {
|
||||||
|
@ -450,7 +449,7 @@ where
|
||||||
fn verify_pending_decryption_shares(
|
fn verify_pending_decryption_shares(
|
||||||
&self,
|
&self,
|
||||||
proposer_id: &NodeUid,
|
proposer_id: &NodeUid,
|
||||||
ciphertext: &Ciphertext<Bls12>,
|
ciphertext: &Ciphertext,
|
||||||
) -> BTreeSet<NodeUid> {
|
) -> BTreeSet<NodeUid> {
|
||||||
let mut incorrect_senders = BTreeSet::new();
|
let mut incorrect_senders = BTreeSet::new();
|
||||||
if let Some(sender_shares) = self
|
if let Some(sender_shares) = self
|
||||||
|
@ -555,7 +554,7 @@ pub enum MessageContent<NodeUid> {
|
||||||
/// A decrypted share of the output of `proposer_id`.
|
/// A decrypted share of the output of `proposer_id`.
|
||||||
DecryptionShare {
|
DecryptionShare {
|
||||||
proposer_id: NodeUid,
|
proposer_id: NodeUid,
|
||||||
share: DecryptionShare<Bls12>,
|
share: DecryptionShare,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue