pub struct TranslationAssignment<N: Network> { /* private fields */ }Expand description
Data collected during execution and used to prove record translation in dynamic calls.
Implementations§
Source§impl<N: Network> TranslationAssignment<N>
impl<N: Network> TranslationAssignment<N>
Sourcepub fn new(
record_static: Record<N, Plaintext<N>>,
record_dynamic: DynamicRecord<N>,
program_id: ProgramID<N>,
function_id: Field<N>,
record_name: Identifier<N>,
is_to_static: bool,
is_external_record: bool,
tvk: Field<N>,
record_view_key: Option<Field<N>>,
gamma: Option<Group<N>>,
record_register_index: u16,
id_dynamic: Field<N>,
id_static: Field<N>,
) -> Self
pub fn new( record_static: Record<N, Plaintext<N>>, record_dynamic: DynamicRecord<N>, program_id: ProgramID<N>, function_id: Field<N>, record_name: Identifier<N>, is_to_static: bool, is_external_record: bool, tvk: Field<N>, record_view_key: Option<Field<N>>, gamma: Option<Group<N>>, record_register_index: u16, id_dynamic: Field<N>, id_static: Field<N>, ) -> Self
Initializes a new translation assignment.
Sourcepub fn to_circuit_assignment<A: Aleo<Network = N>>(
&self,
translation_index: u16,
) -> Result<Assignment<N::Field>>
pub fn to_circuit_assignment<A: Aleo<Network = N>>( &self, translation_index: u16, ) -> Result<Assignment<N::Field>>
The circuit for record-translation verification
§Operation outline
The [[ ]] notation is used to denote public inputs or constants.
ⓘ
cm = commit([[program_id]], [[record_name]], record_static, record_view_key)
sn = serial_number(cm, gamma)
actual_id_non_external = is_to_static ? sn : cm
actual_id_external = HashPSD8([[function_id]] | record_static | tvk | [[record_register_index]])
actual_id_static = is_external ? actual_id_external : actual_id_non_external
actual_id_dynamic = HashPSD8([[function_id]] | record_dynamic | tvk | [[record_register_index]])
assert record_static.owner == record_dynamic.owner
assert record_static.nonce == record_dynamic.nonce
assert record_static.version == record_dynamic.version
assert merkleize(record_static) == record_dynamic.root
assert [[id_record_static]] == actual_id_static
assert [[id_record_dynamic]] == actual_id_dynamicTrait Implementations§
Auto Trait Implementations§
impl<N> !Freeze for TranslationAssignment<N>
impl<N> RefUnwindSafe for TranslationAssignment<N>where
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
N: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
impl<N> Send for TranslationAssignment<N>
impl<N> Sync for TranslationAssignment<N>
impl<N> Unpin for TranslationAssignment<N>where
<N as Environment>::Field: Unpin,
<N as Environment>::Projective: Unpin,
N: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N> UnsafeUnpin for TranslationAssignment<N>where
<N as Environment>::Field: UnsafeUnpin,
<N as Environment>::Projective: UnsafeUnpin,
<N as Environment>::Scalar: UnsafeUnpin,
impl<N> UnwindSafe for TranslationAssignment<N>where
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
N: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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