rweather / arduinolibs

Arduino Cryptography Library
444 stars 212 forks source link

Exception (3) with ESP8266 core >2.5.0 in mulA24 #38

Open gmag11 opened 5 years ago

gmag11 commented 5 years ago

With core version higher than 2.5.0 (latest is 2.5.2) I get a Exception (3) boot loop when calling Curve25519::dh1(uint8_t k[32], uint8_t f[32]).

I've traced the exact point and I've got to Curve25519::mulA24(limb_t *result, const limb_t *x).

I've noticed that code uses BIGNUMBER_LIMB_16BITfor ESP8266 platform.

If I change this line from #if defined(__AVR__) || defined(ESP8266) to #if defined(__AVR__)

so that it uses BIGNUMBER_LIMB_32BIT, the program runs fine.

I've tested it with v0.2.0 and latest master.

guilhermedalleprane commented 5 years ago

I have the same problem. I think it is solved here: https://github.com/esp8266/Arduino/pull/6270