On 11 December 2012 04:00, Stephen Henson via RT <r...@openssl.org> wrote:
> > I also notice that even the original HMAC version initialises two HMAC > contexts with the same key. That could be improved by initialising one > and copying the context across. > > This kind of optimization can be also applied P_hash implementation via to EVP_DigestSign*. HMAC contexts being re-initialized in inner loop every time it executed. It is possible to improve it here by initializing only once in the beginning of function, save to some temporary variables, and restore restore from them when needed. It would solve original issue with re-initialilization excessive overhead. BUT: 1. It gives only miserable performance benefits in "normal" case (i.e. software-only) ( < 1%). Hashing of few more bytes is almost nothing in comparison to BN-manipulations. 2. In case of external hardware usage it may lead to the same result: in my case cost of MAC copying call is the same as cost of MAC calculation call. And only way to improve performance is to reduce total amount of "remote" calls. ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager majord...@openssl.org