diff options
Diffstat (limited to 'extra/yassl/taocrypt/include/rsa.hpp')
-rw-r--r-- | extra/yassl/taocrypt/include/rsa.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/extra/yassl/taocrypt/include/rsa.hpp b/extra/yassl/taocrypt/include/rsa.hpp index c895ab6fd34..11a4ccfd039 100644 --- a/extra/yassl/taocrypt/include/rsa.hpp +++ b/extra/yassl/taocrypt/include/rsa.hpp @@ -178,7 +178,8 @@ void RSA_Encryptor<Pad>::Encrypt(const byte* plain, word32 sz, byte* cipher, RandomNumberGenerator& rng) { PK_Lengths lengths(key_.GetModulus()); - assert(sz <= lengths.FixedMaxPlaintextLength()); + if (sz > lengths.FixedMaxPlaintextLength()) + return; ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); padding_.Pad(plain, sz, paddedBlock.get_buffer(), @@ -195,7 +196,6 @@ word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher, word32 sz, byte* plain, RandomNumberGenerator& rng) { PK_Lengths lengths(key_.GetModulus()); - assert(sz == lengths.FixedCiphertextLength()); if (sz != lengths.FixedCiphertextLength()) return 0; |