@@ -104,7 +104,7 @@ secp256k1_batch* secp256k1_batch_create(const secp256k1_context* ctx, size_t max
104
104
size_t batch_size = sizeof (secp256k1_batch );
105
105
size_t batch_scratch_size = secp256k1_batch_scratch_size (2 * max_terms );
106
106
secp256k1_batch * batch = (secp256k1_batch * )checked_malloc (& ctx -> error_callback , batch_size );
107
- unsigned char null_array [16 ] = {0 };
107
+ unsigned char zeros [16 ] = {0 };
108
108
109
109
VERIFY_CHECK (ctx != NULL );
110
110
ARG_CHECK (max_terms != 0 );
@@ -139,7 +139,7 @@ secp256k1_batch* secp256k1_batch_create(const secp256k1_context* ctx, size_t max
139
139
secp256k1_sha256_write (& batch -> sha256 , aux_rand16 , 16 );
140
140
} else {
141
141
/* use 16 bytes of 0x0000...000, if no fresh randomness provided */
142
- secp256k1_sha256_write (& batch -> sha256 , null_array , 16 );
142
+ secp256k1_sha256_write (& batch -> sha256 , zeros , 16 );
143
143
}
144
144
batch -> len = 0 ;
145
145
batch -> result = 1 ;
@@ -179,7 +179,6 @@ int secp256k1_batch_usable(const secp256k1_context *ctx, const secp256k1_batch *
179
179
*/
180
180
int secp256k1_batch_verify (const secp256k1_context * ctx , secp256k1_batch * batch ) {
181
181
secp256k1_gej resj ;
182
- int mid_res ;
183
182
184
183
VERIFY_CHECK (ctx != NULL );
185
184
ARG_CHECK (batch != NULL );
@@ -189,10 +188,8 @@ int secp256k1_batch_verify(const secp256k1_context *ctx, secp256k1_batch *batch)
189
188
}
190
189
191
190
if (batch -> len > 0 ) {
192
- if (batch -> scalars != NULL && batch -> points != NULL ) {
193
- mid_res = secp256k1_ecmult_strauss_batch_prealloc_scratch (& ctx -> error_callback , batch -> data , & resj , batch -> scalars , batch -> points , & batch -> sc_g , batch -> len ) && secp256k1_gej_is_infinity (& resj );
194
- batch -> result = batch -> result && mid_res ;
195
- }
191
+ int mid_res = secp256k1_ecmult_strauss_batch_prealloc_scratch (& ctx -> error_callback , batch -> data , & resj , batch -> scalars , batch -> points , & batch -> sc_g , batch -> len ) && secp256k1_gej_is_infinity (& resj );
192
+ batch -> result = batch -> result && mid_res ;
196
193
}
197
194
198
195
return batch -> result ;
0 commit comments