Struct chain_crypto::testing::TestCryptoGen
source · pub struct TestCryptoGen(pub u64);
Expand description
an Arbitrary friendly cryptographic generator
Given the same generation, all the cryptographic material that is created through it, is deterministic, and thus can be replay
For obvious reasons, do not use anywhere except for testing
Tuple Fields§
§0: u64
Implementations§
source§impl TestCryptoGen
impl TestCryptoGen
sourcepub fn get_rng(&self, idx: u32) -> TestCryptoRng
pub fn get_rng(&self, idx: u32) -> TestCryptoRng
get the nth deterministic RNG
sourcepub fn secret_key<A: AsymmetricKey>(&self, idx: u32) -> SecretKey<A>
pub fn secret_key<A: AsymmetricKey>(&self, idx: u32) -> SecretKey<A>
Get the nth deterministic secret key
sourcepub fn keypair<A: AsymmetricKey>(&self, idx: u32) -> KeyPair<A>
pub fn keypair<A: AsymmetricKey>(&self, idx: u32) -> KeyPair<A>
Get the nth deterministic keypair
Trait Implementations§
source§impl Arbitrary for TestCryptoGen
impl Arbitrary for TestCryptoGen
source§impl Arbitrary for TestCryptoGen
impl Arbitrary for TestCryptoGen
§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = BoxedStrategy<TestCryptoGen>
type Strategy = BoxedStrategy<TestCryptoGen>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
source§impl Clone for TestCryptoGen
impl Clone for TestCryptoGen
source§fn clone(&self) -> TestCryptoGen
fn clone(&self) -> TestCryptoGen
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for TestCryptoGen
impl Send for TestCryptoGen
impl Sync for TestCryptoGen
impl Unpin for TestCryptoGen
impl UnwindSafe for TestCryptoGen
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