Re: x86 SHA1: Faster than OpenSSL
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Aug 6, 2009, 02:10 UTC
- Message-ID
- <alpine.LFD.2.01.0908051909080.3390@localhost.localdomain>
- In-Reply-To
- <7vocqtu286.fsf@alter.siamese.dyndns.org>
On Wed, 5 Aug 2009, Junio C Hamano wrote:
> > Like this?
No, combine it with the other shifts:
Yes:
> - ctx->size += (unsigned long long) len << 3; > + ctx->size += (unsigned long long) len;
No:
> + ctx->size <<= 3; /* bytes to bits */ > padlen[0] = htonl(ctx->size >> 32); > padlen[1] = htonl(ctx->size);
Do
padlen[0] = htonl(ctx->size >> 29); padlen[1] = htonl(ctx->size << 3);
instead. Or whatever.
Linus