Extracting another 0.6 cpb from SHA-1

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Extracting another 0.6 cpb from SHA-1

Jeffrey Walton-3
Hi Everyone,

SHA-1 has an additional opportunity for speedup by avoiding the ByteReverse at https://github.com/weidai11/cryptopp/blob/master/iterhash.cpp#L98. It saves about 0.6 cpb, and makes SHA-1 run around the theoretical maximum. SHA-1 was moving data at 1.7 to 1.8 cpb (down from about 2.5 cpb).

I thought it was going to be a quick cut-in, but I was mistaken. The change at https://github.com/weidai11/cryptopp/commit/bd7aa155a6c7 made SHA-1 run faster, but also broke Tiger and SEAL. So it had to be backed out.

The next attempt added a SHA1::HashMultipleBlocks override. It worked as expected, but it also broke SEAL. I'm not sure why it broke SEAL.

I'm going to need some more time to look at it.

Jeff

--
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to [hidden email].
More information about Crypto++ and this group is available at http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Extracting another 0.6 cpb from SHA-1

Jeffrey Walton-3

SHA-1 has an additional opportunity for speedup by avoiding the ByteReverse at <a href="https://github.com/weidai11/cryptopp/blob/master/iterhash.cpp#L98" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fweidai11%2Fcryptopp%2Fblob%2Fmaster%2Fiterhash.cpp%23L98\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUJTBggkFgMGAZfLOrVOS7YdWpEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fweidai11%2Fcryptopp%2Fblob%2Fmaster%2Fiterhash.cpp%23L98\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUJTBggkFgMGAZfLOrVOS7YdWpEA&#39;;return true;">https://github.com/weidai11/cryptopp/blob/master/iterhash.cpp#L98. It saves about 0.6 cpb, and makes SHA-1 run around the theoretical maximum. SHA-1 was moving data at 1.7 to 1.8 cpb (down from about 2.5 cpb).

I thought it was going to be a quick cut-in, but I was mistaken. The change at <a href="https://github.com/weidai11/cryptopp/commit/bd7aa155a6c7" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fweidai11%2Fcryptopp%2Fcommit%2Fbd7aa155a6c7\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfdV85lV-8FHUwwwU5gmcHWPlIJw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fweidai11%2Fcryptopp%2Fcommit%2Fbd7aa155a6c7\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfdV85lV-8FHUwwwU5gmcHWPlIJw&#39;;return true;">https://github.com/weidai11/cryptopp/commit/bd7aa155a6c7 made SHA-1 run faster, but also broke Tiger and SEAL. So it had to be backed out.

The next attempt added a SHA1::HashMultipleBlocks override. It worked as expected, but it also broke SEAL. I'm not sure why it broke SEAL.

The updated check-in happened at https://github.com/weidai11/cryptopp/commit/de1270656c275. It also fixed SEAL, which used SHA1::Transform.

On AMD server chips we are at about 1.7 cpb. On the low end Celeron I have, its around 2.0 cpb. I'm guessing Intel desktops will perform about as well as AMD.

Jeff

--
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to [hidden email].
More information about Crypto++ and this group is available at http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...