Struct ckb_crypto::secp::Generator
source · pub struct Generator { /* private fields */ }
Expand description
A random secp keypair generator
Implementations§
source§impl Generator
impl Generator
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Generator
Default random number generator is rand::rngs::ThreadRng
sourcepub fn non_crypto_safe_prng(seed: u64) -> Self
pub fn non_crypto_safe_prng(seed: u64) -> Self
Non crypto safe prng, should only used in tests
sourcepub fn gen_privkey(&mut self) -> Privkey
pub fn gen_privkey(&mut self) -> Privkey
Generate a Privkey
sourcepub fn gen_keypair(&mut self) -> (Privkey, Pubkey)
pub fn gen_keypair(&mut self) -> (Privkey, Pubkey)
Generate a keypair
sourcepub fn random_privkey() -> Privkey
pub fn random_privkey() -> Privkey
Shortcuts construct temporary Generator, and generate a Privkey
sourcepub fn random_keypair() -> (Privkey, Pubkey)
pub fn random_keypair() -> (Privkey, Pubkey)
Shortcuts construct temporary Generator, and generate a keypair
sourcepub fn random_secret_key() -> SecretKey
pub fn random_secret_key() -> SecretKey
Shortcuts construct temporary Generator, and generate a SecretKey
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Generator
impl !Send for Generator
impl !Sync for Generator
impl Unpin for Generator
impl !UnwindSafe for Generator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more