Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NethermindEth/cairo-vm-go
/ functions
Functions
1,195 in github.com/NethermindEth/cairo-vm-go
⨍
Functions
1,195
◇
Types & classes
243
↓ 9 callers
Function
newSplitOutputMidLowHighHint
SplitOutputMidLowHigh hint assigns to `ids.output1_low` the remainder of the division of `ids.output1` variable by 256 ** 7 and uses its quotient as a
pkg/hintrunner/zero/zerohint_keccak.go:777
↓ 9 callers
Function
noErrorAndEqualSegmentRead
compares the memory value match an expected value at the given segment and offset
pkg/vm/memory/memory_test.go:266
↓ 9 callers
Function
parseCode
(code string)
pkg/assembler/grammar_test.go:323
↓ 8 callers
Method
GetZeroDictionaryManager
()
pkg/hintrunner/hinter/scope.go:115
↓ 8 callers
Function
NewZeroDictionaryManager
()
pkg/hintrunner/hinter/zero_dict.go:52
↓ 8 callers
Function
StarknetProgramFromJSON
(content json.RawMessage)
pkg/parsers/starknet/starknet.go:102
↓ 8 callers
Method
getOp1Addr
(instruction *asmb.Instruction, op0Addr *mem.MemoryAddress)
pkg/vm/vm.go:270
↓ 8 callers
Function
newAssertNotEqualHint
AssertNotEqual hint asserts that two given values are not equal `newAssertNotEqualHint` takes 2 operanders as arguments - `a` and `b` are the values
pkg/hintrunner/zero/zerohint_math.go:203
↓ 8 callers
Function
newSignedDivRemHint
SignedDivRem hint computes a signed division and modulus operation on a given value, ensuring the quotient is within a specified range `newSignedDivR
pkg/hintrunner/zero/zerohint_math.go:865
↓ 8 callers
Function
newUnsignedDivRemHint
UnsignedDivRem hint computes an unsigned division and modulus operation on a given dividend and divisor `newUnsignedDivRemHinter` takes 4 operanders
pkg/hintrunner/zero/zerohint_math.go:1050
↓ 8 callers
Method
updatePc
( instruction *asmb.Instruction, dstAddr *mem.MemoryAddress, op1Addr *mem.MemoryAddress, res *mem.MemoryVa
pkg/vm/vm.go:433
↓ 7 callers
Function
FeltLe
FeltLe implements `a <= b` felt comparison.
pkg/utils/math.go:66
↓ 7 callers
Function
FeltLt
FeltLt implements `a < b` felt comparison.
pkg/utils/math.go:61
↓ 7 callers
Method
IsFelt
()
pkg/vm/memory/memory_value.go:233
↓ 7 callers
Method
NewDefaultDictionary
It creates a new segment which will hold dictionary values. It links this segment with the current dictionary and returns the address that points to t
pkg/hintrunner/hinter/zero_dict.go:76
↓ 7 callers
Method
PeekFromAddress
Given an address returns the memory value at that position, without modifying it in any way. Errors if peeking from an unallocated segment
pkg/vm/memory/memory.go:391
↓ 7 callers
Function
createSegment
utility to create segments easier
pkg/runner/runner_test.go:453
↓ 7 callers
Function
defaultSegment
creates a default segment with any given data. nil value represents unknown values
pkg/vm/memory/memory_test.go:273
↓ 7 callers
Function
getBuiltinAllocatedSize
(segmentUsedSize uint64, vmCurrentStep uint64, ratio uint64, inputCellsPerInstance uint64, instancesPerCompone
pkg/vm/builtins/builtin_runner.go:119
↓ 7 callers
Function
newFindElementHint
FindElement hint finds element in the array by given key. It either returns element at index provided by __find_element_index or searches for the key
pkg/hintrunner/zero/zerohint_others.go:235
↓ 7 callers
Function
newIsNNOutOfRangeHint
IsNNOutOfRange hint checks if the negation of a value minus one is non-negative within a specific range `newIsNNOutOfRangeHint` takes 1 operander as
pkg/hintrunner/zero/zerohint_math.go:459
↓ 7 callers
Function
newIsPositiveHint
IsPositive hint checks if a value is positive within a specific range and prime context `newIsPositiveHint` takes 2 operanders as arguments - `value`
pkg/hintrunner/zero/zerohint_math.go:508
↓ 7 callers
Function
newRecoverYHint
RecoverY hint Recovers the y coordinate of a point on the elliptic curve y^2 = x^3 + alpha * x + beta (mod field_prime) of a given x coordinate. `new
pkg/hintrunner/zero/zerohint_ec.go:1662
↓ 7 callers
Function
newUint256UnsignedDivRemHint
Uint256UnsignedDivRem hint computes the division and modulus operations on `uint256` variables, combining the `high` and `low` parts of the dividend a
pkg/hintrunner/zero/zerohint_uint256.go:294
↓ 7 callers
Function
parseSingleInstruction
(casmCode string)
pkg/assembler/assembler_test.go:640
↓ 7 callers
Function
parseSingleInstructionToInstrList
(casmCode string)
pkg/assembler/assembler_test.go:652
↓ 6 callers
Function
CasmToBytecode
Given a CASM program it returns its encoded bytecode and a total size of processed instructions
pkg/assembler/assembler.go:22
↓ 6 callers
Method
CheckWrite
(segment *memory.Segment, offset uint64, value *memory.MemoryValue)
pkg/vm/builtins/range_check.go:32
↓ 6 callers
Function
IV
()
pkg/utils/blake.go:6
↓ 6 callers
Method
IncreaseSegmentSize
Increase a segment allocated space. Panics if the new size is smaller
pkg/vm/memory/memory.go:146
↓ 6 callers
Function
InitializeScopeManager
(ctx *HintRunnerContext, scope map[string]any)
pkg/hintrunner/hinter/scope.go:16
↓ 6 callers
Method
LastKey
It returns the smallest key in the key list
pkg/hintrunner/hinter/dict.go:148
↓ 6 callers
Function
NewRunner
Creates a new Runner of a Cairo Zero program
pkg/runner/runner.go:47
↓ 6 callers
Function
SetContextWithScope
(scope map[string]any)
pkg/hintrunner/hinter/hinter.go:35
↓ 6 callers
Method
String
()
pkg/vm/builtins/modulo.go:119
↓ 6 callers
Method
WriteToNthStructField
(addr MemoryAddress, value MemoryValue, field int16)
pkg/vm/memory/memory.go:456
↓ 6 callers
Function
decodeProof
(traceLocation string, memoryLocation string)
integration_tests/integration_tests_utils.go:186
↓ 6 callers
Method
getDstAddr
(instruction *asmb.Instruction)
pkg/vm/vm.go:239
↓ 6 callers
Function
memoryRepr
(memory []*fp.Element)
integration_tests/integration_tests_utils.go:230
↓ 6 callers
Function
newAssert250bitsHint
Assert250bits hint asserts that a value is within the range of 250 bits `newAssert250bitsHint` takes 3 operanders as arguments - `value` is the value
pkg/hintrunner/zero/zerohint_math.go:264
↓ 6 callers
Function
newBigIntToUint256Hint
BigIntToUint256 hint guesses the low part of the `x` uint256 variable `newBigIntToUint256Hint` takes 2 operanders as arguments - `low` is the variabl
pkg/hintrunner/zero/zerohint_ec.go:96
↓ 6 callers
Function
newEcDoubleAssignNewXHint
EcDoubleAssignNewX hint computes a new x-coordinate for a point being doubled on an elliptic curve `newEcDoubleAssignNewXHint` takes 2 operanders as
pkg/hintrunner/zero/zerohint_ec.go:929
↓ 6 callers
Function
newFastEcAddAssignNewXHint
FastEcAddAssignNewX hint computes a new x-coordinate for fast elliptic curve addition `newFastEcAddAssignNewXHint` takes 3 operanders as arguments -
pkg/hintrunner/zero/zerohint_ec.go:426
↓ 6 callers
Function
newIsQuadResidueHint
(x, y hinter.Reference)
pkg/hintrunner/zero/zerohint_math.go:1130
↓ 6 callers
Function
newReduceHint
Reduce hint reduces a packed value modulo the SECP256K1 prime `newReduceHint` takes 1 operander as argument - `x` is the packed value to be reduced
pkg/hintrunner/zero/zerohint_ec.go:819
↓ 6 callers
Function
newSetAddHint
(elmSize, elmPtr, setPtr, setEndPtr, index, isElmInSet hinter.Reference)
pkg/hintrunner/zero/zerohint_others.go:416
↓ 6 callers
Function
newSplitInput12Hint
SplitInput12 hint assigns to `ids.high12` and `ids.low12` variables the quotient and remainder of the division of the value at memory address `ids.inp
pkg/hintrunner/zero/zerohint_keccak.go:601
↓ 6 callers
Function
newSplitInput15Hint
SplitInput15 hint assigns to `ids.high15` and `ids.low15` variables the quotient and remainder of the division of the value at memory address `ids.inp
pkg/hintrunner/zero/zerohint_keccak.go:688
↓ 6 callers
Function
newSplitInput3Hint
SplitInput3 hint assigns to `ids.high3` and `ids.low3` variables the quotient and remainder of the division of the value at memory address `ids.inputs
pkg/hintrunner/zero/zerohint_keccak.go:1028
↓ 6 callers
Function
newSplitInput6Hint
SplitInput6 hint assigns to `ids.high6` and `ids.low6` variables the quotient and remainder of the division of the value at memory address `ids.inputs
pkg/hintrunner/zero/zerohint_keccak.go:1114
↓ 6 callers
Function
newSplitInput9Hint
SplitInput9 hint assigns to `ids.high9` and `ids.low9` variables the quotient and remainder of the division of the value at memory address `ids.inputs
pkg/hintrunner/zero/zerohint_keccak.go:1201
↓ 6 callers
Function
newSplitNBytesHint
SplitNBytes hint assigns to `ids.n_words_to_copy` and `ids.n_bytes_left` variables the quotient and remainder of the division of `ids.n_bytes` variabl
pkg/hintrunner/zero/zerohint_keccak.go:951
↓ 6 callers
Function
newSquashDictHint
SquashDict hint as part of the larger dict_squash cairo function does data validation and writes to scope a set of variables which indicate the larges
pkg/hintrunner/zero/zerohint_dictionaries.go:448
↓ 6 callers
Function
newUnsafeKeccakFinalizeHint
UnsafeKeccakFinalize computes keccak hash of the data in memory without validity enforcement and writes the result in the `low` and `high` memory cell
pkg/hintrunner/zero/zerohint_keccak.go:224
↓ 6 callers
Function
newUsortBodyHint
UsortBody hint sorts the input array of field elements. The sorting results in generation of output array without duplicates and multiplicities array,
pkg/hintrunner/zero/zerohint_usort.go:49
↓ 6 callers
Function
traceRepr
(trace []vm.Trace)
integration_tests/integration_tests_utils.go:222
↓ 6 callers
Method
updateAp
(instruction *asmb.Instruction, res *mem.MemoryValue)
pkg/vm/vm.go:499
↓ 5 callers
Method
ApplyApTracking
(hint, ref zero.ApTracking)
pkg/hintrunner/hinter/operand.go:19
↓ 5 callers
Method
At
Gets the memory value at certain key
pkg/hintrunner/hinter/dict.go:21
↓ 5 callers
Function
Blake2sCompress
(message []uint32, h [8]uint32, t0 uint32, t1 uint32, f0 uint32, f1 uint32)
pkg/utils/blake.go:113
↓ 5 callers
Function
EmptySegment
()
pkg/vm/memory/memory.go:61
↓ 5 callers
Function
FeltIsPositive
(felt *fp.Element)
pkg/utils/math.go:71
↓ 5 callers
Function
Igcdex
(a, b *big.Int)
pkg/utils/math.go:156
↓ 5 callers
Function
Pop
(a *[]T)
pkg/utils/arrays.go:13
↓ 5 callers
Method
ReadAsElement
Works the same as `Read` but `MemoryValue` is converted to `Element` first
pkg/vm/memory/memory.go:337
↓ 5 callers
Method
RealLen
returns the real length that a segment has
pkg/vm/memory/memory.go:93
↓ 5 callers
Method
Size
()
pkg/disasm/casm.go:30
↓ 5 callers
Function
defaultVirtualMachineWithBytecode
(bytecode []*f.Element)
pkg/vm/utils.go:23
↓ 5 callers
Method
formatMemoryOperand
(reg assembler.Register, offset int)
pkg/disasm/casm_formatter.go:101
↓ 5 callers
Method
getOp0Addr
(instruction *asmb.Instruction)
pkg/vm/vm.go:254
↓ 5 callers
Function
newAssertLtFeltHint
AssertLtFelt hint asserts that one value is strictly less than another within a finite field `newAssertLtFeltHint` takes 2 operanders as arguments -
pkg/hintrunner/zero/zerohint_math.go:78
↓ 5 callers
Function
newDivModNPackedDivmodV1Hint
DivModNPackedDivmodV1 hint caculates the division modulo N for packed values `newDivModNPackedDivmodV1Hint` takes 2 operanders as arguments - `a` is
pkg/hintrunner/zero/zerohint_signature.go:397
↓ 5 callers
Function
newEcDoubleSlopeV1Hint
EcDoubleSlopeV1 hint computes the slope for doubling a point on an elliptic curve `newEcDoubleSlopeV1Hint` takes 1 operander as argument - `point` is
pkg/hintrunner/zero/zerohint_ec.go:661
↓ 5 callers
Function
newGetFeltBitLengthHint
GetFeltBitLength hint assigns to `bit_length` the bit length of `x` variable `newGetFeltBitLengthHint` takes 2 operanders as arguments - `x` is a fel
pkg/hintrunner/zero/zerohint_others.go:185
↓ 5 callers
Function
newIsZeroDivModHint
IsZeroDivMod hint computes the division modulo SECP_P prime for a given packed value `newIsZeroDivModHint` doesn't take any operander as argument `n
pkg/hintrunner/zero/zerohint_ec.go:1623
↓ 5 callers
Function
newIsZeroPackHint
IsZeroPack hint computes packed value modulo SECP_P prime `newIsZeroPackHint` takes 1 operander as argument - `x` is the value that will be packed an
pkg/hintrunner/zero/zerohint_ec.go:1569
↓ 5 callers
Function
newSplitIntHint
SplitIntHint hint splits an integer in limbs based on a base and asserts that each limb is within a certain range `newSplitIntHint` takes 4 operander
pkg/hintrunner/zero/zerohint_math.go:599
↓ 5 callers
Function
newSplitOutput0Hint
SplitOutput0 hint splits `output0` into `output0_low` (16 bytes) and `output0_high` (9 bytes) `newSplitOutput0Hint` takes 3 operanders as arguments -
pkg/hintrunner/zero/zerohint_keccak.go:874
↓ 5 callers
Function
newSqrtHint
Sqrt hint computes the square root of a given value, ensuring it falls within a specific range `newSqrtHint` takes 2 operanders as arguments - `root`
pkg/hintrunner/zero/zerohint_math.go:988
↓ 5 callers
Function
newSquashDictInnerUsedAccessesAssertHint
SquashDictInnerUsedAccessesAssert hint checks that `n_used_accesses` Cairo local variable is equal to the number of used accesses for a key during dic
pkg/hintrunner/zero/zerohint_dictionaries.go:971
↓ 5 callers
Function
newUint128AddHint
Uint128Add hint computes the result of the sum of parts of two `uint128` variables(`a` & `b`) and checks for overflow `newUint128AddHint` takes 3 ope
pkg/hintrunner/zero/zerohint_uint256.go:801
↓ 5 callers
Function
newUint128SqrtHint
Uint128Sqrt hint computes the result of the sum of parts of two `uint128` variables(`a` & `b`) and checks for overflow `newUint128AddHint` takes 3 op
pkg/hintrunner/zero/zerohint_uint256.go:863
↓ 5 callers
Function
newUint256AddHint
Uint256Add hint computes the sum of the `low` and `high` parts of two `uint256` variables and checks for overflow `newUint256AddHint` takes 4 operand
pkg/hintrunner/zero/zerohint_uint256.go:23
↓ 5 callers
Function
newUint256SqrtHint
Uint256Sqrt hint computes the square root of a given value, ensuring it falls within a specific range, i.e., `0 <= result < 2 ** 128` `newUint256Sqrt
pkg/hintrunner/zero/zerohint_uint256.go:188
↓ 5 callers
Function
newUnsafeKeccakHint
UnsafeKeccak computes keccak hash of the data in memory without validity enforcement and writes the result in the `low` and `high` memory cells `newU
pkg/hintrunner/zero/zerohint_keccak.go:88
↓ 5 callers
Function
newUsortVerifyMultiplicityBodyHint
UsortVerifyMultiplicityBody hint extracts a specific value of the sorted output with `pop`, updating indices for the verification of the next value `
pkg/hintrunner/zero/zerohint_usort.go:283
↓ 5 callers
Method
writeNWordsValue
Given a value, writes its n_words to memory, starting at address = addr.
pkg/vm/builtins/modulo.go:302
↓ 4 callers
Method
AddOffset
It crates a new memory address with the modified offset
pkg/vm/memory/memory_value.go:38
↓ 4 callers
Method
AsDeref
()
pkg/assembler/grammar.go:115
↓ 4 callers
Method
AsDoubleDeref
()
pkg/assembler/grammar.go:116
↓ 4 callers
Method
AsMathOperation
()
pkg/assembler/grammar.go:117
↓ 4 callers
Function
ComputeMessageSchedule
(input []uint32)
pkg/utils/sha256.go:5
↓ 4 callers
Method
Execute
(vm *VM.VirtualMachine, _ *hinter.HintRunnerContext)
pkg/hintrunner/core/hint.go:72
↓ 4 callers
Method
Execute
(vm *VM.VirtualMachine, _ *hinter.HintRunnerContext)
pkg/hintrunner/core/hint.go:211
↓ 4 callers
Method
Execute
(vm *VM.VirtualMachine, _ *hinter.HintRunnerContext)
pkg/hintrunner/core/hint.go:713
↓ 4 callers
Method
Execute
(vm *VM.VirtualMachine, _ *hinter.HintRunnerContext)
pkg/hintrunner/core/hint.go:927
↓ 4 callers
Method
GetDictionary
Given a memory address, it looks for the right dictionary using the segment index. If no segment is associated with the given segment index, it errors
pkg/hintrunner/hinter/zero_dict.go:90
↓ 4 callers
Function
InitializeEmptyMemory
todo(rodro): can the amount of segments be known before hand?
pkg/vm/memory/memory.go:221
↓ 4 callers
Function
Pack
(numBitsShift int, limbs ...*fp.Element)
pkg/hintrunner/zero/zerohint_utils.go:108
↓ 4 callers
Method
ReadAsAddress
Works the same as `Read` but `MemoryValue` is converted to `MemoryAddress` first
pkg/vm/memory/memory.go:355
← previous
next →
101–200 of 1,195, ranked by callers