Re: [openssl-dev] [openssl.org #4485] big number tests and Math::BigInt changes

2016-03-27 Thread noloa...@gmail.com via RT
On Fri, Mar 25, 2016 at 7:05 PM, Richard Levitte via RT  
wrote:
> I've attached a tentative patch for test/recipes/bc.pl. Would you be willing 
> to
> try it out?

OpenSSL master (c828cd7) experienced what appeared to be the same
issue under Windows 7 Pro x64 with Strawberry PERL 5.22. The machine
has Visual Studio 2008, Visual Studio 2010 and Visual Studio 2012, but
I don't think it affects the issue.

The patch cleared the issue for VC-WIN32 and VC-WIN64A.

Jeff


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4485
Please log in as guest with password guest if prompted

-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


Re: [openssl-dev] [openssl.org #4485] big number tests and Math::BigInt changes

2016-03-27 Thread Jeffrey Walton
On Fri, Mar 25, 2016 at 7:05 PM, Richard Levitte via RT  
wrote:
> I've attached a tentative patch for test/recipes/bc.pl. Would you be willing 
> to
> try it out?

OpenSSL master (c828cd7) experienced what appeared to be the same
issue under Windows 7 Pro x64 with Strawberry PERL 5.22. The machine
has Visual Studio 2008, Visual Studio 2010 and Visual Studio 2012, but
I don't think it affects the issue.

The patch cleared the issue for VC-WIN32 and VC-WIN64A.

Jeff
-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


Re: [openssl-dev] [openssl.org #4485] big number tests and Math::BigInt changes

2016-03-25 Thread Craig A. Berry via RT
Wow, that was fast.  The patch looks good here: now all tests pass on systems 
with and without the Math::BigInt changes.  Thanks!

> On Mar 25, 2016, at 6:05 PM, Richard Levitte via RT  wrote:
> 
> I've attached a tentative patch for test/recipes/bc.pl. Would you be willing 
> to
> try it out?
> 

> -- 
> Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4485
> Please log in as guest with password guest if prompted
> 
> diff --git a/test/recipes/bc.pl b/test/recipes/bc.pl
> index 29a4a8a..f7d4dc6 100644
> --- a/test/recipes/bc.pl
> +++ b/test/recipes/bc.pl
> @@ -46,7 +46,16 @@ sub __multiplier {
>   if ($operator eq "*") {
>   $operand1->bmul($operand2);
>   } elsif ($operator eq "/") {
> + # Math::BigInt->bdiv() is documented to do floored division,
> + # i.e. 1 / -4 = -1, while bc and OpenSSL BN_div do truncated
> + # division, i.e. 1 / -4 = 0.  We need to make the operation
> + # work like OpenSSL's BN_div to be able to verify.
> + my $neg = ($operand1->is_neg()
> +? !$operand2->is_neg() : $operand2->is_neg());
> + $operand1->babs();
> + $operand2->babs();
>   $operand1->bdiv($operand2);
> + if ($neg) { $operand1->bneg(); }
>   } elsif ($operator eq "%") {
>   # Here's a bit of a quirk...
>   # With OpenSSL's BN, as well as bc, the result of -10 % 3 is -1


Craig A. Berry
mailto:craigbe...@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
 Brad Leithauser


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4485
Please log in as guest with password guest if prompted

-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev