Backport #1949 into mbedtls-2.16
Signed-off-by: Jeffrey Martin <Jeffrey_Martin@rapid7.com>
diff --git a/ChangeLog b/ChangeLog
index b39b953..a82d1f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,10 @@
previously lead to a stack overflow on constrained targets.
* Add `MBEDTLS_SELF_TEST` for the mbedtls_self_test functions
in the header files, which missed the precompilation check. #971
+ * Extend register cleanup needed on MIPS assembly optimizations. Adds hi, lo
+ registers hints to the compiler for usage with the embedded MIPS assembly.
+ Reported in #1722, fix suggested by @aurel32 and submitted
+ by Jeffrey Martin, #1949.
= mbed TLS 2.16.0 branch released 2018-12-21
diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h
index 2f7b72f..26cfa77 100644
--- a/include/mbedtls/bn_mul.h
+++ b/include/mbedtls/bn_mul.h
@@ -750,7 +750,7 @@
"sw $10, %2 \n\t" \
: "=m" (c), "=m" (d), "=m" (s) \
: "m" (s), "m" (d), "m" (c), "m" (b) \
- : "$9", "$10", "$11", "$12", "$13", "$14", "$15" \
+ : "$9", "$10", "$11", "$12", "$13", "$14", "$15", "lo", "hi" \
);
#endif /* MIPS */