From 80f2f6e7aff423bbb3859c1c0db564c06b044ae1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 11 Jan 2019 07:20:27 +0000 Subject: [PATCH] Fix mp_mul_add_simple on Visual Studio. I had forgotten that my VS implementation of BignumADC expected the carry parameter to be a literal carry _flag_, i.e. a boolean, rather than a full word of extra data to be added to the sum of the main input BignumInts a,b. So in one place where I didn't need a separate carry I had passed one of the data words in the carry slot, which worked fine on gcc and clang, but VS normalised that argument to 1. That looks like the only VS bug, though: now I get a clean run of cryptsuite.py even if it's talking to a VS-built testcrypt.exe. --- mpint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpint.c b/mpint.c index e7bec352..35d0189c 100644 --- a/mpint.c +++ b/mpint.c @@ -878,7 +878,7 @@ static void mp_mul_add_simple(mp_int *r, mp_int *a, mp_int *b) } for (; rq < rend; rq++) - BignumADC(*rq, carry, 0, *rq, carry); + BignumADC(*rq, carry, carry, *rq, 0); } }