borg icon indicating copy to clipboard operation
borg copied to clipboard

blake2b_256: fix key passing, fixes #8867

Open ThomasWaldmann opened this issue 7 months ago • 1 comments

borg 1.x involved the key a bit unusually in the blake2b hash calculation (padding 64B of key material with another 64B of zeros to a total of 128B and then just prepending it to the data).

since a while, we use blake2b from python stdlib and they support passing the key as a separate argument. up to 64B keys are allowed here.

besides the way how the 64B of key material are passed, there are also other differences in how the key gets involved in the digest computation, thus the legacy blake2b hashes from borg 1.x are not compatible with the ones borg 2 will use. The hash is not the same for same key and data values.

ThomasWaldmann avatar May 28 '25 23:05 ThomasWaldmann

Codecov Report

:x: Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 81.46%. Comparing base (5aa536d) to head (8e85f90). :warning: Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/archiver/benchmark_cmd.py 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8887      +/-   ##
==========================================
+ Coverage   81.43%   81.46%   +0.02%     
==========================================
  Files          77       77              
  Lines       13515    13530      +15     
  Branches     2004     2004              
==========================================
+ Hits        11006    11022      +16     
  Misses       1853     1853              
+ Partials      656      655       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 28 '25 23:05 codecov[bot]