The branch master has been updated
via 32c748140ff94016011efc206a3709e4187ce40b (commit)
via 9f6795e7d2d1e35668ad70ba0afc480062be4e2e (commit)
from 1786086b05714c284b337d5211b299e09b9cfad9 (commit)
- Log -----------------------------------------------------------------
commit 32c748140ff94016011efc206a3709e4187ce40b
Author: Kurt Roeckx <[email protected]>
Date: Mon Oct 19 22:26:59 2015 +0200
BN_sub: document that r might be the same as a or b
Reviewed-by: Rich Salz <[email protected]>
RT #4100, MR #1264
commit 9f6795e7d2d1e35668ad70ba0afc480062be4e2e
Author: Pascal Cuoq <[email protected]>
Date: Mon Oct 19 22:24:23 2015 +0200
BN_usub: Don't copy when r and a the same
Signed-off-by: Kurt Roeckx <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
RT #4100, MR #1264
-----------------------------------------------------------------------
Summary of changes:
crypto/bn/bn_add.c | 2 +-
doc/crypto/BN_add.pod | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c
index 0bfc3cc..bbb0584 100644
--- a/crypto/bn/bn_add.c
+++ b/crypto/bn/bn_add.c
@@ -222,7 +222,7 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
break;
}
}
- if (dif)
+ if (dif && ap != rp)
memcpy(rp, ap, sizeof(*rp) * dif);
r->top = max;
diff --git a/doc/crypto/BN_add.pod b/doc/crypto/BN_add.pod
index 942048c..3ad2274 100644
--- a/doc/crypto/BN_add.pod
+++ b/doc/crypto/BN_add.pod
@@ -49,6 +49,7 @@ BN_add() adds I<a> and I<b> and places the result in I<r>
(C<r=a+b>).
I<r> may be the same B<BIGNUM> as I<a> or I<b>.
BN_sub() subtracts I<b> from I<a> and places the result in I<r> (C<r=a-b>).
+I<r> may be the same B<BIGNUM> as I<a> or I<b>.
BN_mul() multiplies I<a> and I<b> and places the result in I<r> (C<r=a*b>).
I<r> may be the same B<BIGNUM> as I<a> or I<b>.
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits