Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

oaep.h

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[];   // defined in misc.cpp
00010 
00011 /// <a href="http://www.weidai.com/scan-mirror/ca.html#cem_OAEP-MGF1">EME-OAEP</a>, for use with RSAES
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

Generated on Tue Jul 8 23:34:21 2003 for Crypto++ by doxygen 1.3.2