Skip to content

Commit

Permalink
Copy from pointer source.
Browse files Browse the repository at this point in the history
  • Loading branch information
markkurossi committed Aug 3, 2024
1 parent 13b910f commit 09d05f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion testsuite/lang/copy_ptr.mpcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ func FeOne(fe *FieldElement) {
fe[0] = 1
}

func FeCopy(dst, src *FieldElement) {
copy(dst[:], src[:])
}

type ProjectiveGroupElement struct {
X, Y, Z FieldElement
}
Expand All @@ -31,5 +35,8 @@ func main(a, b int32) int {

pge.Zero()

return pge.X[0] + pge.Y[0] + pge.Z[0]
var y FieldElement
FeCopy(&y, &pge.Y)

return pge.X[0] + y[0] + pge.Z[0]
}

0 comments on commit 09d05f1

Please sign in to comment.