Closed motniemtin closed 1 year ago
Unfortunately, Mega2650 does not have enough RAM to process the Base64 conversion. That's why there is a simple
example specially designed for low-memory conditions.
It is not small ram problem in mega2560, i tested your code with base64_iv and i found problem with your AESLib.cpp char msgOut = (char)malloc(msgLen); int b64len = base64_decode(msgOut, msg, msgLen);
If i add free(msgOut);
problem solved
I see,
the malloc was a 3rd party contribution, it's bad idea to use malloc in emedded code.
Thanks for review, I'll release the decrypt64 fix in next version.
Matej
On 17. 2. 2023, at 8:49, Lam Nguyen @.***> wrote:
It is not small ram problem in mega2560, i tested your code with base64_iv and i found problem with your AESLib.cpp char msgOut = (char)malloc(msgLen); int b64len = base64_decode(msgOut, msg, msgLen);
If i add free(msgOut); problem solved
— Reply to this email directly, view it on GitHub https://github.com/suculent/thinx-aes-lib/issues/70#issuecomment-1434255594, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABWFR334QMFV4SZPKSXEATWX4UQ7ANCNFSM6AAAAAAU5TJ354. You are receiving this because you modified the open/close state.
I've tested your suggestion measuring memory consumption on my ATmega2650 and it seems to work. Releasing as 2.3.5. Thanks again.
I really appreciate your contribution and I thank you very much for this, I'm glad to have there
I upload this code to my mega2560, and after a loop, RAM in mega decrease quickly, after that, no free ram and fail decrypt in some loop