Struct snarkvm_circuit_program::Record
source · pub struct Record<A: Aleo, Private: Visibility<A>> { /* private fields */ }
Implementations
sourceimpl<A: Aleo> Record<A, Ciphertext<A>>
impl<A: Aleo> Record<A, Ciphertext<A>>
sourcepub fn decrypt(&self, view_key: &ViewKey<A>) -> Record<A, Plaintext<A>>
pub fn decrypt(&self, view_key: &ViewKey<A>) -> Record<A, Plaintext<A>>
Decrypts self
into a plaintext record using the given view key & nonce.
sourcepub fn decrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Plaintext<A>>
pub fn decrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Plaintext<A>>
Decrypts self
into a plaintext record using the given record view key.
sourceimpl<A: Aleo> Record<A, Plaintext<A>>
impl<A: Aleo> Record<A, Plaintext<A>>
sourcepub fn encrypt(&self, randomizer: &Scalar<A>) -> Record<A, Ciphertext<A>>
pub fn encrypt(&self, randomizer: &Scalar<A>) -> Record<A, Ciphertext<A>>
Encrypts self
for the record owner under the given randomizer.
sourcepub fn encrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Ciphertext<A>>
pub fn encrypt_symmetric(
&self,
record_view_key: Field<A>
) -> Record<A, Ciphertext<A>>
Encrypts self
under the given record view key.
sourceimpl<A: Aleo, Private: Visibility<A>> Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
sourcepub fn serial_number(
private_key: PrivateKey<A>,
commitment: Field<A>
) -> Field<A>
pub fn serial_number(
private_key: PrivateKey<A>,
commitment: Field<A>
) -> Field<A>
A helper method to derive the serial number from the private key and commitment.
sourcepub fn serial_number_from_gamma(
gamma: &Group<A>,
commitment: Field<A>
) -> Field<A>
pub fn serial_number_from_gamma(
gamma: &Group<A>,
commitment: Field<A>
) -> Field<A>
A helper method to derive the serial number from the gamma and commitment.
sourceimpl<A: Aleo, Private: Visibility<A>> Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
sourceimpl<A: Aleo> Record<A, Plaintext<A>>
impl<A: Aleo> Record<A, Plaintext<A>>
sourcepub fn to_commitment(
&self,
program_id: &ProgramID<A>,
record_name: &Identifier<A>
) -> Field<A>
pub fn to_commitment(
&self,
program_id: &ProgramID<A>,
record_name: &Identifier<A>
) -> Field<A>
Returns the record commitment.
sourceimpl<A: Aleo> Record<A, Ciphertext<A>>
impl<A: Aleo> Record<A, Ciphertext<A>>
sourcepub fn to_commitment(
&self,
_program_id: &ProgramID<A>,
_record_name: &Identifier<A>
) -> Field<A>
pub fn to_commitment(
&self,
_program_id: &ProgramID<A>,
_record_name: &Identifier<A>
) -> Field<A>
Returns the record commitment.
sourceimpl<A: Aleo, Private: Visibility<A>> Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
sourcepub fn from_plaintext(
owner: Owner<A, Plaintext<A>>,
gates: Balance<A, Plaintext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Plaintext<A>>>,
nonce: Group<A>
) -> Result<Record<A, Plaintext<A>>>
pub fn from_plaintext(
owner: Owner<A, Plaintext<A>>,
gates: Balance<A, Plaintext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Plaintext<A>>>,
nonce: Group<A>
) -> Result<Record<A, Plaintext<A>>>
Initializes a new record plaintext.
sourcepub fn from_ciphertext(
owner: Owner<A, Ciphertext<A>>,
gates: Balance<A, Ciphertext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Ciphertext<A>>>,
nonce: Group<A>
) -> Result<Record<A, Ciphertext<A>>>
pub fn from_ciphertext(
owner: Owner<A, Ciphertext<A>>,
gates: Balance<A, Ciphertext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Ciphertext<A>>>,
nonce: Group<A>
) -> Result<Record<A, Ciphertext<A>>>
Initializes a new record ciphertext.
sourceimpl<A: Aleo, Private: Visibility<A>> Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
sourcepub const fn data(&self) -> &IndexMap<Identifier<A>, Entry<A, Private>>
pub const fn data(&self) -> &IndexMap<Identifier<A>, Entry<A, Private>>
Returns the program data.
Trait Implementations
sourceimpl<A: Aleo> Eject for Record<A, Ciphertext<A>>
impl<A: Aleo> Eject for Record<A, Ciphertext<A>>
sourcefn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
sourcefn eject_value(&self) -> Self::Primitive
fn eject_value(&self) -> Self::Primitive
Ejects the record.
type Primitive = Record<<A as Environment>::Network, Ciphertext<<A as Environment>::Network>>
fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant. Read morefn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private. Read moresourceimpl<A: Aleo> Eject for Record<A, Plaintext<A>>
impl<A: Aleo> Eject for Record<A, Plaintext<A>>
sourcefn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
sourcefn eject_value(&self) -> Self::Primitive
fn eject_value(&self) -> Self::Primitive
Ejects the record.
type Primitive = Record<<A as Environment>::Network, Plaintext<<A as Environment>::Network>>
fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant. Read morefn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private. Read moresourceimpl<A: Aleo, Private: Visibility<A>> Equal<Record<A, Private>> for Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Equal<Record<A, Private>> for Record<A, Private>
sourcefn is_equal(&self, other: &Self) -> Self::Output
fn is_equal(&self, other: &Self) -> Self::Output
Returns true
if self
and other
are equal.
Note: This method does not check the nonce
equality.
sourcefn is_not_equal(&self, other: &Self) -> Self::Output
fn is_not_equal(&self, other: &Self) -> Self::Output
Returns true
if self
and other
are not equal.
Note: This method does not check the nonce
equality.
type Output = Boolean<A>
sourceimpl<A: Aleo> Inject for Record<A, Ciphertext<A>>
impl<A: Aleo> Inject for Record<A, Ciphertext<A>>
sourcefn new(_: Mode, record: Self::Primitive) -> Self
fn new(_: Mode, record: Self::Primitive) -> Self
Initializes a ciphertext record from a primitive.
type Primitive = Record<<A as Environment>::Network, Ciphertext<<A as Environment>::Network>>
sourceimpl<A: Aleo> Inject for Record<A, Plaintext<A>>
impl<A: Aleo> Inject for Record<A, Plaintext<A>>
sourceimpl<A: Aleo> ToBits for Record<A, Ciphertext<A>>
impl<A: Aleo> ToBits for Record<A, Ciphertext<A>>
sourcefn to_bits_le(&self) -> Vec<Self::Boolean> ⓘ
fn to_bits_le(&self) -> Vec<Self::Boolean> ⓘ
Returns this data as a list of little-endian bits.
sourcefn to_bits_be(&self) -> Vec<Self::Boolean> ⓘ
fn to_bits_be(&self) -> Vec<Self::Boolean> ⓘ
Returns this data as a list of big-endian bits.
type Boolean = Boolean<A>
sourceimpl<A: Aleo> ToBits for Record<A, Plaintext<A>>
impl<A: Aleo> ToBits for Record<A, Plaintext<A>>
sourcefn to_bits_le(&self) -> Vec<Self::Boolean> ⓘ
fn to_bits_le(&self) -> Vec<Self::Boolean> ⓘ
Returns this data as a list of little-endian bits.
sourcefn to_bits_be(&self) -> Vec<Self::Boolean> ⓘ
fn to_bits_be(&self) -> Vec<Self::Boolean> ⓘ
Returns this data as a list of big-endian bits.