Skip to content

Commit 95a0af5

Browse files
committed
Fix: Print correct algorithm name when benchmarking Blake3
1 parent 0f747b7 commit 95a0af5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Tue 15 Apr 2025 Aleksey Kravchenko
2+
* Support --blake3 option for the BLAKE3 hash function
3+
14
Tue 18 Mar 2025 Etienne Brateau
25
* Support GNU/Hurd platform for --target argument
36

calc_sums.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ void run_benchmark(uint64_t hash_mask, unsigned flags)
590590
sz_mb = msg_size / (1 << 20); /* size in MiB */
591591

592592
if (hash_mask && (hash_mask & (hash_mask - 1)) == 0) {
593-
hash_name = rhash_get_name(hash_id_to_bit64(hash_mask));
593+
hash_name = rhash_get_name(bit64_to_hash_id(hash_mask));
594594
if (!hash_name) hash_name = ""; /* unsupported hash function */
595595
}
596596
RSH_REQUIRE(hash_mask_to_hash_ids(hash_mask, 64, hash_ids, &hash_ids_count) >= 0,

dist/rhash.1.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ rhash \- calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other message dige
1313
computes and verifies various message digests and checksums of files.
1414
Supported hash algorithms include CRC32, CRC32C, MD4, MD5, SHA1,
1515
SHA256, SHA512, SHA3, Tiger, DC++ TTH, BTIH, AICH, ED2K, GOST R 34.11\-*,
16-
RIPEMD\-160, HAS\-160, BLAKE2s/BLAKE2b, EDON\-R 256/512, Whirlpool, Snefru\-128/256.
16+
RIPEMD\-160, HAS\-160, BLAKE2s/BLAKE2b, BLAKE3, EDON\-R 256/512,
17+
Whirlpool, Snefru\-128/256.
1718

1819
The program can create and verify Magnet links
1920
and eDonkey ed2k:// links, see \-\-magnet and \-\-ed2k\-link options.
@@ -119,6 +120,8 @@ SNEFRU: Select SNEFRU\-128/256 hash function.
119120
EDON\-R: Select EDON\-R 256/512 hash function.
120121
.IP "\-\-blake2b, \-\-blake2s"
121122
BLAKE2: Select BLAKE2b/BLAKE2s hash function.
123+
.IP "\-\-blake3"
124+
BLAKE3: Select BLAKE3 hash function.
122125

123126
.IP "\-a, \-\-all"
124127
Calculate all supported hash functions.
@@ -308,7 +311,7 @@ Whirlpool message digest.
308311
%{gost94}, %{gost94\-cryptopro}, %{gost12\-256}, %{gost12\-512},\
309312
%{sha\-224}, %{sha\-256}, %{sha\-384}, %{sha\-512},\
310313
%{sha3\-224}, %{sha3\-256}, %{sha3\-384}, %{sha3\-512},\
311-
%{edon\-r256}, %{edon\-r512}, %{blake2s}, %{blake2b},\
314+
%{edon\-r256}, %{edon\-r512}, %{blake2s}, %{blake2b}, %{blake3},\
312315
%{snefru128}, %{snefru256}"
313316
Print the specified message digest. It is printed in uppercase, if the
314317
hash function name starts with a capital letter, e.g. %{TTH}, %{Sha-512}.
@@ -323,7 +326,7 @@ placing a hardlink/symlink to it with a filename containing strings `crc32',
323326
`sha3\-256', `sha3\-512', `sha3\-224', `sha3\-384', `tiger', `tth',
324327
`btih', `aich', `ed2k', `ed2k\-link', `gost12\-256', `gost12\-512',
325328
`gost94', `gost94\-cryptopro', `rmd160', `has160', `whirlpool',
326-
`edonr256', `edonr512', `blake2s', `blake2b',
329+
`edonr256', `edonr512', `blake2s', `blake2b', `blake3',
327330
`snefru128', `snefru256', `sfv' , `bsd' or `magnet'.
328331

329332
.SH CONFIG FILE

0 commit comments

Comments
 (0)