[Mono-bugs] [Bug 81857][Nor] New - BigInteger.IsProbablePrime() fails on some primes
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Jun 11 14:10:08 EDT 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by atsushi at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=81857
--- shadow/81857 2007-06-11 14:10:08.000000000 -0400
+++ shadow/81857.tmp.24551 2007-06-11 14:10:08.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 81857
+Product: Mono: Class Libraries
+Version: 1.0
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Mono.Security
+AssignedTo: sebastien at ximian.com
+ReportedBy: atsushi at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: BigInteger.IsProbablePrime() fails on some primes
+
+Kazuki found some BigInteger issues:
+1) new BigInteger (5987).IsProbablePrime() returns false.
+2) new BigInteger (65537).IsProbablePrime() causes IndexOutOfRangeException.
+ http://primes.utm.edu/lists/small/10000.txt
+3) new BigInteger (5915587277).IsProbablePrime() returns false
+ http://primes.utm.edu/lists/small/small.html
+
+for 65537, the exception stack is:
+
+MonoTests.Mono.Math.BigIntegerTest.IsProbablePrime2 :
+System.IndexOutOfRangeException : Array index is out of range.
+ at Mono.Math.BigInteger.TestBit (UInt32 bitNum) [0x00011] in
+C:\cygwin\home\atsushi\svn\mcs\class\Mono.Security\Mono.Math\BigInteger.cs:634
+ at Mono.Math.BigInteger+ModulusRing.OddPow (UInt32 b,
+Mono.Math.BigInteger exp) [0x00071] in
+C:\cygwin\home\atsushi\svn\mcs\class\Mono.Security\Mono.Math\BigInteger.cs:1203
+ at Mono.Math.BigInteger+ModulusRing.Pow (UInt32 b, Mono.Math.BigInteger
+exp) [0x00015] in
+C:\cygwin\home\atsushi\svn\mcs\class\Mono.Security\Mono.Math\BigInteger.cs:1168
+ at Mono.Math.Prime.PrimalityTests.RabinMillerTest (Mono.Math.BigInteger
+bi, ConfidenceFactor confidence) [0x00037] in
+C:\cygwin\home\atsushi\svn\mcs\class\Mono.Security\Mono.Math.Prime\PrimalityTests.cs:133
+ at Mono.Math.BigInteger.IsProbablePrime () [0x0007c] in
+C:\cygwin\home\atsushi\svn\mcs\class\Mono.Security\Mono.Math\BigInteger.cs:909
+ at MonoTests.Mono.Math.BigIntegerTest.IsProbablePrime2 () [0x00000] in
+C:\cygwin\home\atsushi\svn\mcs\class\Mono.Security\Test\Mono.Math\BigIntegerTest.cs:104
+
+
+Additional Information:
+
+Kazuki has a fix for 5987, attached.
+
+He also doubt on OddPow() implementation for the other two cases.
More information about the mono-bugs
mailing list