Skip to content

cksum: Accept SHAKE algorithms#10772

Open
RenjiSann wants to merge 4 commits intouutils:mainfrom
RenjiSann:cksum-shake-fix
Open

cksum: Accept SHAKE algorithms#10772
RenjiSann wants to merge 4 commits intouutils:mainfrom
RenjiSann:cksum-shake-fix

Conversation

@RenjiSann
Copy link
Collaborator

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@RenjiSann RenjiSann force-pushed the cksum-shake-fix branch 2 times, most recently from ac03a07 to 8e60327 Compare February 6, 2026 17:26
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

GNU testsuite comparison:

GNU test failed: tests/tail/tail-n0f. tests/tail/tail-n0f is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@oech3
Copy link
Contributor

oech3 commented Feb 6, 2026

On Arch Linux, shake128sum -N non_negative_integer /dev/null is possible:

       -N, -O output-size
              Change the output size.

@RenjiSann
Copy link
Collaborator Author

On Arch Linux, shake128sum -N non_negative_integer /dev/null is possible:

       -N, -O output-size
              Change the output size.

Since we are embedding this in cksum, I'd rather keep -l to not pollute the --help and argument processing with algorithm-specific flags.

@RenjiSann RenjiSann force-pushed the cksum-shake-fix branch 2 times, most recently from e6ace7d to 36a9386 Compare February 7, 2026 01:36
@RenjiSann RenjiSann marked this pull request as ready for review February 7, 2026 01:36
@RenjiSann
Copy link
Collaborator Author

I have an issue with what behavior should we prefer for --length sanitization. Since we're expecting a bit length we're always full bytes, any value not a multiple of 8 doesn't make sense. So either:
a) Like BLAKE2b, we make values that are not a multiple of 8 an invalid argument;
b) Or, like this website, we round this value to the biggest smaller multiple of 8.

For the sake of consistency within our tool, I'm more inclined to do a).

WDYT @oech3

@oech3
Copy link
Contributor

oech3 commented Feb 7, 2026

Hmm...

$ shake128sum -N 1 /dev/null
01  /dev/null
$ shake128sum -N 2 /dev/null
03  /dev/null
$ shake128sum -N 3 /dev/null
07  /dev/null
$ shake128sum -N 4 /dev/null
0f  /dev/null
$ shake128sum -N 5 /dev/null
1f  /dev/null
$ shake128sum -N 6 /dev/null
3f  /dev/null
$ shake128sum -N 7 /dev/null
7f  /dev/null
$ shake128sum -N 8 /dev/null
7f  /dev/null

$ shake128sum /dev/null
7f9c2ba4e88f827d616045507605853e  /dev/null
$ shake128sum -N 128 /dev/null
7f9c2ba4e88f827d616045507605853e  /dev/null

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/follow-name (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@RenjiSann
Copy link
Collaborator Author

I see, that's not what our hashsum implementation used to do, but it's quite easy to implement

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

GNU testsuite comparison:

GNU test failed: tests/tail/symlink. tests/tail/symlink is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/follow-name (fails in this run but passes in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants