Struct snarkvm_circuit_program::Record
source · pub struct Record<A: Aleo, Private: Visibility<A>> { /* private fields */ }
Implementations§
source§impl<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_unchecked(
&self,
record_view_key: Field<A>
) -> Record<A, Plaintext<A>>
pub fn decrypt_symmetric_unchecked( &self, record_view_key: Field<A> ) -> Record<A, Plaintext<A>>
Decrypts self
into a plaintext record using the given record view key.
Note: This method does not check that the record view key corresponds to the record owner.
Use Self::decrypt
for the checked variant.
source§impl<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_unchecked(
&self,
record_view_key: Field<A>
) -> Record<A, Ciphertext<A>>
pub fn encrypt_symmetric_unchecked( &self, record_view_key: Field<A> ) -> Record<A, Ciphertext<A>>
Encrypts self
under the given record view key.
Note: This method does not check that the record view key corresponds to the record owner.
Use Self::encrypt
for the checked variant.
source§impl<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.
source§impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
source§impl<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.
source§impl<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.
source§impl<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>>,
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>>, 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>>,
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>>, data: IndexMap<Identifier<A>, Entry<A, Ciphertext<A>>>, nonce: Group<A> ) -> Result<Record<A, Ciphertext<A>>>
Initializes a new record ciphertext.
source§impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Record<A, Private>
Trait Implementations§
source§impl<A: Aleo> Eject for Record<A, Ciphertext<A>>
impl<A: Aleo> Eject for Record<A, Ciphertext<A>>
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
source§fn 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 is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant.§fn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private.source§impl<A: Aleo> Eject for Record<A, Plaintext<A>>
impl<A: Aleo> Eject for Record<A, Plaintext<A>>
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
source§fn 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 is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant.§fn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private.source§impl<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>
source§fn 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.
source§fn 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>
source§impl<A: Aleo> Inject for Record<A, Ciphertext<A>>
impl<A: Aleo> Inject for Record<A, Ciphertext<A>>
source§impl<A: Aleo> Inject for Record<A, Plaintext<A>>
impl<A: Aleo> Inject for Record<A, Plaintext<A>>
source§impl<A: Aleo> ToBits for Record<A, Ciphertext<A>>
impl<A: Aleo> ToBits for Record<A, Ciphertext<A>>
source§fn 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.
source§fn 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>
source§impl<A: Aleo> ToBits for Record<A, Plaintext<A>>
impl<A: Aleo> ToBits for Record<A, Plaintext<A>>
source§fn 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.
source§fn 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.