// Generate public keys in batches
for (; localBatchCount < HASH_BATCH_SIZE && currentKey <= threadRangeEnd; ++localBatchCount, ++currentKey) {
if (!secp256k1_ec_pubkey_create(ctx, &pubkey, priv)) {
std::cerr << "Failed to derive public key.\n";
continue;
}
size_t len = 33;
secp256k1_ec_pubkey_serialize(ctx, localPubKeys[localBatchCount], &len, &pubkey, SECP256K1_EC_COMPRESSED);
}
}