Struct phoenix_core::message::Message [−][src]
pub struct Message { /* fields omitted */ }
Expand description
Message structure with value commitment
Implementations
pub fn new<R: RngCore + CryptoRng>(
rng: &mut R,
r: &JubJubScalar,
psk: &PublicSpendKey,
value: u64
) -> Self
pub fn new<R: RngCore + CryptoRng>(
rng: &mut R,
r: &JubJubScalar,
psk: &PublicSpendKey,
value: u64
) -> Self
Create a new message
r
will be later used to decrypt the value and blinding factor
Represent the message as a sequence of scalars to be used as input for sponge hash functions
It is composed by 3 scalars, in order:
- Value commitment X
- Value commitment Y
- Nonce
And also appends the scalars that composes the PoseidonCipher
Value commitment representation of the message
Nonce used for the encryption of the value and blinding factor
pub fn decrypt(
&self,
r: &JubJubScalar,
psk: &PublicSpendKey
) -> Result<(u64, JubJubScalar), Error>
pub fn decrypt(
&self,
r: &JubJubScalar,
psk: &PublicSpendKey
) -> Result<(u64, JubJubScalar), Error>
Decrypt the value and blinding factor provided the r
used in the
creation of the message
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Message
impl UnwindSafe for Message
Blanket Implementations
Mutably borrows from an owned value. Read more
fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
Parse a string slice as bytes hex representation and returns `