randomized: add Debug to structs
This commit is contained in:
parent
d048057a21
commit
bc633a23f5
|
@ -23,6 +23,7 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||||
derive-getters = "0.3.0"
|
derive-getters = "0.3.0"
|
||||||
document-features = "0.2.7"
|
document-features = "0.2.7"
|
||||||
frost-core = { path = "../frost-core", version = "1.0.0", features = ["internals"] }
|
frost-core = { path = "../frost-core", version = "1.0.0", features = ["internals"] }
|
||||||
|
hex = "0.4.3"
|
||||||
rand_core = "0.6"
|
rand_core = "0.6"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -249,6 +249,19 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<C> core::fmt::Debug for Randomizer<C>
|
||||||
|
where
|
||||||
|
C: Ciphersuite,
|
||||||
|
{
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_tuple("Randomizer")
|
||||||
|
.field(&hex::encode(
|
||||||
|
<<C::Group as Group>::Field>::serialize(&self.0).as_ref(),
|
||||||
|
))
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Randomized parameters for a signing instance of randomized FROST.
|
/// Randomized parameters for a signing instance of randomized FROST.
|
||||||
#[derive(Clone, PartialEq, Eq, Getters)]
|
#[derive(Clone, PartialEq, Eq, Getters)]
|
||||||
pub struct RandomizedParams<C: Ciphersuite> {
|
pub struct RandomizedParams<C: Ciphersuite> {
|
||||||
|
@ -303,3 +316,19 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<C> core::fmt::Debug for RandomizedParams<C>
|
||||||
|
where
|
||||||
|
C: Ciphersuite,
|
||||||
|
{
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_struct("RandomizedParams")
|
||||||
|
.field("randomizer", &self.randomizer)
|
||||||
|
.field(
|
||||||
|
"randomizer_element",
|
||||||
|
&hex::encode(<C::Group as Group>::serialize(&self.randomizer_element).as_ref()),
|
||||||
|
)
|
||||||
|
.field("randomized_verifying_key", &self.randomized_verifying_key)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue