Skip to content

Commit 4e7714a

Browse files
committed
remove rsa gaurd its jsut normal byte conversion
1 parent 0e461a4 commit 4e7714a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/tpm2_wrap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3528,17 +3528,17 @@ int wolfTPM2_RsaKey_TpmToPemPub(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* tpmKey,
35283528
#endif /* !NO_RSA */
35293529
#endif /* !NO_ASN */
35303530

3531-
#ifndef NO_RSA
3531+
/* Convert big-endian byte array to native word32 */
35323532
word32 wolfTPM2_RsaKey_Exponent(const byte* e, word32 eSz)
35333533
{
35343534
word32 exponent = 0, i;
3535-
/* Convert big-endian bytes to native word32 */
35363535
for (i = 0; i < eSz && i < sizeof(word32); i++) {
35373536
exponent = (exponent << 8) | e[i];
35383537
}
35393538
return exponent;
35403539
}
35413540

3541+
#ifndef NO_RSA
35423542
int wolfTPM2_RsaKey_TpmToWolf(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* tpmKey,
35433543
RsaKey* wolfKey)
35443544
{

wolftpm/tpm2_wrap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,6 @@ WOLFTPM_API int wolfTPM2_ImportPublicKeyBuffer(WOLFTPM2_DEV* dev, int keyType,
13201320
WOLFTPM_API int wolfTPM2_ExportPublicKeyBuffer(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* tpmKey,
13211321
int encodingType, byte* out, word32* outSz);
13221322

1323-
#ifndef NO_RSA
1324-
13251323
/*!
13261324
\ingroup wolfTPM2_Wrappers
13271325
\brief Converts a big-endian byte array to a native word32 value.
@@ -1334,6 +1332,8 @@ WOLFTPM_API int wolfTPM2_ExportPublicKeyBuffer(WOLFTPM2_DEV* dev, WOLFTPM2_KEY*
13341332
*/
13351333
WOLFTPM_API word32 wolfTPM2_RsaKey_Exponent(const byte* e, word32 eSz);
13361334

1335+
#ifndef NO_RSA
1336+
13371337
/*!
13381338
\ingroup wolfTPM2_Wrappers
13391339
\brief Helper function to import Der rsa key directly

0 commit comments

Comments
 (0)