Botan  1.11.15
src/lib/pk_pad/eme_oaep/oaep.h
Go to the documentation of this file.
00001 /*
00002 * OAEP
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_OAEP_H__
00009 #define BOTAN_OAEP_H__
00010 
00011 #include <botan/eme.h>
00012 #include <botan/kdf.h>
00013 #include <botan/hash.h>
00014 
00015 namespace Botan {
00016 
00017 /**
00018 * OAEP (called EME1 in IEEE 1363 and in earlier versions of the library)
00019 */
00020 class BOTAN_DLL OAEP : public EME
00021    {
00022    public:
00023       size_t maximum_input_size(size_t) const;
00024 
00025       static OAEP* make(const Spec& spec);
00026 
00027       /**
00028       * @param hash object to use for hashing (takes ownership)
00029       * @param P an optional label. Normally empty.
00030       */
00031       OAEP(HashFunction* hash, const std::string& P = "");
00032    private:
00033       secure_vector<byte> pad(const byte[], size_t, size_t,
00034                              RandomNumberGenerator&) const;
00035       secure_vector<byte> unpad(const byte[], size_t, size_t) const;
00036 
00037       secure_vector<byte> m_Phash;
00038       std::unique_ptr<HashFunction> m_hash;
00039    };
00040 
00041 }
00042 
00043 #endif