aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pk_pad/emsa1/emsa1.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-18 23:00:53 +0000
committerlloyd <[email protected]>2014-01-18 23:00:53 +0000
commitd5354c1c3ee0067dd35ca253d4b8914f870cea75 (patch)
tree09dce01e5489528a2fe1874547ae97effccdd746 /src/lib/pk_pad/emsa1/emsa1.h
parent700ae0440c1fac65a218fc2ae5883bdc63683f08 (diff)
More unique_ptr, and pull <memory> all the way up to types.h
Diffstat (limited to 'src/lib/pk_pad/emsa1/emsa1.h')
-rw-r--r--src/lib/pk_pad/emsa1/emsa1.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/lib/pk_pad/emsa1/emsa1.h b/src/lib/pk_pad/emsa1/emsa1.h
index f84ca5ae7..8df53f789 100644
--- a/src/lib/pk_pad/emsa1/emsa1.h
+++ b/src/lib/pk_pad/emsa1/emsa1.h
@@ -21,26 +21,25 @@ class BOTAN_DLL EMSA1 : public EMSA
{
public:
/**
- * @param h the hash object to use
+ * @param hash the hash function to use
*/
- EMSA1(HashFunction* h) : hash(h) {}
- ~EMSA1() { delete hash; }
+ EMSA1(HashFunction* hash) : m_hash(hash) {}
+
protected:
- /**
- * @return const pointer to the underlying hash
- */
- const HashFunction* hash_ptr() const { return hash; }
+ size_t hash_output_length() const { return m_hash->output_length(); }
private:
void update(const byte[], size_t);
secure_vector<byte> raw_data();
- secure_vector<byte> encoding_of(const secure_vector<byte>&, size_t,
- RandomNumberGenerator& rng);
+ secure_vector<byte> encoding_of(const secure_vector<byte>& msg,
+ size_t output_bits,
+ RandomNumberGenerator& rng);
- bool verify(const secure_vector<byte>&, const secure_vector<byte>&,
- size_t);
+ bool verify(const secure_vector<byte>& coded,
+ const secure_vector<byte>& raw,
+ size_t key_bits);
- HashFunction* hash;
+ std::unique_ptr<HashFunction> m_hash;
};
}