00001 #ifndef CRYPTOPP_OAEP_H
00002 #define CRYPTOPP_OAEP_H
00003
00004 #include "pubkey.h"
00005 #include "sha.h"
00006
00007 NAMESPACE_BEGIN(CryptoPP)
00008
00009 extern byte OAEP_P_DEFAULT[];
00010
00011
00012 template <class H, class MGF=P1363_MGF1<H>, byte *P=OAEP_P_DEFAULT, unsigned int PLen=0>
00013 class OAEP : public PK_PaddingAlgorithm, public EncryptionStandard
00014 {
00015 public:
00016 static std::string StaticAlgorithmName() {return "OAEP-" + MGF::StaticAlgorithmName();}
00017 typedef OAEP<H, MGF, P, PLen> EncryptionPaddingAlgorithm;
00018
00019 unsigned int MaxUnpaddedLength(unsigned int paddedLength) const;
00020 void Pad(RandomNumberGenerator &rng, const byte *raw, unsigned int inputLength, byte *padded, unsigned int paddedLength) const;
00021 DecodingResult Unpad(const byte *padded, unsigned int paddedLength, byte *raw) const;
00022 };
00023
00024 CRYPTOPP_DLL_TEMPLATE_CLASS OAEP<SHA>;
00025
00026 NAMESPACE_END
00027
00028 #endif