1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Add hooks to feed watchdog during lengthy bigint operations

This commit is contained in:
Ivan Grokhotkov 2016-05-10 23:00:33 +08:00
parent 69c757f2a3
commit cd6c04a809
3 changed files with 7 additions and 0 deletions

View File

@ -217,6 +217,9 @@ int ax_get_file(const char *filename, uint8_t **buf) {
return 0;
}
void ax_wdt_feed() {
}
/*
* Utility functions
*/

View File

@ -1218,6 +1218,7 @@ bigint *bi_mont(BI_CTX *ctx, bigint *bixy)
check(bixy);
ax_wdt_feed();
if (ctx->use_classical) /* just use classical instead */
{
return bi_mod(ctx, bixy);
@ -1274,6 +1275,7 @@ bigint *bi_barrett(BI_CTX *ctx, bigint *bi)
check(bi);
check(bim);
ax_wdt_feed();
/* use Classical method instead - Barrett cannot help here */
if (bi->size > k*2)
{

View File

@ -81,6 +81,8 @@ extern "C" {
#define hmac_sha1 ax_hmac_sha1
#define hmac_md5 ax_hmac_md5
void ax_wdt_feed();
#elif defined(WIN32)
/* Windows CE stuff */