Botan 2.13.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 BOTAN_FUTURE_INTERNAL_HEADER(emsa1.h)
15
16 namespace Botan {
17
18 /**
19 * EMSA1 from IEEE 1363
20 * Essentially, sign the hash directly
21 */
22 class BOTAN_PUBLIC_API(2,0) EMSA1 final : public EMSA
23 {
24 public:
25 /**
26 * @param hash the hash function to use
27 */
28 explicit EMSA1(HashFunction* hash) : m_hash(hash) {}
29
30 EMSA* clone() override;
31
32 std::string name() const override;
33
34 AlgorithmIdentifier config_for_x509(const Private_Key& key,
35 const std::string& cert_hash_name) const override;
36 private:
37 size_t hash_output_length() const { return m_hash->output_length(); }
38
39 void update(const uint8_t[], size_t) override;
40 secure_vector<uint8_t> raw_data() override;
41
42 secure_vector<uint8_t> encoding_of(const secure_vector<uint8_t>& msg,
43 size_t output_bits,
44 RandomNumberGenerator& rng) override;
45
46 bool verify(const secure_vector<uint8_t>& coded,
47 const secure_vector<uint8_t>& raw,
48 size_t key_bits) override;
49
50 std::unique_ptr<HashFunction> m_hash;
51 };
52
53 }
54
55 #endif
Botan::EMSA1::EMSA1
EMSA1(HashFunction *hash)
Definition: emsa1.h:28
Botan::Private_Key
Definition: pk_keys.h:181
Botan::EMSA::name
virtual std::string name() const =0
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::EMSA::clone
virtual EMSA * clone()=0
Botan::EMSA::update
virtual void update(const uint8_t input[], size_t length)=0
Botan::EMSA::verify
virtual bool verify(const secure_vector< uint8_t > &coded, const secure_vector< uint8_t > &raw, size_t key_bits)=0
Botan::EMSA
Definition: emsa.h:27
Botan
Definition: alg_id.cpp:13
Botan::EMSA::raw_data
virtual secure_vector< uint8_t > raw_data()=0
Botan::EMSA::encoding_of
virtual secure_vector< uint8_t > encoding_of(const secure_vector< uint8_t > &msg, size_t output_bits, RandomNumberGenerator &rng)=0
Botan::HashFunction
Definition: hash.h:20
Botan::EMSA1
Definition: emsa1.h:22
Botan::AlgorithmIdentifier
Definition: alg_id.h:21
Botan::EMSA::config_for_x509
virtual AlgorithmIdentifier config_for_x509(const Private_Key &key, const std::string &cert_hash_name) const
Definition: emsa.cpp:38
m_hash
std::unique_ptr< HashFunction > m_hash
Definition: tpm.cpp:446
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
hash
MechanismType hash
Definition: p11_mechanism.cpp:64