math/t/{mpx,mpmont}: Add some extra tests for flushing out `mul4' bugs.
[catacomb] / math / t / mpmont
index 27e03c1..eef6a23 100644 (file)
@@ -1,10 +1,22 @@
 # Test vectors for Montgomery reduction
 
+mul {
+  6277101735386680763835789423207666416083908700390324961279
+  2455155546008943817740293915197451784769108058161191238065
+  340282366920938463500268095579187314689
+  5646741895976341600220572388698743135318229029826089708489;
+}
+
 create {
   340809809850981098423498794792349    # m
   266454859                            # -m^{-1} mod b
   130655606683780235388773757767708    # R mod m
   237786678640282040194246459306177;   # R^2 mod m
+
+  6277101735386680763835789423207666416083908700390324961279
+  340282366920938463444927863358058659841
+  18446744073709551617
+  340282366920938463500268095579187314689;
 }
 
 mul {
@@ -13,10 +25,28 @@ mul {
   6456542564
   10807149256;
 
+  4325987397987458979875737589783
+  1
+  4309747041023999857206910900081
+  4309747041023999857206910900081;
+
+  170141183460469231731687303715884105727
+  2
+  2
+  4;
+
+  6277101735386680763835789423207666416083908700390324961279
+  2455155546008943817740293915197451784769108058161191238065
+  340282366920938463500268095579187314689
+  5646741895976341600220572388698743135318229029826089708489;
+
   51518627314818829164222247085233898246715229794943812733936714788310185005015428803253311691709787911812368198649776769324928993075889524373913555618270874746833913595051625422038974326537979654635530320271853851973343513053953211672797425464186157719021174955241645388345195723368057041032310152242301620397
   7041548659011846562361842096561083537784928869240554198760844555642215260669458833049231069318370838770180094409088437631986867239713464317243824963669990014087444248250948204574690463940534304651099653802302150197753463246181762684347288736386534346725039618007392334267637262008343417972878515511486456037
   21451817224897484023627307128311082613304580637202546848860538836010530320943159719981586919811151828606838777812233053319458755053306547823820900602281867134174742586071226220962576712633552196944784360512851517812225731562588375896089193406088239903885470354101095713609394462435076126493339021945199401247
   48192532305912989641372170084506981675917951543147719789775743631071830656350879578731578070582102149232280305157616093002880139716311910835926678896882798493523792373475521651115163420137602661060123597773253524671874189844988793471524978853764238038494563159505836018994860909028653670132922744758133798212;
+
+  0x1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+  0 1 0;
 }
 
 exp {
@@ -25,6 +55,11 @@ exp {
   8745435676786567758678547
   2439674515119108242643169132064;
 
+  170141183460469231731687303715884105727
+  2
+  170141183460469231731687303715884105727
+  2;
+
   # --- Bizarre bug ---
   #
   # This was caused by omission of the test-and-subtract step in the