Skip to content

Commit

Permalink
[DKG] Clean up old versions of DKG & ECIES (#845)
Browse files Browse the repository at this point in the history
- add regression tests to ecies_v1
- remove dkg_v0 and ecies_v0, and move the shared code to *_v1
- disable Arden
  • Loading branch information
benr-ml authored Nov 11, 2024
1 parent d5b0059 commit 69d496c
Show file tree
Hide file tree
Showing 18 changed files with 341 additions and 2,124 deletions.
12 changes: 6 additions & 6 deletions fastcrypto-tbls/benches/dkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion};
use fastcrypto::groups::{bls12381, ristretto255};
use fastcrypto_tbls::dkg::Party;
use fastcrypto_tbls::ecies;
use fastcrypto_tbls::dkg_v1::Party;
use fastcrypto_tbls::ecies_v1;
use fastcrypto_tbls::nodes::{Node, Nodes, PartyId};
use fastcrypto_tbls::random_oracle::RandomOracle;
use itertools::iproduct;
Expand All @@ -13,11 +13,11 @@ use rand::thread_rng;
type G = bls12381::G2Element;
type EG = ristretto255::RistrettoPoint;

fn gen_ecies_keys(n: u16) -> Vec<(PartyId, ecies::PrivateKey<EG>, ecies::PublicKey<EG>)> {
fn gen_ecies_keys(n: u16) -> Vec<(PartyId, ecies_v1::PrivateKey<EG>, ecies_v1::PublicKey<EG>)> {
(0..n)
.map(|id| {
let sk = ecies::PrivateKey::<EG>::new(&mut thread_rng());
let pk = ecies::PublicKey::<EG>::from_private_key(&sk);
let sk = ecies_v1::PrivateKey::<EG>::new(&mut thread_rng());
let pk = ecies_v1::PublicKey::<EG>::from_private_key(&sk);
(id, sk, pk)
})
.collect()
Expand All @@ -27,7 +27,7 @@ pub fn setup_party(
id: PartyId,
threshold: u16,
weight: u16,
keys: &[(PartyId, ecies::PrivateKey<EG>, ecies::PublicKey<EG>)],
keys: &[(PartyId, ecies_v1::PrivateKey<EG>, ecies_v1::PublicKey<EG>)],
) -> Party<G, EG> {
let nodes = keys
.iter()
Expand Down
10 changes: 5 additions & 5 deletions fastcrypto-tbls/benches/nidkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion};
use fastcrypto::groups::bls12381;
use fastcrypto_tbls::ecies_v0;
use fastcrypto_tbls::ecies_v1;
use fastcrypto_tbls::nidkg::Party;
use fastcrypto_tbls::nodes::Node;
use fastcrypto_tbls::random_oracle::RandomOracle;
use rand::thread_rng;

type G = bls12381::G1Element;

fn gen_ecies_keys(n: u16) -> Vec<(u16, ecies_v0::PrivateKey<G>, ecies_v0::PublicKey<G>)> {
fn gen_ecies_keys(n: u16) -> Vec<(u16, ecies_v0::PrivateKey<G>, ecies_v1::PublicKey<G>)> {
(0..n)
.into_iter()
.map(|id| {
let sk = ecies_v0::PrivateKey::<G>::new(&mut thread_rng());
let pk = ecies_v0::PublicKey::<G>::from_private_key(&sk);
let sk = ecies_v1::PrivateKey::<G>::new(&mut thread_rng());
let pk = ecies_v1::PublicKey::<G>::from_private_key(&sk);
(id, sk, pk)
})
.collect()
Expand All @@ -25,7 +25,7 @@ fn gen_ecies_keys(n: u16) -> Vec<(u16, ecies_v0::PrivateKey<G>, ecies_v0::Public
pub fn setup_party(
id: usize,
threshold: u16,
keys: &[(u16, ecies_v0::PrivateKey<G>, ecies_v0::PublicKey<G>)],
keys: &[(u16, ecies_v1::PrivateKey<G>, ecies_v1::PublicKey<G>)],
) -> Party<G> {
let nodes = keys
.iter()
Expand Down
72 changes: 0 additions & 72 deletions fastcrypto-tbls/src/dkg.rs

This file was deleted.

Loading

0 comments on commit 69d496c

Please sign in to comment.