[botan-devel] ARM/iOS SHA performance [Was: CRC32 intermediate state]

Jack Lloyd lloyd at randombit.net
Sun Jul 29 15:37:25 EDT 2012


According to
http://theiphonewiki.com/wiki/index.php?title=S5L8720_%28Hardware_-_SHA1%29
there is at least SHA-1 hardware in some(?) iPhones, which presumably
is being used by the libraries if it is available. Did you see a
similar speed up for SHA-2?

-Jack

On Sun, Jul 29, 2012 at 08:30:56PM +0200, Richard Huveneers wrote:
> The 10x is the correct order of magnitude, the key derivation for some disk
> images reduced from around 90 to 8 seconds (measured by hand) on my iPhone
> 3GS. It could well have hardware support for this, although it's a rather
> old device..
> 
> Richard.
> 
> 2012/7/29 Jack Lloyd <lloyd at randombit.net>
> 
> >
> > Interesting, the iOS library hashes are really _10x_ the performance
> > of the C++ code in botan? I'm definitely intrigued by that, as, at
> > least for the ARM I have (an ARM926EJ), OpenSSL's asm SHA-1 and
> > SHA-256 are slower than Botan's C++ (12% and 40%, resp), so I figured
> > I was doing OK even lacking asm!
> >
> > Is it possible the iPhone has physical SHA hardware? I could believe
> > careful asm (and NEON support, which I know the Cortex has but which
> > no ARM I have access to does) might provide even 2-3x speedup but 10x
> > is pretty crazy and I'm really wondering what I'm missing. If it
> > really is giving that speedup, a CommonCrypto engine (or some ARM asm
> > at least, if this is easy to replicate) would make a lot of sense.
> >
> > -Jack
> >
> > On Sun, Jul 29, 2012 at 08:08:24PM +0200, Richard Huveneers wrote:
> > > Ok, here goes..
> > >
> > > The object names made sense when I was doing performance tests, should
> > > probably be renamed to reflect the iOS/Mac environment.
> > >
> > > Regards, Richard.
> > >
> > > 2012/7/29 Timothy Prepscius <timprepscius at gmail.com>
> > >
> > > > I'm interested.
> > > >
> > > > On Jul 29, 2012, at 11:57 AM, Richard Huveneers wrote:
> > > >
> > > > ve made a few objects wrapping iOS's SHA functions into subclasses
> > > > of Botan::HashFunction. Since Botan does not have ARM assembly
> > versions,
> > > > these are much (10x) faster than the default SHA implementation
> > provided by
> > > > Botan. If anybody is interested, I'll gladly provide a zip file
> > containing
> > > > the sources.
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > botan-devel mailing list
> > > > botan-devel at randombit.net
> > > > http://lists.randombit.net/mailman/listinfo/botan-devel
> > > >
> > > >
> >
> >
> > > _______________________________________________
> > > botan-devel mailing list
> > > botan-devel at randombit.net
> > > http://lists.randombit.net/mailman/listinfo/botan-devel
> >
> > _______________________________________________
> > botan-devel mailing list
> > botan-devel at randombit.net
> > http://lists.randombit.net/mailman/listinfo/botan-devel
> >

> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel




More information about the botan-devel mailing list