@@ -123,7 +123,7 @@ func KzgPointEvaluation(
123123 // versioned hash
124124 var versionedHashBytes [sha256 .Size ]uints.U8
125125 for i := range versionedHash {
126- res , err := conversion .NativeToBytes (api , versionedHash [len ( versionedHash ) - 1 - i ])
126+ res , err := conversion .NativeToBytes (api , versionedHash [i ])
127127 if err != nil {
128128 return fmt .Errorf ("convert versioned hash element %d to bytes: %w" , i , err )
129129 }
@@ -133,7 +133,7 @@ func KzgPointEvaluation(
133133 // commitment
134134 var comSerializedBytes [bls12381 .SizeOfG1AffineCompressed ]uints.U8
135135 for i := range commitmentCompressed {
136- res , err := conversion .NativeToBytes (api , commitmentCompressed [len ( commitmentCompressed ) - 1 - i ])
136+ res , err := conversion .NativeToBytes (api , commitmentCompressed [i ])
137137 if err != nil {
138138 return fmt .Errorf ("convert commitment element %d to bytes: %w" , i , err )
139139 }
@@ -142,7 +142,7 @@ func KzgPointEvaluation(
142142 // proof
143143 var proofSerialisedBytes [bls12381 .SizeOfG1AffineCompressed ]uints.U8
144144 for i := range proofCompressed {
145- res , err := conversion .NativeToBytes (api , proofCompressed [len ( proofCompressed ) - 1 - i ])
145+ res , err := conversion .NativeToBytes (api , proofCompressed [i ])
146146 if err != nil {
147147 return fmt .Errorf ("convert proof element %d to bytes: %w" , i , err )
148148 }
@@ -289,8 +289,8 @@ func KzgPointEvaluationFailure(
289289 Y : * fp .NewElement (0 ),
290290 }
291291 dummyVersionedHash := []frontend.Variable {
292- "0xdef7ab966d7b770905398eba3c444014" ,
293292 "0x010657f37554c781402a22917dee2f75" ,
293+ "0xdef7ab966d7b770905398eba3c444014" ,
294294 }
295295 // -- check that the masks of compressed commitment and proof are correct
296296 // (infinity, small y, large y). If either of them is not correct, then we
@@ -300,15 +300,15 @@ func KzgPointEvaluationFailure(
300300 // - first we unpack the packed commitment and proof into bytes
301301 var comSerializedBytes [bls12381 .SizeOfG1AffineCompressed ]uints.U8
302302 for i := range commitmentCompressed {
303- res , err := conversion .NativeToBytes (api , commitmentCompressed [len ( commitmentCompressed ) - 1 - i ])
303+ res , err := conversion .NativeToBytes (api , commitmentCompressed [i ])
304304 if err != nil {
305305 return fmt .Errorf ("convert commitment element %d to bytes: %w" , i , err )
306306 }
307307 copy (comSerializedBytes [i * 16 :(i + 1 )* 16 ], res [16 :])
308308 }
309309 var proofSerialisedBytes [bls12381 .SizeOfG1AffineCompressed ]uints.U8
310310 for i := range proofCompressed {
311- res , err := conversion .NativeToBytes (api , proofCompressed [len ( proofCompressed ) - 1 - i ])
311+ res , err := conversion .NativeToBytes (api , proofCompressed [i ])
312312 if err != nil {
313313 return fmt .Errorf ("convert proof element %d to bytes: %w" , i , err )
314314 }
@@ -458,7 +458,7 @@ func KzgPointEvaluationFailure(
458458 // - first map the versioned hash to bytes
459459 var versionedHashBytes [sha256 .Size ]uints.U8
460460 for i := range versionedHash {
461- res , err := conversion .NativeToBytes (api , versionedHash [len ( versionedHash ) - 1 - i ])
461+ res , err := conversion .NativeToBytes (api , versionedHash [i ])
462462 if err != nil {
463463 return fmt .Errorf ("convert versioned hash element %d to bytes: %w" , i , err )
464464 }
0 commit comments