Struct yobicrypto::balloon::BalloonParams
[−]
[src]
pub struct BalloonParams { pub s_cost: u32, pub t_cost: u32, pub delta: u32, }
Params used in Balloon hashing.
Fields
s_cost: u32
The s_cost parameter used in Balloon hashing.
t_cost: u32
The t_cost parameter used in Balloon hashing.
delta: u32
The delta parameter used in Balloon hashing.
Methods
impl BalloonParams
[src]
pub fn new(s_cost: u32, t_cost: u32, delta: u32) -> Result<BalloonParams>
[src]
Creates a new BalloonParams
.
pub fn from_memory(target_memory: &Memory) -> Result<BalloonParams>
[src]
Creates a new BalloonParams
given a target memory.
pub fn memory(&self) -> Result<Memory>
[src]
Returns the memory that would be spent in the hashing operation.
Trait Implementations
impl Copy for BalloonParams
[src]
impl Clone for BalloonParams
[src]
fn clone(&self) -> BalloonParams
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for BalloonParams
[src]
impl PartialEq for BalloonParams
[src]
fn eq(&self, __arg_0: &BalloonParams) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BalloonParams) -> bool
[src]
This method tests for !=
.
impl Debug for BalloonParams
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for BalloonParams
[src]
fn default() -> BalloonParams
[src]
Returns the "default value" for a type. Read more
impl Validate for BalloonParams
[src]
impl BinarySerialize for BalloonParams
[src]
fn to_bytes(&self) -> Result<Vec<u8>>
[src]
Serialize to a binary.
fn from_bytes(b: &[u8]) -> Result<BalloonParams>
[src]
Deserialize from a binary.
impl HexSerialize for BalloonParams
[src]
fn to_hex(&self) -> Result<String>
[src]
Serialize to a hex string.
fn from_hex(s: &str) -> Result<BalloonParams>
[src]
Deserialize from a hex string.