From 8a11b78960322f39d6089f85c6bb3eaddcb8958d Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 31 Jul 2017 14:01:11 -0700 Subject: [PATCH] Fix for normal math `mp_read_unsigned_bin` where `mp_zero` was also resetting the raw source. This caused failures with QAT when using normal math. --- wolfcrypt/src/integer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index c91d8331a..906a6bc02 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -212,7 +212,9 @@ void mp_forcezero(mp_int * a) if (a->dp != NULL) { /* force zero the used digits */ ForceZero(a->dp, a->used * sizeof(mp_digit)); - +#ifdef HAVE_WOLF_BIGINT + wc_bigint_zero(&a->raw); +#endif /* free ram */ mp_free(a); @@ -484,9 +486,6 @@ void mp_zero (mp_int * a) a->sign = MP_ZPOS; a->used = 0; -#ifdef HAVE_WOLF_BIGINT - wc_bigint_zero(&a->raw); -#endif tmp = a->dp; for (n = 0; n < a->alloc; n++) {