update byte size conversion

This commit is contained in:
Jacob Barthelmeh
2017-03-10 09:39:18 -07:00
parent e8d97c9b1e
commit dee3159f0f

View File

@ -1956,7 +1956,7 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* e, word32* eSz, byte* n,
return USER_CRYPTO_ERROR;
/* sz is in bits change to bytes */
sz = (sz / bytSz) + (sz % bytSz);
sz = (sz / bytSz) + ((sz % bytSz)? 1 : 0);
if (*eSz < (word32)sz)
return USER_CRYPTO_ERROR;
@ -1973,7 +1973,7 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* e, word32* eSz, byte* n,
return USER_CRYPTO_ERROR;
/* sz is in bits change to bytes */
sz = (sz / bytSz) + (sz % bytSz);
sz = (sz / bytSz) + ((sz % bytSz)? 1: 0);
if (*nSz < (word32)sz)
return USER_CRYPTO_ERROR;