@@ -111,7 +111,7 @@ public unsafe (byte[][], byte[][]) ComputeCellsAndKZGProofs(byte[] blob)
111
111
return ( outCells , outProofs ) ;
112
112
}
113
113
114
- public bool VerifyCellKZGProofBatch ( byte [ ] [ ] rowCommitments , ulong [ ] rowIndices , ulong [ ] columnIndices , byte [ ] [ ] cells , byte [ ] [ ] proofs )
114
+ public bool VerifyCellKZGProofBatch ( byte [ ] [ ] commitments , ulong [ ] cellIndices , byte [ ] [ ] cells , byte [ ] [ ] proofs )
115
115
{
116
116
117
117
// Length checks
@@ -131,19 +131,19 @@ public bool VerifyCellKZGProofBatch(byte[][] rowCommitments, ulong[] rowIndices,
131
131
}
132
132
}
133
133
134
- for ( int i = 0 ; i < rowCommitments . Length ; i ++ )
134
+ for ( int i = 0 ; i < commitments . Length ; i ++ )
135
135
{
136
- if ( rowCommitments [ i ] . Length != BytesPerCommitment )
136
+ if ( commitments [ i ] . Length != BytesPerCommitment )
137
137
{
138
138
throw new ArgumentException ( $ "commitments at index { i } has an invalid length") ;
139
139
}
140
140
}
141
141
142
142
int numCells = cells . Length ;
143
143
int numProofs = proofs . Length ;
144
- int numRowCommitments = rowCommitments . Length ;
144
+ int numCommitments = commitments . Length ;
145
145
146
- byte * [ ] commPtrs = new byte * [ numRowCommitments ] ;
146
+ byte * [ ] commPtrs = new byte * [ numCommitments ] ;
147
147
byte * [ ] cellsPtrs = new byte * [ numCells ] ;
148
148
byte * [ ] proofsPtrs = new byte * [ numProofs ] ;
149
149
@@ -153,8 +153,7 @@ public bool VerifyCellKZGProofBatch(byte[][] rowCommitments, ulong[] rowIndices,
153
153
fixed ( byte * * commitmentPtrPtr = commPtrs )
154
154
fixed ( byte * * cellsPtrPtr = cellsPtrs )
155
155
fixed ( byte * * proofsPtrPtr = proofsPtrs )
156
- fixed ( ulong * rowIndicesPtr = rowIndices )
157
- fixed ( ulong * columnIndicesPtr = columnIndices )
156
+ fixed ( ulong * cellIndicesPtr = cellIndices )
158
157
{
159
158
// Get the pointer for each cell
160
159
for ( int i = 0 ; i < numCells ; i ++ )
@@ -166,9 +165,9 @@ public bool VerifyCellKZGProofBatch(byte[][] rowCommitments, ulong[] rowIndices,
166
165
}
167
166
168
167
// Get the pointer for each commitment
169
- for ( int i = 0 ; i < numRowCommitments ; i ++ )
168
+ for ( int i = 0 ; i < numCommitments ; i ++ )
170
169
{
171
- fixed ( byte * commPtr = rowCommitments [ i ] )
170
+ fixed ( byte * commPtr = commitments [ i ] )
172
171
{
173
172
commitmentPtrPtr [ i ] = commPtr ;
174
173
}
@@ -183,7 +182,7 @@ public bool VerifyCellKZGProofBatch(byte[][] rowCommitments, ulong[] rowIndices,
183
182
}
184
183
}
185
184
186
- CResult result = verify_cell_kzg_proof_batch ( _context , Convert . ToUInt64 ( rowCommitments . Length ) , commitmentPtrPtr , Convert . ToUInt64 ( rowIndices . Length ) , rowIndicesPtr , Convert . ToUInt64 ( columnIndices . Length ) , columnIndicesPtr , Convert . ToUInt64 ( cells . Length ) , cellsPtrPtr , Convert . ToUInt64 ( proofs . Length ) , proofsPtrPtr , verifiedPtr ) ;
185
+ CResult result = verify_cell_kzg_proof_batch ( _context , Convert . ToUInt64 ( commitments . Length ) , commitmentPtrPtr , Convert . ToUInt64 ( cellIndices . Length ) , cellIndicesPtr , Convert . ToUInt64 ( cells . Length ) , cellsPtrPtr , Convert . ToUInt64 ( proofs . Length ) , proofsPtrPtr , verifiedPtr ) ;
187
186
ThrowOnError ( result ) ;
188
187
}
189
188
return verified ;
0 commit comments