diff options
author | Karel Miko <karel.miko@gmail.com> | 2017-09-19 20:44:26 +0200 |
---|---|---|
committer | Karel Miko <karel.miko@gmail.com> | 2017-09-19 20:44:26 +0200 |
commit | 045ef91eaa842c255b0b6a2c93b59fdc35fc8d03 (patch) | |
tree | 8edf751d2599b5ecbf9c880547f001e637512366 /t/wycheproof.t | |
parent | 8273173fb3d95cdd77a89bec35721a5b19d38f22 (diff) |
more diag
Diffstat (limited to 't/wycheproof.t')
-rw-r--r-- | t/wycheproof.t | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/wycheproof.t b/t/wycheproof.t index 0782d032..0747fe69 100644 --- a/t/wycheproof.t +++ b/t/wycheproof.t @@ -11,6 +11,7 @@ plan tests => 762; use CryptX; use Crypt::Misc 'read_rawfile'; +use Crypt::Digest 'digest_data'; if (1) { use Crypt::AuthEnc::GCM qw(gcm_encrypt_authenticate gcm_decrypt_verify); @@ -117,6 +118,15 @@ if (1) { my $testname = "type=$type/$sha tcId=$tcId comment='$comment' expected-result=$result"; my $pk = Crypt::PK::DSA->new( \$keyPem ); my $valid = $pk->verify_message($sig, $message, $sha); + my $hash = digest_data($sha, $message); + my $valid_h = $pk->verify_hash($sig, $hash); + if ($tcId==55) { + diag "SPECIAL: tcId 55"; + diag "sig-len:".length($sig)." sig-hex:".unpack("H*", $sig); + diag "msg-len:".length($message)." msg-hex:".unpack("H*", $message); + diag "hash-len:".length($hash)." hash-hex:".unpack("H*", $hash); + diag "hash:$sha valid_m:$valid valid_h:$valid_h"; + } if ($result eq 'valid' || $result eq 'acceptable') { ok($valid, $testname); } |