Skip to content

Fix BLAKE3 multi-chunk finalisation and wide hashing - #69

Merged
Coralesoft merged 1 commit into
mainfrom
fix/issue-65-blake3-big-endian
Aug 5, 2026
Merged

Fix BLAKE3 multi-chunk finalisation and wide hashing#69
Coralesoft merged 1 commit into
mainfrom
fix/issue-65-blake3-big-endian

Conversation

@Coralesoft

Copy link
Copy Markdown
Collaborator

Fixes the s390x BLAKE3 failures reported in #65 and two related defects found in the same finalisation path.

  • Parent chaining values were written in native byte order, producing incorrect multi-chunk digests on big-endian targets.
  • Partial final blocks were not zero-padded, allowing affected digests to depend on uninitialised stack contents.
  • The SSE4.1, AVX2 and AVX512 paths consumed the final complete chunk from single-shot Update() calls. For exact power-of-two chunk counts, finalisation then underflowed the CV stack index.

Adds the official 1025, 2049, 3073 and 4097-byte vectors, plus single-shot coverage for the wide paths and keyed hashing.

Closes #65.

Store parent chaining values in little-endian order and zero-pad partial final blocks. Adjust the SSE4.1, AVX2 and AVX512 paths to leave the final chunk in the chunk state, avoiding CV stack underflow for exact power-of-two chunk counts.

Add official multi-chunk vectors and single-shot coverage for the affected lengths, including keyed hashing.

Refs: #65
@Coralesoft
Coralesoft merged commit 56e7f20 into main Aug 5, 2026
47 checks passed
@Coralesoft
Coralesoft deleted the fix/issue-65-blake3-big-endian branch August 5, 2026 08:40
@Coralesoft Coralesoft mentioned this pull request Aug 5, 2026
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.

2026.8.0: Tests failsbug on s390x

1 participant