Botan  2.1.0
Crypto and TLS for C++11
oaep.h
Go to the documentation of this file.
1 /*
2 * OAEP
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_OAEP_H__
9 #define BOTAN_OAEP_H__
10 
11 #include <botan/eme.h>
12 #include <botan/hash.h>
13 
14 namespace Botan {
15 
16 /**
17 * OAEP (called EME1 in IEEE 1363 and in earlier versions of the library)
18 */
19 class BOTAN_DLL OAEP final : public EME
20  {
21  public:
22  size_t maximum_input_size(size_t) const override;
23 
24  /**
25  * @param hash function to use for hashing (takes ownership)
26  * @param P an optional label. Normally empty.
27  */
28  OAEP(HashFunction* hash, const std::string& P = "");
29  private:
30  secure_vector<uint8_t> pad(const uint8_t in[],
31  size_t in_length,
32  size_t key_length,
33  RandomNumberGenerator& rng) const override;
34 
35  secure_vector<uint8_t> unpad(uint8_t& valid_mask,
36  const uint8_t in[],
37  size_t in_len) const override;
38 
39  secure_vector<uint8_t> m_Phash;
40  std::unique_ptr<HashFunction> m_hash;
41  };
42 
43 }
44 
45 #endif
Definition: eme.h:19
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Definition: alg_id.cpp:13
std::unique_ptr< HashFunction > m_hash
Definition: tpm.cpp:439
MechanismType hash