diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index bdc99cf2a..c211deb41 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -5296,13 +5296,13 @@ static int fp_read_radix_16(fp_int *a, const char *str) else return FP_VAL; + k += j == DIGIT_BIT; + j &= DIGIT_BIT - 1; if (k >= FP_SIZE) return FP_VAL; a->dp[k] |= ((fp_digit)ch) << j; j += 4; - k += j == DIGIT_BIT; - j &= DIGIT_BIT - 1; } a->used = k + 1;