More .cvsignore stuff to make CVS quiet on our generated files.
[openssl.git] / perl / test.pl
1 #!/usr/local/bin/perl
2
3 use ExtUtils::testlib;
4
5 use SSLeay;
6
7 ($a=SSLeay::BN::new()) || die "unable to make bignum\n";
8 ($b=SSLeay::BN::new()) || die "unable to make bignum\n";
9
10 $a=SSLeay::BN::hex2bn("123456789ABCDEF");
11 $b=SSLeay::BN::hex2bn("123456789ABCDEF");
12 $mod=SSLeay::BN::hex2bn("fedcba9876543201");
13 $c=SSLeay::BN::hex2bn("1234");
14
15 print "a=".$a->bn2hex()."\n";
16 print "b=".$b->bn2hex()."\n";
17 print "c=".$c->bn2hex()."\n";
18
19 print $a->mul($b)->bn2hex."\n";
20 ($d,$r)=$b->div($c);
21 print "($d)($r)\n";
22 printf "%s x %s + %s\n",$c->bn2hex,$d->bn2hex,$r->bn2hex;
23
24 $g=$d;
25
26 for (;;)
27         {
28         $a=$a->mod_mul($a,$mod);
29         print $a->bn2hex."\n";
30         }