lambdaclass / cairo-vm_in_go

cairo-vm_in_go is a Go implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
Apache License 2.0
56 stars 13 forks source link

Abstract big integer representation for hints #283

Closed fmoletta closed 1 year ago

fmoletta commented 1 year ago

Across multiple hints, structs are used to represent big integers, all consisting of a set of Felts of varying size. The logic is the same for all structs, so it doesn't make sense to implement it for each struct separately. As we don't have const generics i go, we can't really make a generic structure to represent all of these types, but we can abstract the logic of each method into functions operating over a slice of Felts. And implement wrappers for each type using these methods What this Pr does:

codecov-commenter commented 1 year ago

Codecov Report

Merging #283 (cddf2db) into main (102682a) will decrease coverage by 0.76%. The diff coverage is 28.57%.

@@            Coverage Diff             @@
##             main     #283      +/-   ##
==========================================
- Coverage   58.75%   57.99%   -0.76%     
==========================================
  Files          42       43       +1     
  Lines        5383     5419      +36     
==========================================
- Hits         3163     3143      -20     
- Misses       1947     2003      +56     
  Partials      273      273              
Files Changed Coverage Δ
pkg/hints/hint_utils/bigint_utils.go 0.00% <0.00%> (ø)
pkg/hints/ec_hint.go 62.88% <100.00%> (-3.50%) :arrow_down:
pkg/hints/hint_processor.go 98.34% <100.00%> (ø)

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more