eng_devcrypto: save ioctl if EVP_MD_..FLAG_ONESHOT
authorEneas U de Queiroz <cote2004-github@yahoo.com>
Mon, 5 Nov 2018 17:54:17 +0000 (15:54 -0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 10 Dec 2018 12:19:26 +0000 (13:19 +0100)
commitb2db94d1d0bb79a80e188aaf459698ae5cbabe7d
tree2f0e563d7942d240f81bc0a79df1375e4db7162c
parent16e252a01b754a13e83d5e5e87afbe389997926b
eng_devcrypto: save ioctl if EVP_MD_..FLAG_ONESHOT

Since each ioctl causes a context switch, slowing things down, if
EVP_MD_CTX_FLAG_ONESHOT is set, then:
 - call the ioctl in digest_update, saving the result; and
 - just copy the result in digest_final, instead of using another ioctl.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7585)
crypto/engine/eng_devcrypto.c