Struct snarkvm_dpc::record::ciphertext::Ciphertext
source · [−]pub struct Ciphertext<N: Network> { /* private fields */ }
Implementations
sourceimpl<N: Network> Ciphertext<N>
impl<N: Network> Ciphertext<N>
sourcepub fn from(
randomizer: N::RecordRandomizer,
record_view_key_commitment: N::RecordViewKeyCommitment,
record_bytes: Vec<u8>
) -> Result<Self, RecordError>
pub fn from(
randomizer: N::RecordRandomizer,
record_view_key_commitment: N::RecordViewKeyCommitment,
record_bytes: Vec<u8>
) -> Result<Self, RecordError>
Returns the record ciphertext object.
sourcepub fn is_owner(&self, account_view_key: &ViewKey<N>) -> bool
pub fn is_owner(&self, account_view_key: &ViewKey<N>) -> bool
Returns true
if this ciphertext belongs to the given account view key.
sourcepub fn commitment(&self) -> N::Commitment
pub fn commitment(&self) -> N::Commitment
Returns the record commitment.
sourcepub fn randomizer(&self) -> N::RecordRandomizer
pub fn randomizer(&self) -> N::RecordRandomizer
Returns the ciphertext randomizer.
sourcepub fn record_view_key_commitment(&self) -> &N::RecordViewKeyCommitment
pub fn record_view_key_commitment(&self) -> &N::RecordViewKeyCommitment
Returns the record view key commitment.
sourcepub fn to_plaintext(
&self,
decryption_key: &DecryptionKey<N>
) -> Result<(Vec<u8>, N::RecordViewKey)>
pub fn to_plaintext(
&self,
decryption_key: &DecryptionKey<N>
) -> Result<(Vec<u8>, N::RecordViewKey)>
Returns the plaintext and record view key corresponding to the record ciphertext.
Trait Implementations
sourceimpl<N: Network> Clone for Ciphertext<N> where
N: Network,
impl<N: Network> Clone for Ciphertext<N> where
N: Network,
sourceimpl<N: Network> Debug for Ciphertext<N> where
N: Network,
impl<N: Network> Debug for Ciphertext<N> where
N: Network,
sourceimpl<N: Network> FromBytes for Ciphertext<N>
impl<N: Network> FromBytes for Ciphertext<N>
sourceimpl<N: Network> Hash for Ciphertext<N> where
N: Network,
impl<N: Network> Hash for Ciphertext<N> where
N: Network,
sourceimpl<N: Network> PartialEq<Ciphertext<N>> for Ciphertext<N> where
N: Network,
impl<N: Network> PartialEq<Ciphertext<N>> for Ciphertext<N> where
N: Network,
sourceimpl<N: Network> ToBytes for Ciphertext<N>
impl<N: Network> ToBytes for Ciphertext<N>
impl<N: Network> Eq for Ciphertext<N> where
N: Network,
Auto Trait Implementations
impl<N> RefUnwindSafe for Ciphertext<N> where
<N as Network>::Commitment: RefUnwindSafe,
<N as Network>::RecordRandomizer: RefUnwindSafe,
<N as Network>::RecordViewKeyCommitment: RefUnwindSafe,
impl<N> Send for Ciphertext<N>
impl<N> Sync for Ciphertext<N>
impl<N> Unpin for Ciphertext<N> where
<N as Network>::Commitment: Unpin,
<N as Network>::RecordRandomizer: Unpin,
<N as Network>::RecordViewKeyCommitment: Unpin,
impl<N> UnwindSafe for Ciphertext<N> where
<N as Network>::Commitment: UnwindSafe,
<N as Network>::RecordRandomizer: UnwindSafe,
<N as Network>::RecordViewKeyCommitment: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more