diff options
Diffstat (limited to 'src/lib/libssl/src/perl/test9.pl')
-rw-r--r-- | src/lib/libssl/src/perl/test9.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/lib/libssl/src/perl/test9.pl b/src/lib/libssl/src/perl/test9.pl new file mode 100644 index 0000000000..cc710c310e --- /dev/null +++ b/src/lib/libssl/src/perl/test9.pl | |||
@@ -0,0 +1,38 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | use ExtUtils::testlib; | ||
4 | |||
5 | use SSLeay; | ||
6 | |||
7 | # 2687145 * 3003 * 10^5072 - 1. | ||
8 | |||
9 | $a=SSLeay::BN::set_word(2687145); | ||
10 | $b=SSLeay::BN::set_word(3003); | ||
11 | $c=SSLeay::BN::set_word(10); | ||
12 | $d=SSLeay::BN::set_word(5072); | ||
13 | $e=SSLeay::BN::set_word(1); | ||
14 | |||
15 | print $a->bn2hex()."\n"; | ||
16 | print $b->bn2hex()."\n"; | ||
17 | print $c->bn2hex()."\n"; | ||
18 | print $d->bn2hex()."\n"; | ||
19 | print $e->bn2hex()."\n"; | ||
20 | |||
21 | $f=(($a->mul($b)->mul($c->exp($d)))->sub($e)); | ||
22 | #print "$a $b\n"; | ||
23 | |||
24 | $c=$a->mul($b); | ||
25 | print "1->".$c->bn2hex()." \n"; | ||
26 | |||
27 | $c=$a*$b; | ||
28 | print "2->".$c->bn2hex()." \n"; | ||
29 | $a*=$b; | ||
30 | print "3->$a\n"; | ||
31 | |||
32 | print $f->bn2hex()." $a\n"; | ||
33 | print $a."\n"; | ||
34 | |||
35 | print "$a=(($b*$c)/$d);\n"; | ||
36 | $a=(($b*$c)/$d); | ||
37 | print "$a\n"; | ||
38 | |||