Skip to content

Commit

Permalink
replace pointer parameter by its value
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Jan 16, 2025
1 parent ad41d1b commit 42dfc10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (
// used to convert the scalar elements of a field to frontend.Variable to be
// used in the circuit. The resulting frontend.Variable will be packed with
// in the field of the circuit compiler, so it should be used with care.
func PackScalarToVar[S emulated.FieldParams](api frontend.API, s *emulated.Element[S]) (frontend.Variable, error) {
func PackScalarToVar[S emulated.FieldParams](api frontend.API, s emulated.Element[S]) (frontend.Variable, error) {
var fr S
field, err := emulated.NewField[S](api)
if err != nil {
return nil, err
}
reduced := field.Reduce(s)
reduced := field.Reduce(&s)
var res frontend.Variable = 0
nbBits := fr.BitsPerLimb()
coef := new(big.Int)
Expand Down
2 changes: 1 addition & 1 deletion utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type testPackUnpackCircuit struct {

func (c *testPackUnpackCircuit) Define(api frontend.API) error {
// pack the emulated element to a variable
packed, err := PackScalarToVar[sw_bls12377.ScalarField](api, &c.Input)
packed, err := PackScalarToVar[sw_bls12377.ScalarField](api, c.Input)
if err != nil {
return err
}
Expand Down

0 comments on commit 42dfc10

Please sign in to comment.