MCPcopy Create free account

hub / github.com/NethermindEth/cairo-vm-go / functions

Functions1,195 in github.com/NethermindEth/cairo-vm-go

↓ 1,431 callersFunctionfeltUint64
(v uint64)
pkg/hintrunner/zero/zerohint_utils_test.go:60
↓ 662 callersFunctionfeltString
(s string)
pkg/hintrunner/zero/zerohint_utils_test.go:48
↓ 374 callersMethodEqual
(other *MemoryValue)
pkg/vm/memory/memory_value.go:252
↓ 272 callersMethodGetReference
(name string)
pkg/hintrunner/zero/hint_reference_resolver.go:29
↓ 236 callersFunctionfeltInt64
(v int64)
pkg/hintrunner/zero/zerohint_utils_test.go:56
↓ 181 callersMethodGet
(vm *VM.VirtualMachine)
pkg/hintrunner/hinter/operand.go:17
↓ 176 callersFunctionWriteTo
(vm *VM.VirtualMachine, segment int, offset uint64, val memory.MemoryValue)
pkg/hintrunner/utils/testutils.go:8
↓ 174 callersMethodWriteToAddress
Writes to a memory address a new memory value. Errors if writing to an unallocated segment or if overwriting a different memory value
pkg/vm/memory/memory.go:301
↓ 133 callersFunctionMemoryValueFromFieldElement
(felt *f.Element)
pkg/vm/memory/memory_value.go:135
↓ 119 callersFunctionaddr
(offset uint64)
pkg/hintrunner/zero/zerohint_utils_test.go:19
↓ 97 callersFunctionbigIntString
(s string, base int)
pkg/hintrunner/zero/zerohint_utils_test.go:40
↓ 95 callersFunctionallVarValueEquals
(expectedValues map[string]*fp.Element)
pkg/hintrunner/zero/zerohint_utils_test.go:110
↓ 90 callersFunctionReadFrom
(vm *VM.VirtualMachine, segment int, offset uint64)
pkg/hintrunner/utils/testutils.go:15
↓ 89 callersMethodSub
Subs two memory values if they're in the same segment or the rhs is a Felt.
pkg/vm/memory/memory_value.go:279
↓ 82 callersFunctionvarValueEquals
(varName string, expected *fp.Element)
pkg/hintrunner/zero/zerohint_utils_test.go:93
↓ 78 callersFunctionwriteToDataSegment
============== Util Functions ==============
pkg/vm/vm_test.go:1346
↓ 76 callersMethodWrite
Writes to a given segment index and offset a new memory value. Errors if writing to an unallocated segment or if overwriting a different memory value
pkg/vm/memory/memory.go:278
↓ 75 callersMethodAssignVariable
(name string, value any)
pkg/hintrunner/hinter/scope.go:47
↓ 75 callersMethodCmp
(other *MemoryAddress)
pkg/vm/memory/memory_value.go:27
↓ 70 callersMethodFieldElement
()
pkg/vm/memory/memory_value.go:215
↓ 70 callersMethodRun
()
pkg/runner/runner.go:191
↓ 67 callersMethodAdd
Adds two memory values if the second one is a Felt
pkg/vm/memory/memory_value.go:263
↓ 61 callersMethodMul
(lhs, rhs *MemoryValue)
pkg/vm/memory/memory_value.go:334
↓ 59 callersMethodAddOffset
(int16)
pkg/hintrunner/hinter/operand.go:23
↓ 59 callersFunctionMemoryValueFromInt
(v T)
pkg/vm/memory/memory_value.go:142
↓ 53 callersMethodResolve
(vm *VM.VirtualMachine)
pkg/hintrunner/hinter/operand.go:18
↓ 53 callersFunctionerrorTextContains
(s string)
pkg/hintrunner/zero/zerohint_utils_test.go:260
↓ 52 callersFunctionResolveAsAddress
(vm *VM.VirtualMachine, op Reference)
pkg/hintrunner/hinter/utils.go:11
↓ 51 callersMethodKnown
()
pkg/vm/memory/memory_value.go:237
↓ 50 callersFunctionconsecutiveVarAddrResolvedValueEquals
(varName string, expectedValues []*fp.Element)
pkg/hintrunner/zero/zerohint_utils_test.go:118
↓ 49 callersFunctionResolveAsFelt
(vm *VM.VirtualMachine, op Reference)
pkg/hintrunner/hinter/utils.go:25
↓ 48 callersFunctionparseCellRefer
(cr starknet.CellRef)
pkg/hintrunner/core/cairo_hintparser.go:11
↓ 48 callersFunctionparseResOperand
(ro starknet.ResOperand)
pkg/hintrunner/core/cairo_hintparser.go:77
↓ 47 callersMethodResolveAsBigInt3
(valAddr MemoryAddress)
pkg/vm/memory/memory_value.go:394
↓ 46 callersFunctionGetVariableAs
GetVariableAs retrieves a variable from the current scope and asserts its type
pkg/hintrunner/hinter/scope.go:91
↓ 44 callersFunctionDefaultVirtualMachine
()
pkg/vm/utils.go:10
↓ 44 callersMethodReadFromAddress
Reads a memory value given an address. Errors if reading from an unallocated segment or if reading an unknown memory value
pkg/vm/memory/memory.go:332
↓ 43 callersFunctionaddrBuiltin
(builtin builtins.BuiltinType, offset uint64)
pkg/hintrunner/zero/zerohint_utils_test.go:33
↓ 42 callersMethodAssignVariables
(values map[string]any)
pkg/hintrunner/hinter/scope.go:57
↓ 41 callersFunctionaddrWithSegment
(segment int, offset uint64)
pkg/hintrunner/zero/zerohint_utils_test.go:26
↓ 39 callersFunctionvarValueInScopeEquals
(varName string, expected any)
pkg/hintrunner/zero/zerohint_utils_test.go:171
↓ 37 callersMethodUint64
Returns a MemoryValue holding a felt as uint if it fits
pkg/vm/memory/memory_value.go:358
↓ 37 callersFunctionallVarValueInScopeEquals
(expectedValues map[string]any)
pkg/hintrunner/zero/zerohint_utils_test.go:252
↓ 33 callersMethodRead
Reads a memory value given the segment index and offset. Errors if reading from an unallocated segment or if reading an unknown memory value
pkg/vm/memory/memory.go:307
↓ 33 callersFunctionbiased
(num int16)
pkg/assembler/assembler_test.go:665
↓ 31 callersMethodSet
Given a key and a value, it sets the value at the given key
pkg/hintrunner/hinter/dict.go:29
↓ 27 callersFunctionMemoryValueFromMemoryAddress
(address *MemoryAddress)
pkg/vm/memory/memory_value.go:127
↓ 26 callersMethodRunStep
(hintRunner HintRunner)
pkg/vm/vm.go:133
↓ 25 callersMethodLen
returns the effective size of a segment length i.e the rightmost element index + 1
pkg/vm/memory/memory.go:88
↓ 25 callersFunctionapValueEquals
(expected *fp.Element)
pkg/hintrunner/zero/zerohint_utils_test.go:68
↓ 24 callersMethodAllocateEmptySegment
Allocates an empty segment and returns its index
pkg/vm/memory/memory.go:249
↓ 24 callersMethodString
()
pkg/vm/vm.go:35
↓ 24 callersFunctiondefaultVirtualMachineWithCode
(code string)
pkg/vm/utils.go:14
↓ 24 callersFunctionwriteToFile
(content string)
integration_tests/integration_tests_utils.go:19
↓ 23 callersMethodDiv
(lhs, rhs *MemoryValue)
pkg/vm/memory/memory_value.go:342
↓ 22 callersMethodEvaluate
()
pkg/hintrunner/zero/hintparser.go:169
↓ 22 callersMethodIsAddress
()
pkg/vm/memory/memory_value.go:229
↓ 22 callersFunctionRandomFeltElement
(rand *rand.Rand)
pkg/hintrunner/utils/utils.go:18
↓ 20 callersFunctioncheckResult
* Tests whether runner completes a trio a, b, c as the input implies: If inverse is False it tests whether a = x1, b = x2, c = None will be completed
pkg/vm/builtins/modulo_test.go:18
↓ 19 callersMethodAddInlineCASM
(code string)
pkg/runner/runner.go:621
↓ 19 callersMethodPeek
Given a segment index and offset, returns the memory value at that position, without modifying it in any way. Errors if peeking from an unallocated se
pkg/vm/memory/memory.go:374
↓ 19 callersFunctionnewBlake2sAddUint256Hint
Blake2sAddUint256 hint serializes a `uint256` number in a Blake2s compatible way `newBlake2sAddUint256Hint` takes 3 operanders as arguments - `low` a
pkg/hintrunner/zero/zerohint_blake.go:24
↓ 16 callersFunctionDecodeInstruction
* * Decode the bytecode into an instruction */
pkg/assembler/instruction.go:239
↓ 16 callersMethodGetConsecutiveMemoryValues
(addr MemoryAddress, size uint64)
pkg/vm/memory/memory_value.go:373
↓ 16 callersFunctionResolveAsUint64
(vm *VM.VirtualMachine, op Reference)
pkg/hintrunner/hinter/utils.go:39
↓ 16 callersFunctionmemoryValuePointerFromInt
(v T)
pkg/vm/memory/memory_value_test.go:149
↓ 15 callersMethodAddressAp
()
pkg/vm/vm.go:44
↓ 15 callersMethodGetVariableValue
(name string)
pkg/hintrunner/hinter/scope.go:77
↓ 15 callersMethodMemoryAddress
()
pkg/vm/memory/memory_value.go:208
↓ 15 callersFunctionMemoryValueFromUint
(v T)
pkg/vm/memory/memory_value.go:153
↓ 15 callersFunctionRightRot
(value uint32, n uint32)
pkg/utils/math.go:142
↓ 15 callersFunctioncreateRunner
(code string, layoutName string, builtins ...builtins.BuiltinType)
pkg/runner/runner_test.go:441
↓ 14 callersMethodAllocateBuiltinSegment
Allocate a Builtin segment
pkg/vm/memory/memory.go:267
↓ 14 callersFunctionGetUint256AsFelts
GetUint256AsFelts helper function reads two consecutive memory cells, the first one containing the low part of the `uint256` variable and the second o
pkg/hintrunner/zero/zerohint_utils.go:17
↓ 14 callersFunctionMemoryValueFromSegmentAndOffset
creates a memory value from an index and an offset. If either is negative the result is undefined
pkg/vm/memory/memory_value.go:162
↓ 14 callersFunctionSafeOffset
Takes a uint64 and an int16 and outputs their addition as well as the ocurrence of an overflow or underflow. This is a constant-time version of the f
pkg/utils/math.go:31
↓ 14 callersMethodcomputeRes
( instruction *asmb.Instruction, op0Addr *mem.MemoryAddress, op1Addr *mem.MemoryAddress, )
pkg/vm/vm.go:365
↓ 14 callersFunctionptrOf
(n T)
pkg/assembler/grammar_test.go:319
↓ 14 callersFunctionswapExtenstion
Given a certain file, it swaps its extension with a new suffix
integration_tests/integration_tests_utils.go:215
↓ 13 callersMethodEnterScope
(newScope map[string]any)
pkg/hintrunner/hinter/scope.go:35
↓ 13 callersMethodFindSegmentWithBuiltin
It finds a segment with a given builtin name, it returns the segment and true if found
pkg/vm/memory/memory.go:438
↓ 13 callersMethodaddrUnsafe
()
pkg/vm/memory/memory_value.go:369
↓ 13 callersFunctionconsecutiveVarValueEquals
(varName string, expectedValues []*fp.Element)
pkg/hintrunner/zero/zerohint_utils_test.go:134
↓ 12 callersFunctionNewModBuiltin
(ratio uint64, wordBitLen uint64, batchSize uint64, modBuiltinType ModBuiltinType)
pkg/vm/builtins/modulo.go:89
↓ 12 callersFunctionZeroProgramFromJSON
(content json.RawMessage)
pkg/parsers/zero/zero.go:123
↓ 12 callersFunctionnewNondetBigint3V1Hint
NondetBigint3V1 hint writes a value to a specified segment of memory `newNondetBigint3V1Hint` takes 1 operander as argument - `res` is the location i
pkg/hintrunner/zero/zerohint_ec.go:358
↓ 11 callersFunctionEmptySegmentWithLength
(length int)
pkg/vm/memory/memory.go:78
↓ 11 callersMethodIsZero
()
pkg/vm/memory/memory_value.go:241
↓ 11 callersMethodWithBuiltinRunner
(builtinRunner BuiltinRunner)
pkg/vm/memory/memory.go:56
↓ 11 callersMethodWriteUint256ToAddress
(addr MemoryAddress, low, high *f.Element)
pkg/vm/memory/memory.go:447
↓ 11 callersFunctionnewEcNegateHint
EcNegate hint negates the y-coordinate of a point on an elliptic curve modulo SECP_P `newEcNegateHint` takes 1 operander as argument - `point` is the
pkg/hintrunner/zero/zerohint_ec.go:168
↓ 11 callersFunctionnewElementPtr
create a pointer to an Element
pkg/vm/vm_test.go:1363
↓ 11 callersFunctionnewKeccakWriteArgsHint
KeccakWriteArgs hint writes Keccak function arguments in memory `newKeccakWriteArgsHint` takes 3 operanders as arguments - `inputs` is the address in
pkg/hintrunner/zero/zerohint_keccak.go:337
↓ 11 callersFunctionrunHinterTests
(t *testing.T, tests map[string][]hintTestCase)
pkg/hintrunner/zero/zerohint_test.go:99
↓ 10 callersFunctionDefaultRandGenerator
()
pkg/hintrunner/utils/utils.go:37
↓ 10 callersMethodReadFromAddressAsElement
Works the same as `ReadFromAddress` but `MemoryValue` is converted to `Element` first
pkg/vm/memory/memory.go:350
↓ 10 callersMethodsteps
()
pkg/runner/runner.go:582
↓ 9 callersFunctionEmptyMemoryValueAsAddress
()
pkg/vm/memory/memory_value.go:192
↓ 9 callersFunctionmix
(a uint32, b uint32, c uint32, d uint32, m0 uint32, m1 uint32)
pkg/utils/blake.go:33
↓ 9 callersFunctionnewSearchSortedLowerHint
SearchSortedLower hint searches for the first element in a sorted array that is greater than or equal to a given key and returns its index `newSearch
pkg/hintrunner/zero/zerohint_others.go:546
next →1–100 of 1,195, ranked by callers