Convert RSA blinding to new multi-threading API
[openssl.git] / crypto / bn / bn_add.c
index e09451d88bba18c7d793a791dfc100e9813b8187..3e7d86b2dd57acdaaf3af2510af3f26de66cf637 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/bn/bn_add.c */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -56,7 +55,7 @@
  * [including the GNU Public Licence.]
  */
 
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
 #include "bn_lcl.h"
 
 /* r can == a or b */
@@ -222,7 +221,8 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
                 break;
         }
     }
-    memcpy(rp, ap, sizeof(*rp) * (max - i));
+    if (dif && ap != rp)
+        memcpy(rp, ap, sizeof(*rp) * dif);
 
     r->top = max;
     r->neg = 0;