diff options
author | René Korthaus <[email protected]> | 2016-04-13 19:07:33 +0200 |
---|---|---|
committer | René Korthaus <[email protected]> | 2016-06-14 17:33:50 +0200 |
commit | e14d6a0489ee290d289cf276fa3ff94044191af7 (patch) | |
tree | d3961328c1b6ba592a2114d3f231cd49c6c2a9a2 /src/lib/pk_pad/emsa1 | |
parent | 6816c9e71e01432792a997ad9a5d561b9cd94a48 (diff) |
Add ECKCDSA signature algorithm
Diffstat (limited to 'src/lib/pk_pad/emsa1')
-rw-r--r-- | src/lib/pk_pad/emsa1/emsa1.cpp | 5 | ||||
-rw-r--r-- | src/lib/pk_pad/emsa1/emsa1.h | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/pk_pad/emsa1/emsa1.cpp b/src/lib/pk_pad/emsa1/emsa1.cpp index 0031bf263..67f8ab21f 100644 --- a/src/lib/pk_pad/emsa1/emsa1.cpp +++ b/src/lib/pk_pad/emsa1/emsa1.cpp @@ -40,6 +40,11 @@ secure_vector<byte> emsa1_encoding(const secure_vector<byte>& msg, } +EMSA* EMSA1::clone() + { + return new EMSA1(m_hash->clone()); + } + void EMSA1::update(const byte input[], size_t length) { m_hash->update(input, length); diff --git a/src/lib/pk_pad/emsa1/emsa1.h b/src/lib/pk_pad/emsa1/emsa1.h index e346167da..5a4b4b372 100644 --- a/src/lib/pk_pad/emsa1/emsa1.h +++ b/src/lib/pk_pad/emsa1/emsa1.h @@ -25,8 +25,13 @@ class BOTAN_DLL EMSA1 : public EMSA */ explicit EMSA1(HashFunction* hash) : m_hash(hash) {} + EMSA* clone() override; + protected: size_t hash_output_length() const { return m_hash->output_length(); } + + std::unique_ptr<HashFunction> m_hash; + private: void update(const byte[], size_t) override; secure_vector<byte> raw_data() override; @@ -39,7 +44,6 @@ class BOTAN_DLL EMSA1 : public EMSA const secure_vector<byte>& raw, size_t key_bits) override; - std::unique_ptr<HashFunction> m_hash; }; } |