As mentioned in https://github.com/elastic/elasticsearch/pull/96216, `LuceneVerifyingIndexOutput` always copies the last chunk byte-by-byte. This might be a pretty big chunk. We should be able to copy all the bytes up to the start of the checksum in bulk (and then I guess bulk-copy the checksum too not that this matters so much).

In the same area, `LuceneVerifyingIndexOutput` is the only subclass of `VerifyingIndexOutput` and there's no need for it to be an inner class of `Store`. `VerifyingIndexInput` also doesn't need to be an inner class.
server/src/test/java/org/elasticsearch/index/store/StoreTests.java
iwc.setUseCompoundFile(random.nextBoolean());
            iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND);
            try (IndexWriter writer = new IndexWriter(store.directory(), iwc)) {
                final String newDocValue = TestUtil.randomRealisticUnicodeString(random());
                logger.info("--> update doc [{}] with dv=[{}]", updateId, newDocValue);
                writer.updateBinaryDocValue(new Term("id", updateId), "dv", new BytesRef(newDocValue));
                writer.commit();
            }
            dvUpdateSnapshot = store.getMetadata(null);
        }
        logger.info("--> source: {}", dvUpdateSnapshot.fileMetadataMap());
        logger.info("--> target: {}", newCommitMetadata.fileMetadataMap());
        Store.RecoveryDiff dvUpdateDiff = dvUpdateSnapshot.recoveryDiff(newCommitMetadata);
        final int delFileCount;
        if (delFile == null || dvUpdateDiff.different.isEmpty()) {
            
            delFileCount = 0;
            assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different, empty());
        } else {
            
            delFileCount = 1;
            assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different.size(), equalTo(1));
            assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different.get(0).name(), endsWith(".liv"));
        }
        assertThat(dvUpdateDiff.toString(), dvUpdateDiff.identical.size(), equalTo(dvUpdateSnapshot.size() - 4 - delFileCount));
        assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different.size(), equalTo(delFileCount));
        assertThat(dvUpdateDiff.toString(), dvUpdateDiff.missing.size(), equalTo(4)); 
        deleteContent(store.directory());
        IOUtils.close(store);
    }