Use less xxh64, add SHA256FileHashingWrapper - #9672
Merged
Merged
Conversation
Cryptographically strong and often hw accelerated nowadays. Also support by borgstore hash method.
Likely we will use them less or not at all in future.
Member
Author
|
@mr-raj12 Will also remove it from cache.py if that doesn't cause conflicts for you. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9672 +/- ##
==========================================
- Coverage 83.78% 83.78% -0.01%
==========================================
Files 93 93
Lines 15653 15633 -20
Branches 2353 2349 -4
==========================================
- Hits 13115 13098 -17
+ Misses 1796 1795 -1
+ Partials 742 740 -2 ☔ View full report in Codecov by Sentry. |
Contributor
no |
Member
Author
|
@mr-raj12 SHA256FileHashingWrapper is something you can use for your project. |
Member
Author
|
@mr-raj12 always update master before you start working on something. |
Contributor
sure |
ThomasWaldmann
added a commit
to ThomasWaldmann/borg
that referenced
this pull request
Jul 29, 2026
XXH64 (and the XXH64FileHashingWrapper) were removed in borgbackup#9672 / borgbackup#9750, which switched borg 2.x file integrity to SHA256. But borg 1.x wrote XXH64 checksums into the repo index/hints integrity data, so we need XXH64 to verify those files when reading a borg 1.x (legacy) repository during `borg transfer`. Rather than re-introducing the external "xxhash" PyPI package (and the libxxhash system dependency on msys2 that borgbackup#9750 dropped), add a small, dependency-free, streaming XXH64 implementation in cython to crypto.low_level. It is only used on the read path; borg 2.x native repos keep using SHA256. XXH64 is non-cryptographic and must not be used as a security mechanism. Tests use the official xxHash sanity-check vectors (the test buffer generator is transcribed verbatim from xxHash tests/sanity_test.c) and cover all code paths, streaming vs one-shot, and a legacy XXH64 integrity round-trip through IntegrityCheckedFile. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.