Commit 1b068044 authored by Geoff Thorpe's avatar Geoff Thorpe
Browse files

When adding positive elements, we can use BN_uadd() instead of BN_add().

Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
parent dc90f64d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_
 * and less than  m */
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m)
	{
	if (!BN_add(r, a, b)) return 0;
	if (!BN_uadd(r, a, b)) return 0;
	if (BN_ucmp(r, m) >= 0)
		return BN_usub(r, r, m);
	return 1;