From 735b9c1b5244d515238eabbc798eed888267f244 Mon Sep 17 00:00:00 2001
From: Piotr Roslaniec
Date: Wed, 1 Feb 2023 17:25:11 +0100
Subject: [PATCH] remove unused code
---
ferveo/src/lib.rs | 3 ---
ferveo/src/msg.rs | 36 ------------------------------------
2 files changed, 39 deletions(-)
delete mode 100644 ferveo/src/msg.rs
diff --git a/ferveo/src/lib.rs b/ferveo/src/lib.rs
index cb125135..78383144 100644
--- a/ferveo/src/lib.rs
+++ b/ferveo/src/lib.rs
@@ -1,7 +1,6 @@
#![allow(unused_imports)]
pub mod dkg;
-pub mod msg;
pub mod vss;
pub mod primitives;
@@ -12,7 +11,6 @@ pub use primitives::*;
use ferveo_common::Rng;
use crate::dkg::*;
-use crate::msg::*;
use ark_ec::{AffineCurve, ProjectiveCurve};
use ark_ff::{Field, One, Zero};
@@ -25,7 +23,6 @@ use serde::*;
use anyhow::{anyhow, Result};
pub use dkg::*;
-pub use msg::*;
pub use vss::*;
use ark_ec::msm::FixedBaseMSM;
diff --git a/ferveo/src/msg.rs b/ferveo/src/msg.rs
deleted file mode 100644
index 8c53d387..00000000
--- a/ferveo/src/msg.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-use ed25519_dalek as ed25519;
-use ed25519_dalek::Signer;
-
-use crate::*;
-
-impl SignedMessage {
- pub fn sign(tau: u64, msg: &M, key: &ed25519::Keypair) -> SignedMessage
- where
- M: Serialize,
- {
- print_time!("Signing Message");
- let msg_bytes = bincode::serialize(&(tau, msg)).unwrap();
- let signature = key.sign(&msg_bytes);
- SignedMessage {
- msg_bytes,
- signature,
- signer: key.public,
- }
- }
- pub fn verify<'de, M>(&'de self) -> Result<(u64, M)>
- where
- M: Deserialize<'de>,
- {
- print_time!("Verifying Message");
- self.signer
- .verify_strict(&self.msg_bytes, &self.signature)?;
- bincode::deserialize::<'de, _>(&self.msg_bytes).map_err(|e| e.into()) //TODO: handle error
- }
-}
-
-#[derive(Serialize, Deserialize, Clone)]
-pub struct SignedMessage {
- msg_bytes: Vec,
- signature: ed25519::Signature,
- pub signer: ed25519::PublicKey,
-}