Skip to content

Commit

Permalink
Add yield() while crypto computing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixiaoxiao committed Mar 30, 2021
1 parent 592b427 commit 8a8fd7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wolfcrypt/src/integer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3531,6 +3531,11 @@ int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode)
bitbuf = 0;

for (;;) {
/* For ESP8266,
* call `yield()` to run WiFi task,
* to prevent WiFi disconnection while heavy crypto computing.
*/
yield();
/* grab next digit as required */
if (--bitcnt == 0) {
/* if digidx == -1 we are out of digits */
Expand Down

0 comments on commit 8a8fd7b

Please sign in to comment.