diff options
Diffstat (limited to 'perl/test9.pl')
-rw-r--r-- | perl/test9.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/perl/test9.pl b/perl/test9.pl new file mode 100644 index 0000000000..ccc28005ac --- /dev/null +++ b/perl/test9.pl @@ -0,0 +1,38 @@ +#!/usr/local/bin/perl + +use ExtUtils::testlib; + +use SSLeay; + +# 2687145 * 3003 * 10^5072 - 1. + +$a=SSLeay::BN::set_word(2687145); +$b=SSLeay::BN::set_word(3003); +$c=SSLeay::BN::set_word(10); +$d=SSLeay::BN::set_word(5072); +$e=SSLeay::BN::set_word(1); + +print $a->bn2hex()."\n"; +print $b->bn2hex()."\n"; +print $c->bn2hex()."\n"; +print $d->bn2hex()."\n"; +print $e->bn2hex()."\n"; + +$f=(($a->mul($b)->mul($c->exp($d)))->sub($e)); +#print "$a $b\n"; + +$c=$a->mul($b); +print "1->".$c->bn2hex()." \n"; + +$c=$a*$b; +print "2->".$c->bn2hex()." \n"; +$a*=$b; +print "3->$a\n"; + +print $f->bn2hex()." $a\n"; +print $a."\n"; + +print "$a=(($b*$c)/$d);\n"; +$a=(($b*$c)/$d); +print "$a\n"; + |