Skip to content

Commit

Permalink
expose signkey generation function
Browse files Browse the repository at this point in the history
  • Loading branch information
mrain committed Jan 15, 2024
1 parent 8d071e2 commit c9b3954
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions primitives/src/signatures/bls_over_bn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, *};
use ark_std::{
format,
hash::{Hash, Hasher},
rand::{CryptoRng, Rng, RngCore},
rand::{CryptoRng, RngCore},
string::ToString,
vec::Vec,
One, UniformRand,
Expand Down Expand Up @@ -358,7 +358,7 @@ pub fn hash_to_curve<H: Default + DynDigest + Clone>(msg: &[u8]) -> G1Projective

impl KeyPair {
/// Key-pair generation algorithm
pub fn generate<R: Rng>(prng: &mut R) -> KeyPair {
pub fn generate<R: CryptoRng + RngCore>(prng: &mut R) -> KeyPair {
let sk = SignKey::generate(prng);
let vk = VerKey::from(&sk);
KeyPair { sk, vk }
Expand Down Expand Up @@ -401,7 +401,8 @@ impl KeyPair {
}

impl SignKey {
fn generate<R: Rng>(prng: &mut R) -> SignKey {
/// Signature Key generation function
pub fn generate<R: CryptoRng + RngCore>(prng: &mut R) -> SignKey {
SignKey(ScalarField::rand(prng))
}
}
Expand Down

0 comments on commit c9b3954

Please sign in to comment.