Skip to content

Commit cd6c04a

Browse files
committed
Add hooks to feed watchdog during lengthy bigint operations
1 parent 69c757f commit cd6c04a

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

compat/lwipr_compat.c

+3
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ int ax_get_file(const char *filename, uint8_t **buf) {
217217
return 0;
218218
}
219219

220+
void ax_wdt_feed() {
221+
}
222+
220223
/*
221224
* Utility functions
222225
*/

crypto/bigint.c

+2
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,7 @@ bigint *bi_mont(BI_CTX *ctx, bigint *bixy)
12181218

12191219
check(bixy);
12201220

1221+
ax_wdt_feed();
12211222
if (ctx->use_classical) /* just use classical instead */
12221223
{
12231224
return bi_mod(ctx, bixy);
@@ -1274,6 +1275,7 @@ bigint *bi_barrett(BI_CTX *ctx, bigint *bi)
12741275
check(bi);
12751276
check(bim);
12761277

1278+
ax_wdt_feed();
12771279
/* use Classical method instead - Barrett cannot help here */
12781280
if (bi->size > k*2)
12791281
{

ssl/os_port.h

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ extern "C" {
8181
#define hmac_sha1 ax_hmac_sha1
8282
#define hmac_md5 ax_hmac_md5
8383

84+
void ax_wdt_feed();
85+
8486
#elif defined(WIN32)
8587

8688
/* Windows CE stuff */

0 commit comments

Comments
 (0)