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>>
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: 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>>
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: Aleo, Private: Visibility<A>> Equal for Record<A, Private>
impl<A: Aleo, Private: Visibility<A>> Equal 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§fn 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>>
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 write_bits_le(&self, vec: &mut Vec<Self::Boolean>)
fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)
Returns this data as a list of little-endian bits.
Source§fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)
fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)
Returns this data as a list of big-endian bits.
type Boolean = Boolean<A>
Source§fn to_bits_le(&self) -> Vec<Self::Boolean>
fn to_bits_le(&self) -> Vec<Self::Boolean>
Source§fn to_bits_be(&self) -> Vec<Self::Boolean>
fn to_bits_be(&self) -> Vec<Self::Boolean>
Source§impl<A: Aleo> ToBits for Record<A, Plaintext<A>>
impl<A: Aleo> ToBits for Record<A, Plaintext<A>>
Source§fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)
fn write_bits_le(&self, vec: &mut Vec<Self::Boolean>)
Returns this data as a list of little-endian bits.
Source§fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)
fn write_bits_be(&self, vec: &mut Vec<Self::Boolean>)
Returns this data as a list of big-endian bits.
type Boolean = Boolean<A>
Source§fn to_bits_le(&self) -> Vec<Self::Boolean>
fn to_bits_le(&self) -> Vec<Self::Boolean>
Source§fn to_bits_be(&self) -> Vec<Self::Boolean>
fn to_bits_be(&self) -> Vec<Self::Boolean>
Auto Trait Implementations§
impl<A, Private> !Freeze for Record<A, Private>
impl<A, Private> RefUnwindSafe for Record<A, Private>
impl<A, Private> !Send for Record<A, Private>
impl<A, Private> !Sync for Record<A, Private>
impl<A, Private> Unpin for Record<A, Private>
impl<A, Private> UnwindSafe for Record<A, Private>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more