Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

emsa1.h
Go to the documentation of this file.
1 /*
2 * EMSA1
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_EMSA1_H__
9 #define BOTAN_EMSA1_H__
10
11 #include <botan/emsa.h>
12 #include <botan/hash.h>
13
14 namespace Botan {
15
16 /**
17 * EMSA1 from IEEE 1363
18 * Essentially, sign the hash directly
19 */
20 class BOTAN_DLL EMSA1 : public EMSA
21 {
22 public:
23 /**
24 * @param hash the hash function to use
25 */
26 explicit EMSA1(HashFunction* hash) : m_hash(hash) {}
27
28 EMSA* clone() override;
29
30 protected:
31 size_t hash_output_length() const { return m_hash->output_length(); }
32
33 std::unique_ptr<HashFunction> m_hash;
34
35 private:
36 void update(const uint8_t[], size_t) override;
37 secure_vector<uint8_t> raw_data() override;
38
39 secure_vector<uint8_t> encoding_of(const secure_vector<uint8_t>& msg,
40 size_t output_bits,
41 RandomNumberGenerator& rng) override;
42
43 bool verify(const secure_vector<uint8_t>& coded,
44 const secure_vector<uint8_t>& raw,
45 size_t key_bits) override;
46
47 };
48
49 }
50
51 #endif
Botan::EMSA1::EMSA1
EMSA1(HashFunction *hash)
Definition: emsa1.h:26
Botan::RandomNumberGenerator
Definition: rng.h:25
Botan::EMSA1::hash_output_length
size_t hash_output_length() const
Definition: emsa1.h:31
Botan::EMSA1::m_hash
std::unique_ptr< HashFunction > m_hash
Definition: emsa1.h:33
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::EMSA
Definition: emsa.h:21
Botan
Definition: alg_id.cpp:13
Botan::HashFunction
Definition: hash.h:19
Botan::EMSA1
Definition: emsa1.h:20
m_hash
std::unique_ptr< HashFunction > m_hash
Definition: tpm.cpp:439
hash
MechanismType hash
Definition: p11_mechanism.cpp:63