Struct snarkvm_circuit::Record
source · pub struct Record<A, Private>where
A: Aleo,
Private: Visibility<A>,{ /* private fields */ }
Implementations§
source§impl<A> Record<A, Ciphertext<A>>where
A: Aleo,
impl<A> Record<A, Ciphertext<A>>where A: Aleo,
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> Record<A, Plaintext<A>>where
A: Aleo,
impl<A> Record<A, Plaintext<A>>where A: Aleo,
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, Private> Record<A, Private>where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Record<A, Private>where A: Aleo, Private: Visibility<A>,
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, Private> Record<A, Private>where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Record<A, Private>where A: Aleo, Private: Visibility<A>,
source§impl<A> Record<A, Plaintext<A>>where
A: Aleo,
impl<A> Record<A, Plaintext<A>>where A: Aleo,
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> Record<A, Ciphertext<A>>where
A: Aleo,
impl<A> Record<A, Ciphertext<A>>where A: Aleo,
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, Private> Record<A, Private>where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Record<A, Private>where A: Aleo, Private: Visibility<A>,
sourcepub fn from_plaintext(
owner: Owner<A, Plaintext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Plaintext<A>>, RandomState>,
nonce: Group<A>
) -> Result<Record<A, Plaintext<A>>, Error>
pub fn from_plaintext( owner: Owner<A, Plaintext<A>>, data: IndexMap<Identifier<A>, Entry<A, Plaintext<A>>, RandomState>, nonce: Group<A> ) -> Result<Record<A, Plaintext<A>>, Error>
Initializes a new record plaintext.
sourcepub fn from_ciphertext(
owner: Owner<A, Ciphertext<A>>,
data: IndexMap<Identifier<A>, Entry<A, Ciphertext<A>>, RandomState>,
nonce: Group<A>
) -> Result<Record<A, Ciphertext<A>>, Error>
pub fn from_ciphertext( owner: Owner<A, Ciphertext<A>>, data: IndexMap<Identifier<A>, Entry<A, Ciphertext<A>>, RandomState>, nonce: Group<A> ) -> Result<Record<A, Ciphertext<A>>, Error>
Initializes a new record ciphertext.
source§impl<A, Private> Record<A, Private>where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Record<A, Private>where A: Aleo, Private: Visibility<A>,
Trait Implementations§
source§impl<A, Private> Clone for Record<A, Private>where
A: Clone + Aleo,
Private: Clone + Visibility<A>,
impl<A, Private> Clone for Record<A, Private>where A: Clone + Aleo, Private: Clone + Visibility<A>,
source§impl<A> Eject for Record<A, Ciphertext<A>>where
A: Aleo,
impl<A> Eject for Record<A, Ciphertext<A>>where A: Aleo,
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
source§fn eject_value(&self) -> <Record<A, Ciphertext<A>> as Eject>::Primitive
fn eject_value(&self) -> <Record<A, Ciphertext<A>> as Eject>::Primitive
Ejects the record.
type Primitive = Record<<A as Environment>::Network, Ciphertext<<A as Environment>::Network>>
source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant.source§fn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private.source§impl<A> Eject for Record<A, Plaintext<A>>where
A: Aleo,
impl<A> Eject for Record<A, Plaintext<A>>where A: Aleo,
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the record.
type Primitive = Record<<A as Environment>::Network, Plaintext<<A as Environment>::Network>>
source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant.source§fn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private.source§impl<A, Private> Equal<Record<A, Private>> for Record<A, Private>where
A: Aleo,
Private: Visibility<A>,
impl<A, Private> Equal<Record<A, Private>> for Record<A, Private>where A: Aleo, Private: Visibility<A>,
source§fn is_equal(
&self,
other: &Record<A, Private>
) -> <Record<A, Private> as Equal<Record<A, Private>>>::Output
fn is_equal( &self, other: &Record<A, Private> ) -> <Record<A, Private> as Equal<Record<A, Private>>>::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: &Record<A, Private>
) -> <Record<A, Private> as Equal<Record<A, Private>>>::Output
fn is_not_equal( &self, other: &Record<A, Private> ) -> <Record<A, Private> as Equal<Record<A, Private>>>::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> Inject for Record<A, Ciphertext<A>>where
A: Aleo,
impl<A> Inject for Record<A, Ciphertext<A>>where A: Aleo,
source§fn new(
_: Mode,
record: <Record<A, Ciphertext<A>> as Inject>::Primitive
) -> Record<A, Ciphertext<A>>
fn new( _: Mode, record: <Record<A, Ciphertext<A>> as Inject>::Primitive ) -> Record<A, Ciphertext<A>>
Initializes a ciphertext record from a primitive.
type Primitive = Record<<A as Environment>::Network, Ciphertext<<A as Environment>::Network>>
source§impl<A> Inject for Record<A, Plaintext<A>>where
A: Aleo,
impl<A> Inject for Record<A, Plaintext<A>>where A: Aleo,
source§impl<A> ToBits for Record<A, Ciphertext<A>>where
A: Aleo,
impl<A> ToBits for Record<A, Ciphertext<A>>where A: Aleo,
source§fn to_bits_le(
&self
) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>
fn to_bits_le( &self ) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>
Returns this data as a list of little-endian bits.
source§fn to_bits_be(
&self
) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>
fn to_bits_be( &self ) -> Vec<<Record<A, Ciphertext<A>> as ToBits>::Boolean, Global>
Returns this data as a list of big-endian bits.
type Boolean = Boolean<A>
source§impl<A> ToBits for Record<A, Plaintext<A>>where
A: Aleo,
impl<A> ToBits for Record<A, Plaintext<A>>where A: Aleo,
source§fn to_bits_le(
&self
) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>
fn to_bits_le( &self ) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>
Returns this data as a list of little-endian bits.
source§fn to_bits_be(
&self
) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>
fn to_bits_be( &self ) -> Vec<<Record<A, Plaintext<A>> as ToBits>::Boolean, Global>
Returns this data as a list of big-endian bits.