Proper support for OpenBSD-i386 shared build, including assember modules!
[openssl.git] / crypto / bn / bn_mul.c
index 4c413b3a5283defb4b850f8df17c4c0a2cfe491f..aec1eafc65fbb25a8fbeda30f8f6025129a3c716 100644 (file)
@@ -706,7 +706,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 
                /* The overflow will stop before we over write
                 * words we should not overwrite */
-               if (ln < c1)
+               if (ln < (BN_ULONG)c1)
                        {
                        do      {
                                p++;
@@ -964,7 +964,7 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 
        if ((al == 0) || (bl == 0))
                {
-               if (!BN_zero(r)) goto err;
+               BN_zero(r);
                return(1);
                }
        top=al+bl;
@@ -1090,10 +1090,11 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 #if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
 end:
 #endif
-       bn_fix_top(rr);
+       bn_correct_top(rr);
        if (r != rr) BN_copy(r,rr);
        ret=1;
 err:
+       bn_check_top(r);
        BN_CTX_end(ctx);
        return(ret);
        }