From b21162cf8e06f40baa1f58be6a8c17435cebc34d Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 4 Oct 2002 17:31:41 +0000 Subject: Initial revision git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@2 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- oaep.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 oaep.h (limited to 'oaep.h') diff --git a/oaep.h b/oaep.h new file mode 100644 index 0000000..96baaa1 --- /dev/null +++ b/oaep.h @@ -0,0 +1,25 @@ +#ifndef CRYPTOPP_OAEP_H +#define CRYPTOPP_OAEP_H + +#include "pubkey.h" + +NAMESPACE_BEGIN(CryptoPP) + +extern byte OAEP_P_DEFAULT[]; // defined in misc.cpp + +/// EME-OAEP, for use with RSAES +template , byte *P=OAEP_P_DEFAULT, unsigned int PLen=0> +class OAEP : public PK_PaddingAlgorithm, public EncryptionStandard +{ +public: + static std::string StaticAlgorithmName() {return "OAEP-" + MGF::StaticAlgorithmName();} + typedef OAEP EncryptionPaddingAlgorithm; + + unsigned int MaxUnpaddedLength(unsigned int paddedLength) const; + void Pad(RandomNumberGenerator &rng, const byte *raw, unsigned int inputLength, byte *padded, unsigned int paddedLength) const; + DecodingResult Unpad(const byte *padded, unsigned int paddedLength, byte *raw) const; +}; + +NAMESPACE_END + +#endif -- cgit v1.2.1