Not getting the correct result with SHA3

Denys Vlasenko vda.linux at googlemail.com
Mon Aug 29 12:10:56 UTC 2016


On Sat, Aug 27, 2016 at 10:31 AM, Lauri Kasanen <curaga at operamail.com> wrote:
> On Fri, Aug 26, 2016, at 21:28, Marlon Smith wrote:
>> Hi everyone,
>>
>> I'm using Busybox version 1.23.1 and it seems like sha3sum is giving an
>> incorrect result.
>>
>> For example if I run this command:
>>
>> echo "abc" | sha3sum
>>
>> I get an incorrect result:
>>
>> e0a651904afe783ec83eeb586a2e602a09c43a3c6d795549ed7a58caae661074beaccd16d470ce4eac3ba98feee94bead3916ef4a75c1501
>> 1f07df348ce7a9e7
>>
>> I'm running BusyBox on an i.MX6 embedded Linux system based on Yocto.
>>
>> Does anyone know why this could be the case?
>
> Hi,
>
> We're aware. SHA3 changed after we made the applet, IIRC in the padding
> bits added after the data. Patches welcome, I'm really busy.

I guess this is an example why it makes sense to wait for general
adoption of the tool in common distros before adding it to busybox.

The bug was that SHA3 uses 0110*1 padding (raw Keccak uses 10*1).
Easy to fix.

sha3sum which I found on Fedora is a Perl script (oookay...),
it defaults to SHA3-224 and has an -a BITS option.

Fixed both in git. Please try it.


More information about the busybox mailing list