X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/d3409d5ecf2492cff862616de72a580d1a8e8dc0..674cd11ec63b56561980249cb19a0db54bacfa86:/tests/mp diff --git a/tests/mp b/tests/mp index 27854a2..329c0ee 100644 --- a/tests/mp +++ b/tests/mp @@ -1,6 +1,6 @@ # Test vectors for MP functions # -# $Id: mp,v 1.1 1999/11/17 18:02:17 mdw Exp $ +# $Id: mp,v 1.3 1999/12/10 23:25:51 mdw Exp $ add { 5 4 9; 5 -4 1; -5 4 -1; -5 -4 -9; @@ -22,11 +22,33 @@ div { } gcd { + + # --- Simple tests --- + 16 12 4 -2 3; 12 16 4 -1 1; 693 609 21 -181 206; 4398082908043 90980984098081324 1 -32483863573352089 1570292150447; + # --- Negative argument tests --- + + 16 -12 4 -2 -3; + -16 12 4 2 3; + -12 -16 4 1 -1; + -12 16 4 1 1; + -693 609 21 181 206; + 693 -609 21 -181 -206; + + # --- Zero argument tests --- + + 15 0 15 1 0; + 0 15 15 0 1; + -5 0 5 -1 0; + 0 -5 5 0 -1; + 0 0 0 0 0; + + # --- Random number tests --- + 829561629303257626084392170900075 32498098450983560651904114638965 5 -22841190347053190672253237276815 583054885752979049202923618992482; @@ -55,3 +77,10 @@ gcd { -4601007896041464028712478963832994007038251361995647370 514778499400157641662814932021958856708417966520837469125919104431; } + +jacobi { + 4 5 1; + 6 7 -1; + 15 27 0; + 2132498039840981 98729378979237498798347932749951 1; +}