Add fast path for _gcry_fips_is_operational
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 19 Jun 2018 15:34:33 +0000 (18:34 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 19 Jun 2018 16:29:25 +0000 (19:29 +0300)
commitb6e6ace324440f564df664e27f8276ef01f76795
tree3281fd2dd4fdaf2473d91bfb03b609c4d4c8889d
parent233e2049a2cc1c1110f541b6a7ef145a737e2c65
Add fast path for _gcry_fips_is_operational

* src/fips.c (no_fips_mode_required): Rename to...
(_gcry_no_fips_mode_required): ...this and make externally available.
* src/g10lib.h (_gcry_no_fips_mode_required): New extern.
(fips_mode): Inline _gcry_fips_mode to macro, use
_gcry_no_fips_mode_required directly.
(fips_is_operational): Inline fips_mode check from
_gcry_fips_in_operational.
--

Add fast path to reduce call overhead in src/visibility.c where
fips_is_operational is called before cipher/md/etc operations.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
src/fips.c
src/g10lib.h