Initial aarch64 bits.
[openssl.git] / crypto / bn / bn_sqr.c
index 8831daa390a7be5cdbb0bc7815cfb6ebe0efb6b1..270d0cd348b90056f14ce429676b700cd577118b 100644 (file)
@@ -86,7 +86,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
        if (!rr || !tmp) goto err;
 
        max = 2 * al; /* Non-zero (from above) */
-       if (bn_wexpand(rr,max+1) == NULL) goto err;
+       if (bn_wexpand(rr,max) == NULL) goto err;
 
        if (al == 4)
                {
@@ -148,8 +148,8 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
        if (rr != r) BN_copy(r,rr);
        ret = 1;
  err:
-       if(rr) bn_check_top(rr);
-       if(tmp) bn_check_top(tmp);
+       bn_check_top(rr);
+       bn_check_top(tmp);
        BN_CTX_end(ctx);
        return(ret);
        }