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

Timothy Prepscius timprepscius at gmail.com
Sun Jul 29 15:27:42 EDT 2012


Thanks for this code, I will use it prob.


This may be naive on my part, (i haven't traced iPhone assembly, not even sure if it lets you on real device):
I wondered to myself- if you step through with a debugger, do you see it is doing a system call, or does it actually loop on given data?

-tim

On Jul 29, 2012, at 2:30 PM, 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20120729/9183ef66/attachment.html>


More information about the botan-devel mailing list