Enum snarkvm_wasm::program::Plaintext
pub enum Plaintext<N>where
N: Network,{
Literal(Literal<N>, OnceCell<Vec<bool, Global>>),
Struct(IndexMap<Identifier<N>, Plaintext<N>, RandomState>, OnceCell<Vec<bool, Global>>),
}Variants
Literal(Literal<N>, OnceCell<Vec<bool, Global>>)
A literal.
Struct(IndexMap<Identifier<N>, Plaintext<N>, RandomState>, OnceCell<Vec<bool, Global>>)
A struct.
Implementations
impl<N> Plaintext<N>where
N: Network,
impl<N> Plaintext<N>where
N: Network,
pub fn encrypt(
&self,
address: &Address<N>,
randomizer: Scalar<N>
) -> Result<Ciphertext<N>, Error>
pub fn encrypt(
&self,
address: &Address<N>,
randomizer: Scalar<N>
) -> Result<Ciphertext<N>, Error>
Encrypts self to the given address under the given randomizer.
pub fn encrypt_symmetric(
&self,
plaintext_view_key: Field<N>
) -> Result<Ciphertext<N>, Error>
pub fn encrypt_symmetric(
&self,
plaintext_view_key: Field<N>
) -> Result<Ciphertext<N>, Error>
Encrypts self under the given plaintext view key.
Trait Implementations
impl<'de, N> Deserialize<'de> for Plaintext<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Plaintext<N>where
N: Network,
fn deserialize<D>(
deserializer: D
) -> Result<Plaintext<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Plaintext<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the plaintext from a string or bytes.
impl<N> FromBits for Plaintext<N>where
N: Network,
impl<N> FromBits for Plaintext<N>where
N: Network,
fn from_bits_le(bits_le: &[bool]) -> Result<Plaintext<N>, Error>
fn from_bits_le(bits_le: &[bool]) -> Result<Plaintext<N>, Error>
Initializes a new plaintext from a list of little-endian bits without trailing zeros.
fn from_bits_be(bits_be: &[bool]) -> Result<Plaintext<N>, Error>
fn from_bits_be(bits_be: &[bool]) -> Result<Plaintext<N>, Error>
Initializes a new plaintext from a list of big-endian bits without trailing zeros.
impl<N> FromFields for Plaintext<N>where
N: Network,
impl<N> FromFields for Plaintext<N>where
N: Network,
fn from_fields(
fields: &[<Plaintext<N> as FromFields>::Field]
) -> Result<Plaintext<N>, Error>
fn from_fields(
fields: &[<Plaintext<N> as FromFields>::Field]
) -> Result<Plaintext<N>, Error>
Initializes a plaintext from a list of base field elements.
type Field = Field<N>
impl<N> Serialize for Plaintext<N>where
N: Network,
impl<N> Serialize for Plaintext<N>where
N: Network,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serializes the plaintext into a string or as bytes.
impl<N> ToBits for Plaintext<N>where
N: Network,
impl<N> ToBits for Plaintext<N>where
N: Network,
impl<N> Visibility for Plaintext<N>where
N: Network,
impl<N> Visibility for Plaintext<N>where
N: Network,
impl<N> Eq for Plaintext<N>where
N: Network,
Auto Trait Implementations
impl<N> RefUnwindSafe for Plaintext<N>where
N: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
impl<N> Send for Plaintext<N>
impl<N> Sync for Plaintext<N>
impl<N> Unpin for Plaintext<N>where
N: Unpin,
<N as Environment>::Field: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N> UnwindSafe for Plaintext<N>where
N: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;