Skip to content

fix: wrong checksum shift in W=256 case - #7

Open
qkniep wants to merge 1 commit into
lentus:masterfrom
qkniep:fix-w256-checksum-shift
Open

qkniep wants to merge 1 commit into
lentus:masterfrom
qkniep:fix-w256-checksum-shift

Conversation

@qkniep

@qkniep qkniep commented May 21, 2026

Copy link
Copy Markdown

In the W=256 case, the checksum is shifted by 8 instead of 0 in:

csum <<= 8 - ((uint(l2) * logW) % 8)

This is because in that case l2 * logW = 16 and thus we get 8-0, which is then not reduced modulo 8 again. This results in dropping 8 of the 16 bits of the checksum, making the scheme insecure.

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.

1 participant