Skip to content

Commit

Permalink
chore: add trait bound
Browse files Browse the repository at this point in the history
  • Loading branch information
palozano committed Dec 11, 2023
1 parent e1ab2e5 commit 2928ca4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use bls12_381::{hash_to_curve::HashToField, G1Affine, G1Projective, Scalar};
use hkdf::Hkdf;
#[cfg(feature = "pairing")]
use sha2::{digest::generic_array::typenum::U48, digest::generic_array::GenericArray, Sha256};
use zeroize::Zeroize;
use zeroize::{DefaultIsZeroes, Zeroize};

#[cfg(feature = "blst")]
use blstrs::{G1Affine, G1Projective, G2Affine, Scalar};
Expand All @@ -28,7 +28,9 @@ pub(crate) const G1_COMPRESSED_SIZE: usize = 48;
pub struct PublicKey(pub(crate) G1Projective);

#[derive(Debug, Copy, Clone, Eq, PartialEq, Zeroize)]
pub struct PrivateKey(pub(crate) Scalar);
pub struct PrivateKey(pub(crate) Scalar)
where
Scalar: DefaultIsZeroes;

impl From<G1Projective> for PublicKey {
fn from(val: G1Projective) -> Self {
Expand Down

0 comments on commit 2928ca4

Please sign in to comment.