From f7fac88e8b4aea7a77e203d78d11fa90300a873d Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 24 Nov 2015 17:28:43 -0700 Subject: [PATCH] Don't error out when calling ippInit to find optimized IPP library, just fall back to use standard --- wolfcrypt/src/wc_port.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index b81702bba..ac54c3494 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -45,6 +45,7 @@ */ int wolfCrypt_Init() { + int ret = 0; #if WOLFSSL_CRYPT_HW_MUTEX /* If crypto hardware mutex protection is enabled, then initialize it */ wolfSSL_CryptHwMutexInit(); @@ -52,14 +53,18 @@ int wolfCrypt_Init() /* if defined have fast RSA then initialize Intel IPP */ #ifdef HAVE_FAST_RSA - WOLFSSL_MSG("Setting up IPP Library"); - if (ippInit() != ippStsNoErr) { - WOLFSSL_MSG("Error setting up optimized Intel library to use!"); - return -1; + WOLFSSL_MSG("Attempting to use optimized IPP Library"); + if ((ret = ippInit()) != ippStsNoErr) { + /* possible to get a CPU feature support status on optimized IPP + library but still use default library and see competitve speeds */ + WOLFSSL_MSG("Warning when trying to set up optimization"); + WOLFSSL_MSG(ippGetStatusString(ret)); + WOLFSSL_MSG("Using default fast IPP library"); + ret = 0; } #endif - return 0; + return ret; }