Skip to content

Commit

Permalink
chore: bump blsttc from 3.1.0 to 5.1.0
Browse files Browse the repository at this point in the history
We also:

* bump rand from 0.7.3 to 0.8.5
* bump rand_core from 0.5.1 to 0.6.3
* bump xor_name from 3.0.0 to 4.0.0

These make us compatible with deps in blsttc.
  • Loading branch information
dan-da committed Mar 16, 2022
1 parent 58e26b0 commit bd0a0df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions Cargo.toml
Expand Up @@ -14,14 +14,15 @@ version = "0.9.1"
aes = "~0.7.4"
bincode = "1.2.1"
block-modes = "~0.8.1"
blsttc = "3.1.0"
blsttc = "5.1.0"
log = "~0.4.8"
rand = "~0.7.3"
rand_core = "~0.5.1"
rand = "~0.8.5"
rand_core = "~0.6.3"
serde = "1.0.106"
serde_derive = "1.0.106"
thiserror = "1.0.23"
xor_name = "3.0.0"
xor_name = "4.0.0"


[dependencies.tiny-keccak]
version = "2.0.2"
Expand Down
9 changes: 5 additions & 4 deletions src/key_gen/mod.rs
Expand Up @@ -17,8 +17,7 @@ mod tests;

use bincode::{self, deserialize, serialize};
use blsttc::{
ff::Field,
group::CurveAffine,
group::{ff::Field, prime::PrimeCurveAffine},
poly::{BivarCommitment, BivarPoly, Poly},
serde_impl::FieldWrap,
Fr, G1Affine,
Expand All @@ -33,6 +32,7 @@ use std::collections::{btree_map::Entry, BTreeMap, BTreeSet};
use std::{
fmt::{self, Debug, Formatter},
mem,
ops::{AddAssign, Mul},
};
use xor_name::XorName;

Expand Down Expand Up @@ -977,7 +977,7 @@ impl KeyGen {
let is_complete = |part: &&ProposalState| part.is_complete(self.threshold);
for part in self.parts.values().filter(is_complete) {
pk_commitment += part.commitment.row(0);
let row = Poly::interpolate(part.values.iter().take(self.threshold + 1));
let row = Poly::interpolate(part.values.iter().take(self.threshold + 1)).ok()?;
sk_val.add_assign(&row.evaluate(0));
}
let sk = SecretKeyShare::from_mut(&mut sk_val);
Expand Down Expand Up @@ -1089,7 +1089,8 @@ impl KeyGen {
let val = deserialize::<FieldWrap<Fr>>(&ser_val)
.map_err(|_| AcknowledgmentFault::DeserializeValue)?
.into_inner();
if part.commitment.evaluate(our_index + 1, sender_index + 1) != G1Affine::one().mul(val)
if part.commitment.evaluate(our_index + 1, sender_index + 1)
!= G1Affine::generator().mul(val)
{
return Err(AcknowledgmentFault::ValueAcknowledgment);
}
Expand Down
2 changes: 1 addition & 1 deletion src/key_gen/tests.rs
Expand Up @@ -431,7 +431,7 @@ fn network_churning() -> Result<()> {
peer_ids.push(PeerId::new());
naming_index += 1;
} else {
let _ = peer_ids.remove(rng.gen_range(0, peer_ids.len()));
let _ = peer_ids.remove(rng.gen_range(0..peer_ids.len()));
}

let threshold: usize = peer_ids.len() * 2 / 3;
Expand Down

0 comments on commit bd0a0df

Please sign in to comment.