Browse Source

dpf: update traits, impl Debug manually @ dpf/src/spdpf.rs

Lennart Braun 3 years ago
parent
commit
6bdc9f649e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      dpf/src/spdpf.rs

+ 4 - 4
dpf/src/spdpf.rs

@@ -3,13 +3,13 @@ use core::marker::PhantomData;
 use core::ops::Add;
 use num::traits::Zero;
 
-pub trait SinglePointDpfKey {
+pub trait SinglePointDpfKey: Copy + Debug {
     fn get_party_id(&self) -> usize;
     fn get_log_domain_size(&self) -> u64;
 }
 
 pub trait SinglePointDpf {
-    type Key: Copy + SinglePointDpfKey;
+    type Key: SinglePointDpfKey;
     type Value: Add<Output = Self::Value> + Copy + Debug + Eq + Zero;
 
     fn generate_keys(log_domain_size: u64, alpha: u64, beta: Self::Value)
@@ -23,7 +23,7 @@ pub trait SinglePointDpf {
 }
 
 #[derive(Clone, Copy, Debug)]
-pub struct DummySpDpfKey<V: Copy> {
+pub struct DummySpDpfKey<V: Copy + Debug> {
     party_id: usize,
     log_domain_size: u64,
     alpha: u64,
@@ -32,7 +32,7 @@ pub struct DummySpDpfKey<V: Copy> {
 
 impl<V> SinglePointDpfKey for DummySpDpfKey<V>
 where
-    V: Copy,
+    V: Copy + Debug,
 {
     fn get_party_id(&self) -> usize {
         self.party_id