~ubuntu-branches/debian/sid/botan/sid

« back to all changes in this revision

Viewing changes to src/lib/pk_pad/eme_oaep/oaep.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2018-03-01 22:23:25 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20180301222325-7p7vc45gu3hta34d
Tags: 2.4.0-2
* Don't remove .doctrees from the manual if it doesn't exist.
* Don't specify parallel to debhelper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
* as specified in PKCS#1 v2.0 (RFC 2437)
 
19
*/
 
20
class BOTAN_PUBLIC_API(2,0) OAEP final : public EME
 
21
   {
 
22
   public:
 
23
      size_t maximum_input_size(size_t) const override;
 
24
 
 
25
      /**
 
26
      * @param hash function to use for hashing (takes ownership)
 
27
      * @param P an optional label. Normally empty.
 
28
      */
 
29
      OAEP(HashFunction* hash, const std::string& P = "");
 
30
   private:
 
31
      secure_vector<uint8_t> pad(const uint8_t in[],
 
32
                              size_t in_length,
 
33
                              size_t key_length,
 
34
                              RandomNumberGenerator& rng) const override;
 
35
 
 
36
      secure_vector<uint8_t> unpad(uint8_t& valid_mask,
 
37
                                const uint8_t in[],
 
38
                                size_t in_len) const override;
 
39
 
 
40
      secure_vector<uint8_t> m_Phash;
 
41
      std::unique_ptr<HashFunction> m_hash;
 
42
   };
 
43
 
 
44
}
 
45
 
 
46
#endif