Skip to content
Commit ce84456d authored by Richard Levitte's avatar Richard Levitte
Browse files

Math::BigInt does floored divs, BN_div does truncated div, compensate



According to documentation, perl's Math::BigInt does floored division,
i.e. the bdiv function does 1 / -4 = -1.  OpenSSL's BN_div, as well as
bc, do truncated division, i.e. 1 / -4 = 0.

We need to compensate for that difference in test/recipes/bc.pl to
make sure to verify the bntest results under its own conditions, by
dividing the absolute values of the given numbers and fixup the
result's negativity afterwards.

Closes RT#4485

Reviewed-by: default avatarViktor Dukhovni <viktor@openssl.org>
parent c828cd7c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment