diff options
author | lloyd <[email protected]> | 2015-03-23 02:14:48 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-03-23 02:14:48 +0000 |
commit | e9283c9817949aa27ae97f0c9ec06745fb62240d (patch) | |
tree | 8cbdb20e07b5b74e734ded250363776bff1daf04 /src/lib/pubkey/pubkey.h | |
parent | ce679ca4fc75c7f7ffa36d4364392fe0dd2b1294 (diff) |
Move the signature padding schemes to the PK operation classes,
as was previously done with encrypt/decrypt ops.
One feature dropped on the floor here is previously PK_Signer by
default did verification of signatures before releasing them as an
measure against fault attacks. However in addition to being expensive
this turned out to be difficult to implement with the new scheme.
Diffstat (limited to 'src/lib/pubkey/pubkey.h')
-rw-r--r-- | src/lib/pubkey/pubkey.h | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/lib/pubkey/pubkey.h b/src/lib/pubkey/pubkey.h index ffb00979d..54c55c597 100644 --- a/src/lib/pubkey/pubkey.h +++ b/src/lib/pubkey/pubkey.h @@ -24,14 +24,6 @@ namespace Botan { enum Signature_Format { IEEE_1363, DER_SEQUENCE }; /** -* Enum marking if protection against fault attacks should be used -*/ -enum Fault_Protection { - ENABLE_FAULT_PROTECTION, - DISABLE_FAULT_PROTECTION -}; - -/** * Public Key Encryptor */ class BOTAN_DLL PK_Encryptor @@ -136,7 +128,11 @@ class BOTAN_DLL PK_Signer * @return signature */ std::vector<byte> sign_message(const byte in[], size_t length, - RandomNumberGenerator& rng); + RandomNumberGenerator& rng) + { + this->update(in, length); + return this->signature(rng); + } /** * Sign a message. @@ -191,19 +187,12 @@ class BOTAN_DLL PK_Signer * @param emsa the EMSA to use * An example would be "EMSA1(SHA-224)". * @param format the signature format to use - * @param prot says if fault protection should be enabled */ PK_Signer(const Private_Key& key, const std::string& emsa, - Signature_Format format = IEEE_1363, - Fault_Protection prot = ENABLE_FAULT_PROTECTION); + Signature_Format format = IEEE_1363); private: - bool self_test_signature(const std::vector<byte>& msg, - const std::vector<byte>& sig) const; - std::unique_ptr<PK_Ops::Signature> m_op; - std::unique_ptr<PK_Ops::Verification> m_verify_op; - std::unique_ptr<EMSA> m_emsa; Signature_Format m_sig_format; }; @@ -299,11 +288,7 @@ class BOTAN_DLL PK_Verifier const std::string& emsa, Signature_Format format = IEEE_1363); private: - bool validate_signature(const secure_vector<byte>& msg, - const byte sig[], size_t sig_len); - std::unique_ptr<PK_Ops::Verification> m_op; - std::unique_ptr<EMSA> m_emsa; Signature_Format m_sig_format; }; |