Enum cairo_lang_casm::hints::Hint
source · pub enum Hint {
Show 34 variants
AllocSegment {
dst: CellRef,
},
TestLessThan {
lhs: ResOperand,
rhs: ResOperand,
dst: CellRef,
},
TestLessThanOrEqual {
lhs: ResOperand,
rhs: ResOperand,
dst: CellRef,
},
DivMod {
lhs: ResOperand,
rhs: ResOperand,
quotient: CellRef,
remainder: CellRef,
},
SquareRoot {
value: ResOperand,
dst: CellRef,
},
LinearSplit {
value: ResOperand,
scalar: ResOperand,
max_x: ResOperand,
x: CellRef,
y: CellRef,
},
AllocFelt252Dict {
segment_arena_ptr: ResOperand,
},
Felt252DictRead {
dict_ptr: ResOperand,
key: ResOperand,
value_dst: CellRef,
},
Felt252DictWrite {
dict_ptr: ResOperand,
key: ResOperand,
value: ResOperand,
},
GetSegmentArenaIndex {
dict_end_ptr: ResOperand,
dict_index: CellRef,
},
InitSquashData {
dict_accesses: ResOperand,
ptr_diff: ResOperand,
n_accesses: ResOperand,
big_keys: CellRef,
first_key: CellRef,
},
GetCurrentAccessIndex {
range_check_ptr: ResOperand,
},
ShouldSkipSquashLoop {
should_skip_loop: CellRef,
},
GetCurrentAccessDelta {
index_delta_minus1: CellRef,
},
ShouldContinueSquashLoop {
should_continue: CellRef,
},
AssertCurrentAccessIndicesIsEmpty,
AssertAllAccessesUsed {
n_used_accesses: CellRef,
},
AssertAllKeysUsed,
GetNextDictKey {
next_key: CellRef,
},
AssertLtAssertValidInput {
a: ResOperand,
b: ResOperand,
},
AssertLeFindSmallArcs {
range_check_ptr: ResOperand,
a: ResOperand,
b: ResOperand,
},
AssertLeIsFirstArcExcluded {
skip_exclude_a_flag: CellRef,
},
AssertLeIsSecondArcExcluded {
skip_exclude_b_minus_a: CellRef,
},
AssertLeAssertThirdArcExcluded,
RandomEcPoint {
x: CellRef,
y: CellRef,
},
FieldSqrt {
val: ResOperand,
sqrt: CellRef,
},
SystemCall {
system: ResOperand,
},
DebugPrint {
start: ResOperand,
end: ResOperand,
},
AllocConstantSize {
size: ResOperand,
dst: CellRef,
},
SetBlockNumber {
value: ResOperand,
},
SetBlockTimestamp {
value: ResOperand,
},
SetCallerAddress {
value: ResOperand,
},
SetContractAddress {
value: ResOperand,
},
SetSequencerAddress {
value: ResOperand,
},
}
Variants§
AllocSegment
TestLessThan
TestLessThanOrEqual
DivMod
SquareRoot
LinearSplit
Finds some x
and y
such that x * scalar + y = value
and x <= max_x
.
AllocFelt252Dict
Fields
segment_arena_ptr: ResOperand
Allocates a new dict segment, and write its start address into the dict_infos segment.
Felt252DictRead
Retrives and writes the value corresponding to the given dict and key from the vm dict_manager.
Felt252DictWrite
Sets the value correspoinding to the key in the vm dict_manager.
GetSegmentArenaIndex
Retrives the index of the given dict in the dict_infos segment.
InitSquashData
Initialized the lists of accesses of each key of a dict as a preparation of squash_dict.
GetCurrentAccessIndex
Fields
range_check_ptr: ResOperand
Retrives the current index of a dict access to process.
ShouldSkipSquashLoop
Writes if the squash_dict loop should be skipped.
GetCurrentAccessDelta
Writes the delta from the current access index to the next one.
ShouldContinueSquashLoop
Writes if the squash_dict loop should be continued.
AssertCurrentAccessIndicesIsEmpty
Asserts that the current access indices list is empty (after the loop).
AssertAllAccessesUsed
Asserts that the number of used accesses is equal to the length of the original accesses list.
AssertAllKeysUsed
Asserts that the keys list is empty.
GetNextDictKey
Writes the next dict key to process.
AssertLtAssertValidInput
Asserts that the input represents integers and that a<b.
AssertLeFindSmallArcs
Finds the two small arcs from within [(0,a),(a,b),(b,PRIME)] and writes it to the range_check segment.
AssertLeIsFirstArcExcluded
Writes if the arc (0,a) was excluded.
AssertLeIsSecondArcExcluded
Writes if the arc (a,b) was excluded.
AssertLeAssertThirdArcExcluded
Asserts that the arc (b, PRIME) was excluded.
RandomEcPoint
Samples a random point on the EC.
FieldSqrt
Computes the square root of val
, if val
is a quadratic residue, and of 3 * val
otherwise.
Since 3 is not a quadratic residue, exactly one of val
and 3 * val
is a quadratic
residue (unless val
is 0). This allows proving that val
is not a quadratic residue.
SystemCall
Fields
system: ResOperand
Represents a hint that triggers a system call.
DebugPrint
Prints the values from start to end. Both must be pointers.
AllocConstantSize
Returns an address with size
free locations afterwards.
SetBlockNumber
Fields
value: ResOperand
SetBlockTimestamp
Fields
value: ResOperand
SetCallerAddress
Fields
value: ResOperand
SetContractAddress
Fields
value: ResOperand
SetSequencerAddress
Fields
value: ResOperand
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hint
impl<'de> Deserialize<'de> for Hint
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<Hint> for Hint
impl PartialEq<Hint> for Hint
impl Eq for Hint
impl StructuralEq for Hint
impl StructuralPartialEq for Hint
Auto Trait Implementations§
impl RefUnwindSafe for Hint
impl Send for Hint
impl Sync for Hint
impl Unpin for Hint
impl UnwindSafe for Hint
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.