pub struct GfaCore { /* private fields */ }
Expand description
An extension of AluVM core for the GFA256 ISA.
Implementations§
Source§impl GfaCore
Microcode for finite field arithmetics.
impl GfaCore
Microcode for finite field arithmetics.
Sourcepub fn test(&self, src: RegE) -> Status
pub fn test(&self, src: RegE) -> Status
Test whether the register has a value, returning a status.
§Register modification
No registers are modified, including CK
and CO
.
Sourcepub fn mov(&mut self, dst: RegE, src: RegE)
pub fn mov(&mut self, dst: RegE, src: RegE)
Move a value from the src
to dst
register.
The value of the src
register is not changed.
If the src
register does not have a value, sets dst
to None
, clearing any previous
value in it.
Sourcepub fn eqv(&mut self, src1: RegE, src2: RegE) -> Status
pub fn eqv(&mut self, src1: RegE, src2: RegE) -> Status
Checks the equivalence of values in src1
and src2
.
If both registers do not have a value, returns Status::Fail
.
Sourcepub fn add_mod(&mut self, dst_src: RegE, src: RegE) -> Status
pub fn add_mod(&mut self, dst_src: RegE, src: RegE) -> Status
Add a value from the src
register to dst_src
value, storing the result back in
dst_src
.
Overflow is handled according to finite field arithmetics, by doing a modulo-division. The fact of the overflow cannot be determined in order to keep the implementation compatible with zk-STARK and zk-SNARK circuits and arithmetizations.
§Returns
If any of src
or dst_src
registers do not have a value, returns Status::Fail
.
Otherwise, returns success.
Sourcepub fn mul_mod(&mut self, dst_src: RegE, src: RegE) -> Status
pub fn mul_mod(&mut self, dst_src: RegE, src: RegE) -> Status
Multiply a value from the src
register to dst_src
value, storing the result back in
dst_src
.
Overflow is handled according to finite field arithmetics, by doing a modulo-division. The fact of the overflow cannot be determined in order to keep the implementation compatible with zk-STARK and zk-SNARK circuits and arithmetizations.
§Returns
If any of src
or dst_src
registers do not have a value, returns Status::Fail
.
Otherwise, returns success.
Trait Implementations§
Source§impl CoreExt for GfaCore
impl CoreExt for GfaCore
Source§impl Supercore<GfaCore> for UsonicCore
impl Supercore<GfaCore> for UsonicCore
impl Copy for GfaCore
impl Eq for GfaCore
impl StructuralPartialEq for GfaCore
Auto Trait Implementations§
impl Freeze for GfaCore
impl RefUnwindSafe for GfaCore
impl Send for GfaCore
impl Sync for GfaCore
impl Unpin for GfaCore
impl UnwindSafe for GfaCore
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.