Skip to content

Commit

Permalink
Make wrapped scalar/group elements private
Browse files Browse the repository at this point in the history
  • Loading branch information
moshababo committed Nov 1, 2023
1 parent 71a1f76 commit 96f1cba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions node/libs/crypto/src/bn254/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub mod hash;
mod testonly;

/// Type safety wrapper around a scalar value.
pub struct SecretKey(pub Fr);
pub struct SecretKey(Fr);

impl SecretKey {
/// Gets the corresponding [`PublicKey`] for this [`SecretKey`]
Expand Down Expand Up @@ -55,7 +55,7 @@ impl ByteFmt for SecretKey {

/// Type safety wrapper around G2.
#[derive(Clone, PartialEq, Eq)]
pub struct PublicKey(pub G2);
pub struct PublicKey(G2);

impl ByteFmt for PublicKey {
fn decode(bytes: &[u8]) -> anyhow::Result<Self> {
Expand Down Expand Up @@ -91,7 +91,7 @@ impl Ord for PublicKey {

/// Type safety wrapper around a G1 value.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Signature(pub G1);
pub struct Signature(G1);

impl Signature {
/// Verifies a signature against the provided public key
Expand Down Expand Up @@ -138,7 +138,7 @@ impl Ord for Signature {
}
/// Type safety wrapper around [Signature] indicating that it is an aggregated signature.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct AggregateSignature(pub G1);
pub struct AggregateSignature(G1);

impl AggregateSignature {
/// Generates an aggregate signature from a list of signatures.
Expand Down

0 comments on commit 96f1cba

Please sign in to comment.