Remove unnecessary casts to `Ciphersuite` (#170)

This commit is contained in:
Marek 2022-10-26 10:56:29 -07:00 committed by GitHub
parent c323cb6861
commit 0bbce1059a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -243,9 +243,7 @@ pub trait Ciphersuite: Copy + Clone + PartialEq {
///
/// [challenge]: https://www.ietf.org/archive/id/draft-irtf-cfrg-frost-11.html#name-signature-challenge-computa
#[derive(Clone)]
pub struct Challenge<C: Ciphersuite>(
pub(crate) <<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar,
);
pub struct Challenge<C: Ciphersuite>(pub(crate) <<C::Group as Group>::Field as Field>::Scalar);
impl<C> Debug for Challenge<C>
where
@ -253,9 +251,9 @@ where
{
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("Secret")
.field(&hex::encode(
<<<C as Ciphersuite>::Group as Group>::Field>::serialize(&self.0),
))
.field(&hex::encode(<<C::Group as Group>::Field>::serialize(
&self.0,
)))
.finish()
}
}

View File

@ -144,7 +144,7 @@ fn check_sign<C: Ciphersuite + PartialEq, R: RngCore + CryptoRng>(
/// Test FROST signing with trusted dealer with a Ciphersuite.
pub fn check_sign_with_dkg<C: Ciphersuite + PartialEq, R: RngCore + CryptoRng>(mut rng: R)
where
<C as Ciphersuite>::Group: std::cmp::PartialEq,
C::Group: std::cmp::PartialEq,
{
////////////////////////////////////////////////////////////////////////////
// Key generation, Round 1