diff options
author | Jack Lloyd <[email protected]> | 2016-03-19 22:52:48 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-03-20 09:38:22 -0400 |
commit | b8966d0f89e520cecf3e822241aef38ed9a6d876 (patch) | |
tree | 9b5c0f6afa89e8e91ef230e3d7824b10e037802c /src/cli/speed.cpp | |
parent | ada363473a9491a3b07e3bb6fa2b5fd9f12aec98 (diff) |
Clean up PK decryption encoding.
Previously RSA and ElGamal stripped off leading zeros which were then
assumed by the padding decoders. Instead have them produce ciphertexts
with leading zeros. Changes EME_Raw to strip leading zeros to match
existing behavior.
Diffstat (limited to 'src/cli/speed.cpp')
-rw-r--r-- | src/cli/speed.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp index 0ce2c0c53..e221b1052 100644 --- a/src/cli/speed.cpp +++ b/src/cli/speed.cpp @@ -726,8 +726,8 @@ class Speed final : public Command Botan::PK_Encryptor_EME enc(key, padding, provider); Botan::PK_Decryptor_EME dec(key, padding, provider); - Timer enc_timer(nm, provider, "encrypt"); - Timer dec_timer(nm, provider, "decrypt"); + Timer enc_timer(nm, provider, padding + " encrypt"); + Timer dec_timer(nm, provider, padding + " decrypt"); while(enc_timer.under(msec) || dec_timer.under(msec)) { @@ -793,8 +793,8 @@ class Speed final : public Command Botan::PK_Signer sig(key, padding, Botan::IEEE_1363, provider); Botan::PK_Verifier ver(key, padding, Botan::IEEE_1363, provider); - Timer sig_timer(nm, provider, "sign"); - Timer ver_timer(nm, provider, "verify"); + Timer sig_timer(nm, provider, padding + " sign"); + Timer ver_timer(nm, provider, padding + " verify"); while(ver_timer.under(msec) || sig_timer.under(msec)) { @@ -855,7 +855,10 @@ class Speed final : public Command // Using PKCS #1 padding so OpenSSL provider can play along bench_pk_enc(*key, nm, provider, "EME-PKCS1-v1_5", msec); + bench_pk_enc(*key, nm, provider, "OAEP(SHA-1)", msec); + bench_pk_sig(*key, nm, provider, "EMSA-PKCS1-v1_5(SHA-1)", msec); + bench_pk_sig(*key, nm, provider, "PSSR(SHA-256)", msec); } } #endif |