From f97f9a6158419603c273eae6958f2fa51a83f0e6 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 14 Sep 2017 17:07:19 -0600 Subject: [PATCH] init hardware acc. use of public RSA key with public key decode functions --- wolfcrypt/src/asn.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index d4b108461..1c00c8308 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -2801,6 +2801,12 @@ int wc_RsaPublicKeyDecode(const byte* input, word32* inOutIdx, RsaKey* key, return ASN_RSA_KEY_E; } +#ifdef WOLFSSL_XILINX_CRYPT + if (wc_InitRsaHw(key) != 0) { + return BAD_STATE_E; + } +#endif + return 0; } @@ -2832,6 +2838,12 @@ int wc_RsaPublicKeyDecodeRaw(const byte* n, word32 nSz, const byte* e, return ASN_GETINT_E; } +#ifdef WOLFSSL_XILINX_CRYPT + if (wc_InitRsaHw(key) != 0) { + return BAD_STATE_E; + } +#endif + return 0; } #endif /* HAVE_USER_RSA */