ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/OpenSSL/t/06_RSA.t
Revision: 1.1
Committed: Sat Oct 27 01:53:25 2001 UTC (24 years, 11 months ago) by stefan
Content type: application/x-troff
Branch: MAIN
CVS Tags: BEFORE_5_8_REGEX_FIX, HEAD
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 stefan 1.1
2     use Test;
3     BEGIN { plan tests => 2 };
4     use OpenSSL::RSA qw(new_keygen);
5     use OpenSSL::Rand "randbytes";
6     ok(1);
7    
8     $alice = new_keygen(255);
9    
10     $msg = randbytes(7);
11    
12     $enc = $alice->public_encrypt($msg);
13     #print STDERR "after encrypt, elen = ".length($enc)."\n";
14     $dec = $alice->private_decrypt($enc);
15    
16     if($dec ne $msg) {
17     print STDERR
18     "\ndec != msg\ndec = ".unpack ("H*", $dec).
19     "\nmsg = ".unpack("H*", $msg).
20     "\nlenmsg=".length($msg).
21     "\nlendec=".length($dec)."\n";
22     ok(0);
23     } else {
24     ok(1);
25     }
26