Currently, we store digest length for Blake2b and Blake3 in BYTES, and in BITS for other algorithms.
This is very error prone, since there are some functions in uucore::features::checksum that accept a size argument whose interpretation as bits or bytes comes from the context provided along this argument.
First line to change is the comment here:
|
// Note: we store Blake*'s length as BYTES. |
|
Blake2b(usize), |
|
Blake3(usize), |
Currently, we store digest length for Blake2b and Blake3 in BYTES, and in BITS for other algorithms.
This is very error prone, since there are some functions in
uucore::features::checksumthat accept a size argument whose interpretation as bits or bytes comes from the context provided along this argument.First line to change is the comment here:
coreutils/src/uucore/src/lib/features/checksum/mod.rs
Lines 252 to 254 in b7d1715