Skip to content

Commit 6a6b1f7

Browse files
gballetjsign
andcommitted
simplify the copy of proof elements
Co-Authored-by: Ignacio Hagopian <[email protected]>
1 parent fb04943 commit 6a6b1f7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

proof_ipa.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,17 @@ func (vp *VerkleProof) Copy() *VerkleProof {
6161
}
6262

6363
for i := range vp.OtherStems {
64-
copy(ret.OtherStems[i][:], vp.OtherStems[i][:])
64+
ret.OtherStems[i] = vp.OtherStems[i]
6565
}
6666

6767
copy(ret.DepthExtensionPresent, vp.DepthExtensionPresent)
6868
for i := range vp.CommitmentsByPath {
69-
copy(ret.CommitmentsByPath[i][:], vp.CommitmentsByPath[i][:])
69+
ret.CommitmentsByPath[i] = vp.CommitmentsByPath[i]
7070
}
71-
copy(ret.D[:], vp.D[:])
71+
ret.D = vp.D
7272

7373
if vp.IPAProof != nil {
74-
for i := range vp.IPAProof.CL {
75-
copy(ret.IPAProof.CL[i][:], vp.IPAProof.CL[i][:])
76-
copy(ret.IPAProof.CR[i][:], vp.IPAProof.CR[i][:])
77-
}
78-
copy(ret.IPAProof.FinalEvaluation[:], vp.IPAProof.FinalEvaluation[:])
74+
ret.IPAProof = vp.IPAProof
7975
}
8076

8177
return ret

0 commit comments

Comments
 (0)