Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

emsa_x931.h
Go to the documentation of this file.
1 /*
2 * X9.31 EMSA
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_EMSA_X931_H_
9 #define BOTAN_EMSA_X931_H_
10
11 #include <botan/emsa.h>
12 #include <botan/hash.h>
13
14 BOTAN_FUTURE_INTERNAL_HEADER(emsa_x931.h)
15
16 namespace Botan {
17
18 /**
19 * EMSA from X9.31 (EMSA2 in IEEE 1363)
20 * Useful for Rabin-Williams, also sometimes used with RSA in
21 * odd protocols.
22 */
23 class BOTAN_PUBLIC_API(2,0) EMSA_X931 final : public EMSA
24 {
25 public:
26 /**
27 * @param hash the hash function to use
28 */
29 explicit EMSA_X931(HashFunction* hash);
30
31 EMSA* clone() override { return new EMSA_X931(m_hash->clone()); }
32
33 std::string name() const override;
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>&, size_t,
40 RandomNumberGenerator& rng) override;
41
42 bool verify(const secure_vector<uint8_t>&, const secure_vector<uint8_t>&,
43 size_t) override;
44
45 secure_vector<uint8_t> m_empty_hash;
46 std::unique_ptr<HashFunction> m_hash;
47 uint8_t m_hash_id;
48 };
49
50 }
51
52 #endif
Botan::RandomNumberGenerator
Definition: rng.h:24
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::update
virtual void update(const uint8_t input[], size_t length)=0
m_hash_id
std::vector< uint8_t > m_hash_id
Definition: tpm.cpp:447
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:65
Botan::EMSA_X931
Definition: emsa_x931.h:23
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
m_hash
std::unique_ptr< HashFunction > m_hash
Definition: tpm.cpp:446
Botan::EMSA_X931::clone
EMSA * clone() override
Definition: emsa_x931.h:31
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
hash
MechanismType hash
Definition: p11_mechanism.cpp:64