Re: high-performance HMAC module

Andrew Kuchling <[email protected]>
Newsgroups gmane.comp.python.cryptography
Message-ID <[email protected]>
On Wed, May 29, 2002 at 02:54:43PM -0700, Bram Cohen wrote:
>By the way, the sha1 included in Python is very slow - around 2 megs/sec.

I can think of a few possible reasons for this.  First is that the
main transformation is in the sha_transform() function in the C code,
so there's a C function call for every block of input text.  This
might be difficult to fix, though, as sha_transform() is called from
several places and it's pretty long.

One silly thing that should be easily fixable is that sha_transform()
also does byte-swapping on every call, and it really shouldn't.
That's probably the low-hanging fruit here.

The R32() macro and the f()-functions could also be translated to
assembly code, but I haven't looked at the output of 'gcc -S' to see
what the generated code looks like.

--amk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.