Closed tomharadalni closed 5 months ago
Hi,
if you need only ecdsa, you can try to reduce memory usage: #define FP_MAX_SIZE try to reduce it from ((2048 * 2) + (8 * DIGIT_BIT))
to ((512 * 2) + (8 * DIGIT_BIT))
Best regards, D.
That does seem to prevent the errors, although I don't understand why. Some kind of potential buffer overflow caused by the larger FP_MAX_SIZE? In any case, thanks for the help and for the useful library.
Hello,
On the Pico W, I've observed ecdsa.sign() consistently producing an incorrect signature or hanging the system under specific conditions. The issue only seems to happen when ecdsa.sign() is invoked in an asyncio task, and only when roughly 85k-100k of the available 180k heap space is allocated. The issue exists with the latest ucrypto and micropython.
Below is a demo program that triggers the behavior. Tweaking the heap usage changes whether a bad signature is produced or the program hangs.
The output:
Thanks!