Skip to content

basenc: decode --base58 input in one piece - #15852

Open
vibhuthespeedst wants to merge 1 commit into
uutils:mainfrom
vibhuthespeedst:basenc-base58-decode-whole-input
Open

vibhuthespeedst wants to merge 1 commit into
uutils:mainfrom
vibhuthespeedst:basenc-base58-decode-whole-input

Conversation

@vibhuthespeedst

Copy link
Copy Markdown

Fixes #15776

Base58 text is one big number, but fast_decode_buffer decoded and flushed the buffer every 1024 digits, so longer input decoded to the wrong bytes and basenc --base58 couldn't read back its own output.

Removed that early flush. Only base58 uses this path, and it is now decoded in one go after the loop, like the encoder already does.

Added a round-trip test with input well over 1024 digits.

Base58 text is one big number, but the decoder flushed every 1024
digits, so longer input decoded to the wrong bytes and basenc could not
read back its own output.

Fixes uutils#15776

This branch has not been deployed

No deployments
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.

basenc: --base58 -d decodes in 1024-digit chunks, giving wrong output

1 participant