Merge pull request #939 from dgarske/fixes_async

Fixes for build with async
This commit is contained in:
toddouska 2017-05-26 17:04:57 -07:00 committed by GitHub
commit 320ad56139
4 changed files with 22 additions and 2 deletions

View File

@ -3411,9 +3411,15 @@ void bench_eccEncrypt(void)
}
ret = wc_ecc_make_key(&rng, keySize, &userA);
#ifdef WOLFSSL_ASYNC_CRYPT
ret = wc_AsyncWait(ret, &userA.asyncDev, WC_ASYNC_FLAG_NONE);
#endif
if (ret != 0)
goto exit;
ret = wc_ecc_make_key(&rng, keySize, &userB);
#ifdef WOLFSSL_ASYNC_CRYPT
ret = wc_AsyncWait(ret, &userB.asyncDev, WC_ASYNC_FLAG_NONE);
#endif
if (ret != 0)
goto exit;

View File

@ -7989,6 +7989,9 @@ static int dh_generate_test(WC_RNG *rng)
/* Use API. */
ret = wc_DhGenerateKeyPair(&smallKey, rng, priv, &privSz, pub, &pubSz);
#if defined(WOLFSSL_ASYNC_CRYPT)
ret = wc_AsyncWait(ret, &smallKey.asyncDev, WC_ASYNC_FLAG_NONE);
#endif
if (ret != 0) {
ret = -5707;
}
@ -9193,6 +9196,8 @@ int scrypt_test(void)
if (XMEMCMP(derived, verify2, sizeof(verify2)) != 0)
return -6003;
/* Don't run these test on embedded, since they use large mallocs */
#ifndef BENCH_EMBEDDED
ret = wc_scrypt(derived, (byte*)"pleaseletmein", 13,
(byte*)"SodiumChloride", 14, 14, 8, 1, sizeof(verify3));
if (ret != 0)
@ -9208,6 +9213,7 @@ int scrypt_test(void)
if (XMEMCMP(derived, verify4, sizeof(verify4)) != 0)
return -6007;
#endif
#endif /* !BENCH_EMBEDDED */
return 0;
}

View File

@ -3003,7 +3003,7 @@ typedef struct HS_Hashes {
#ifdef WOLFSSL_ASYNC_CRYPT
#define MAX_ASYNC_ARGS 16
#define MAX_ASYNC_ARGS 18
typedef void (*FreeArgsCb)(struct WOLFSSL* ssl, void* pArgs);
struct WOLFSSL_ASYNC {

View File

@ -30,6 +30,10 @@
#include <wolfssl/wolfcrypt/fe_operations.h>
#include <wolfssl/wolfcrypt/random.h>
#ifdef WOLFSSL_ASYNC_CRYPT
#include <wolfssl/wolfcrypt/async.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -50,7 +54,7 @@ typedef struct {
#ifdef FREESCALE_LTC_ECC
byte pointY[CURVE25519_KEYSIZE];
#endif
}ECPoint;
} ECPoint;
/* A CURVE25519 Key */
typedef struct curve25519_key {
@ -61,6 +65,10 @@ typedef struct curve25519_key {
curves (idx >= 0) or user supplied */
ECPoint p; /* public key */
ECPoint k; /* private key */
#ifdef WOLFSSL_ASYNC_CRYPT
WC_ASYNC_DEV asyncDev;
#endif
} curve25519_key;
enum {