[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] sha3sum: New applet, v4
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2013-01-15 21:25:53
Message-ID: 201301152225.53196.vda.linux () googlemail ! com
[Download RAW message or body]

On Monday 14 January 2013 05:27, Denys Vlasenko wrote:
> On Thursday 10 January 2013 12:35, Baruch Siach wrote:
> > Hi Lauri,
> > 
> > On Thu, Jan 10, 2013 at 01:20:40PM +0200, Baruch Siach wrote:
> > > On Thu, Jan 10, 2013 at 12:50:41PM +0200, Lauri Kasanen wrote:
> > > > Running Rob Landley's mips image in qemu, this cut seems to give correct
> > > > results on big-endian in all cases.
> > > 
> > > This version works correctly on my PowerPC e500v2 based 32bit system. I only 
> > > tested against the pre-computed values in http://en.wikipedia.org/wiki/Sha3.
> > 
> > I just wanted to note the this SHA3 implementation is considerably slower than 
> > MD5 and SHA1 of Busybox, when run on my system. Sample results:
> 
> I think sha512 is a more fair comparison, but yes, even compared to that
> it is rather slow. 32-bit x86:
> 
> # dd if=/dev/zero bs=100M count=1 | ./busybox sha3sum
> 1+0 records in
> 1+0 records out
> 104857600 bytes (100.0MB) copied, 16.340429 seconds, 6.1MB/s
> f70d85fa2a47646901aa3ce6a804fec30cb1c47d68cd63ac731924fbbb2bb4e4440be3ae98087930cda7d655dfe6eff3079bae85447c7cd619a71dea2bc177f9 \
> - 
> # dd if=/dev/zero bs=100M count=1 | ./busybox sha512sum
> 1+0 records in
> 1+0 records out
> 104857600 bytes (100.0MB) copied, 3.720927 seconds, 26.9MB/s
> 2798503c2c7b718799324122137bf30a562aad1bc04bbf343daad225a5fd0d1fd5d269843a01ab00d4f8d8c5ab34f8956065f9831ef7459e9c487e895099e956 \
> - 
> Perhaps the algorithm is "too optimized" for size.

Sped it up a bit:

# dd if=/dev/zero bs=100M count=1 | ./busybox sha3sum
104857600 bytes (100.0MB) copied, 12.505967 seconds, 8.0MB/s
f70d85fa2a47646901aa3ce6a804fec30cb1c47d68cd63ac731924fbbb2bb4e4440be3ae98087930cda7d655dfe6eff3079bae85447c7cd619a71dea2bc177f9 \
-

Added CONFIG_SHA3_SMALL option, which can be set to CONFIG_SHA3_SMALL=0,
causing ~450 bytes larger, but much faster code:

# dd if=/dev/zero bs=100M count=1 | ./busybox sha3sum
104857600 bytes (100.0MB) copied, 5.785298 seconds, 17.3MB/s
f70d85fa2a47646901aa3ce6a804fec30cb1c47d68cd63ac731924fbbb2bb4e4440be3ae98087930cda7d655dfe6eff3079bae85447c7cd619a71dea2bc177f9 \
-

When compiled for 64-bits, it runs much faster still (~40MB/s).

-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic