Skip to content

Commit 8a8fd7b

Browse files
committed
Add yield() while crypto computing.
1 parent 592b427 commit 8a8fd7b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wolfcrypt/src/integer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3531,6 +3531,11 @@ int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode)
35313531
bitbuf = 0;
35323532

35333533
for (;;) {
3534+
/* For ESP8266,
3535+
* call `yield()` to run WiFi task,
3536+
* to prevent WiFi disconnection while heavy crypto computing.
3537+
*/
3538+
yield();
35343539
/* grab next digit as required */
35353540
if (--bitcnt == 0) {
35363541
/* if digidx == -1 we are out of digits */

0 commit comments

Comments
 (0)