SHA::Transform fix checked in

3 views
Skip to first unread message

Jeffrey Walton

unread,
Aug 13, 2017, 4:42:49 PM8/13/17
to Crypto++ Users
Hi Everyone,

The fix for SHA::Transform was checked in at https://github.com/weidai11/cryptopp/commit/2aff92ddb6e679fc. Also see https://github.com/weidai11/cryptopp/issues/455.

SHA basically got overhauled. Formerly IterHashBase dispatched a single block to digested when Update() was called. IterHashBase also performed endian conversions. Eventually the static SHA::Transform was called to hash a single block at a time.

We added freestanding HashMultipleBlocks that handles multiple blocks. Effectively, Multiple blocks is our core now, and not a single block. We have two or three variants of it - a CXX, a SHA-NI, and an ARM version.

IterHashBase no longer handles dispatching. We added a class override for HashMultipleBlocks that calls into the free standing function. The freestanding HashMultipleBlocks also has a ByteOrder parameter to tell us how the incoming data is presented. Now we can select a mask on the fly as needed to arrange the data as required.

SHA-1 is pushing data at 2.3 cpb on ARM servers, 4.0 cpb on ARM gadgets, and 1.8 cpb on desktops. The numbers look good. I think we've pulled all the performance out of them we can.

Jeff

Jeffrey Walton

unread,
Aug 14, 2017, 12:20:52 AM8/14/17
to Crypto++ Users

The fix for SHA::Transform was checked in at https://github.com/weidai11/cryptopp/commit/2aff92ddb6e679fc. Also see https://github.com/weidai11/cryptopp/issues/455.

SHA basically got overhauled.

One follow up commit at https://github.com/weidai11/cryptopp/commit/2ee8e3b26d48. It moved free standing functions into anonymous namespaces. It also made better use of class constants. Finally, it updated the comments at the head of the file.

Jeff
Reply all
Reply to author
Forward
0 new messages