Enum cairo_lang_casm::hints::Hint
source · pub enum Hint {
Show 35 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,
},
AllocDictFeltTo {
dict_manager_ptr: ResOperand,
},
DictFeltToRead {
dict_ptr: ResOperand,
key: ResOperand,
value_dst: CellRef,
},
DictFeltToWrite {
dict_ptr: ResOperand,
key: ResOperand,
value: ResOperand,
prev_value_dst: CellRef,
},
GetDictIndex {
dict_manager_ptr: ResOperand,
dict_end_ptr: ResOperand,
dict_index: CellRef,
},
SetDictTrackerEnd {
squashed_dict_start: ResOperand,
squashed_dict_end: ResOperand,
},
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
.
AllocDictFeltTo
Fields
dict_manager_ptr: ResOperand
Allocates a new dict segment, and write its start address into the dict_infos segment.
DictFeltToRead
Retrives and writes the value corresponding to the given dict and key from the vm dict_manager.
DictFeltToWrite
Sets the value correspoinding to the key in the vm dict_manager.
GetDictIndex
Retrives the index of the given dict in the dict_infos segment.
SetDictTrackerEnd
Sets the end of a finalized dict in the vm tracker of the dict.
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 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.