Hi,
пт, 7 июн. 2019 г. в 00:27, Niels Möller nisse@lysator.liu.se:
Dmitry Eremin-Solenikov dbaryshkov@gmail.com writes:
I'm still playing around HMAC/digest refactoring, but I'm not happy with the way code looks in my tree.
Below patch is a faitly simple way to do it. It adds internal functions with a state_size argument, uses that when saving and restoring state, and switches hmac_md5 to a new smaller context struct.
I have pushed my current state to https://gitlab.com/GostCrypt/nettle/tree/hmac-2
MD5 and HMAC-MD5 were converted to demonstrate my proposal.
The key change is the split of md5_ctx into md5_state and block_ctx and later reusal of common block_ctx in all operations. Unfortunately this changes nettle_hash interface.
I have kept old HMAC interface in place. It can be deprecated and/or removed later.