Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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