Updated documentation
parent
c87d7bf2cd
commit
22400b2ad1
11
cryptlib.h
11
cryptlib.h
|
|
@ -1666,12 +1666,13 @@ public:
|
||||||
//! \brief Discard skipMax bytes from the output buffer
|
//! \brief Discard skipMax bytes from the output buffer
|
||||||
//! \param skipMax the number of bytes to discard
|
//! \param skipMax the number of bytes to discard
|
||||||
//! \details Skip() discards bytes from the output buffer, which is the AttachedTransformation(), if present.
|
//! \details Skip() discards bytes from the output buffer, which is the AttachedTransformation(), if present.
|
||||||
//! The function always returns skipMax.
|
//! The function always returns the parameter <tt>skipMax</tt>.
|
||||||
//! \details If you want to skip bytes from a Source, then perform the following.
|
//! \details If you want to skip bytes from a Source, then perform the following.
|
||||||
//! <pre>StringSource ss(str, false, new Redirector(TheBitBucket()));
|
//! <pre>
|
||||||
//! ss.Pump(10); // Skip 10 bytes from Source
|
//! StringSource ss(str, false, new Redirector(TheBitBucket()));
|
||||||
//! ss.Detach(new FilterChain(...));
|
//! ss.Pump(10); // Skip 10 bytes from Source
|
||||||
//! ss.PumpAll();
|
//! ss.Detach(new FilterChain(...));
|
||||||
|
//! ss.PumpAll();
|
||||||
//! </pre>
|
//! </pre>
|
||||||
virtual lword Skip(lword skipMax=LWORD_MAX);
|
virtual lword Skip(lword skipMax=LWORD_MAX);
|
||||||
|
|
||||||
|
|
|
||||||
59
filters.h
59
filters.h
|
|
@ -378,10 +378,16 @@ protected:
|
||||||
// Same as NextPutMultiple(), but inString can be modified
|
// Same as NextPutMultiple(), but inString can be modified
|
||||||
virtual void NextPutModifiable(byte *inString, size_t length)
|
virtual void NextPutModifiable(byte *inString, size_t length)
|
||||||
{NextPutMultiple(inString, length);}
|
{NextPutMultiple(inString, length);}
|
||||||
// LastPut() is always called
|
//! \brief Input the last block of data
|
||||||
// if totalLength < firstSize then length == totalLength
|
//! \param inString the input byte buffer
|
||||||
// else if totalLength <= firstSize+lastSize then length == totalLength-firstSize
|
//! \param length the size of the input buffer, in bytes
|
||||||
// else lastSize <= length < lastSize+blockSize
|
//! \details LastPut() processes the last block of data and signals attached filters to do the same.
|
||||||
|
//! LastPut() is always called. The pseudo algorithm for the logic is:
|
||||||
|
//! <pre>
|
||||||
|
//! if totalLength < firstSize</tt> then length == totalLength
|
||||||
|
//! else if totalLength <= firstSize+lastSize then length == totalLength-firstSize
|
||||||
|
//! else lastSize <= length < lastSize+blockSize
|
||||||
|
//! </pre>
|
||||||
virtual void LastPut(const byte *inString, size_t length) =0;
|
virtual void LastPut(const byte *inString, size_t length) =0;
|
||||||
virtual void FlushDerived() {}
|
virtual void FlushDerived() {}
|
||||||
|
|
||||||
|
|
@ -604,7 +610,10 @@ typedef HashVerificationFilter HashVerifier; // for backwards compatibility
|
||||||
|
|
||||||
//! \class AuthenticatedEncryptionFilter
|
//! \class AuthenticatedEncryptionFilter
|
||||||
//! \brief Filter wrapper for encrypting with AuthenticatedSymmetricCipher
|
//! \brief Filter wrapper for encrypting with AuthenticatedSymmetricCipher
|
||||||
//! \details Filter wrapper for encrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpadding when needed
|
//! \details AuthenticatedEncryptionFilter() is a wrapper for encrypting with AuthenticatedSymmetricCipher(),
|
||||||
|
//! optionally handling padding/unpadding when needed.
|
||||||
|
//! \sa AuthenticatedDecryptionFilter, EAX, CCM, GCM, AuthenticatedSymmetricCipher
|
||||||
|
//! \since Crypto++ 5.6.0
|
||||||
class CRYPTOPP_DLL AuthenticatedEncryptionFilter : public StreamTransformationFilter
|
class CRYPTOPP_DLL AuthenticatedEncryptionFilter : public StreamTransformationFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -616,11 +625,23 @@ public:
|
||||||
//! \param macChannel the channel on which the MAC should be output
|
//! \param macChannel the channel on which the MAC should be output
|
||||||
//! \param padding the \ref BlockPaddingSchemeDef "padding scheme"
|
//! \param padding the \ref BlockPaddingSchemeDef "padding scheme"
|
||||||
//! \details <tt>truncatedDigestSize = -1</tt> indicates \ref HashTransformation::DigestSize() "DigestSize" should be used.
|
//! \details <tt>truncatedDigestSize = -1</tt> indicates \ref HashTransformation::DigestSize() "DigestSize" should be used.
|
||||||
|
//! \since Crypto++ 5.6.0
|
||||||
AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, bool putAAD=false, int truncatedDigestSize=-1, const std::string &macChannel=DEFAULT_CHANNEL, BlockPaddingScheme padding = DEFAULT_PADDING);
|
AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, bool putAAD=false, int truncatedDigestSize=-1, const std::string &macChannel=DEFAULT_CHANNEL, BlockPaddingScheme padding = DEFAULT_PADDING);
|
||||||
|
|
||||||
void IsolatedInitialize(const NameValuePairs ¶meters);
|
void IsolatedInitialize(const NameValuePairs ¶meters);
|
||||||
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size);
|
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size);
|
||||||
size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking);
|
size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking);
|
||||||
|
|
||||||
|
//! \brief Input the last block of data
|
||||||
|
//! \param inString the input byte buffer
|
||||||
|
//! \param length the size of the input buffer, in bytes
|
||||||
|
//! \details LastPut() processes the last block of data and signals attached filters to do the same.
|
||||||
|
//! LastPut() is always called. The pseudo algorithm for the logic is:
|
||||||
|
//! <pre>
|
||||||
|
//! if totalLength < firstSize</tt> then length == totalLength
|
||||||
|
//! else if totalLength <= firstSize+lastSize then length == totalLength-firstSize
|
||||||
|
//! else lastSize <= length < lastSize+blockSize
|
||||||
|
//! </pre>
|
||||||
void LastPut(const byte *inString, size_t length);
|
void LastPut(const byte *inString, size_t length);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -629,7 +650,10 @@ protected:
|
||||||
|
|
||||||
//! \class AuthenticatedDecryptionFilter
|
//! \class AuthenticatedDecryptionFilter
|
||||||
//! \brief Filter wrapper for decrypting with AuthenticatedSymmetricCipher
|
//! \brief Filter wrapper for decrypting with AuthenticatedSymmetricCipher
|
||||||
//! \details Filter wrapper wrapper for decrypting with AuthenticatedSymmetricCipher, optionally handling padding/unpadding when needed.
|
//! \details AuthenticatedDecryptionFilter() is a wrapper for decrypting with AuthenticatedSymmetricCipher(),
|
||||||
|
//! optionally handling padding/unpadding when needed.
|
||||||
|
//! \sa AuthenticatedEncryptionFilter, EAX, CCM, GCM, AuthenticatedSymmetricCipher
|
||||||
|
//! \since Crypto++ 5.6.0
|
||||||
class CRYPTOPP_DLL AuthenticatedDecryptionFilter : public FilterWithBufferedInput, public BlockPaddingSchemeDef
|
class CRYPTOPP_DLL AuthenticatedDecryptionFilter : public FilterWithBufferedInput, public BlockPaddingSchemeDef
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -655,6 +679,7 @@ public:
|
||||||
//! \param padding the \ref BlockPaddingSchemeDef "padding scheme"
|
//! \param padding the \ref BlockPaddingSchemeDef "padding scheme"
|
||||||
//! \details Additional authenticated data should be given in channel "AAD".
|
//! \details Additional authenticated data should be given in channel "AAD".
|
||||||
//! \details <tt>truncatedDigestSize = -1</tt> indicates \ref HashTransformation::DigestSize() "DigestSize" should be used.
|
//! \details <tt>truncatedDigestSize = -1</tt> indicates \ref HashTransformation::DigestSize() "DigestSize" should be used.
|
||||||
|
//! \since Crypto++ 5.6.0
|
||||||
AuthenticatedDecryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS, int truncatedDigestSize=-1, BlockPaddingScheme padding = DEFAULT_PADDING);
|
AuthenticatedDecryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment = NULL, word32 flags = DEFAULT_FLAGS, int truncatedDigestSize=-1, BlockPaddingScheme padding = DEFAULT_PADDING);
|
||||||
|
|
||||||
std::string AlgorithmName() const {return m_hashVerifier.AlgorithmName();}
|
std::string AlgorithmName() const {return m_hashVerifier.AlgorithmName();}
|
||||||
|
|
@ -666,6 +691,17 @@ protected:
|
||||||
void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize);
|
void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize);
|
||||||
void FirstPut(const byte *inString);
|
void FirstPut(const byte *inString);
|
||||||
void NextPutMultiple(const byte *inString, size_t length);
|
void NextPutMultiple(const byte *inString, size_t length);
|
||||||
|
|
||||||
|
//! \brief Input the last block of data
|
||||||
|
//! \param inString the input byte buffer
|
||||||
|
//! \param length the size of the input buffer, in bytes
|
||||||
|
//! \details LastPut() processes the last block of data and signals attached filters to do the same.
|
||||||
|
//! LastPut() is always called. The pseudo algorithm for the logic is:
|
||||||
|
//! <pre>
|
||||||
|
//! if totalLength < firstSize</tt> then length == totalLength
|
||||||
|
//! else if totalLength <= firstSize+lastSize then length == totalLength-firstSize
|
||||||
|
//! else lastSize <= length < lastSize+blockSize
|
||||||
|
//! </pre>
|
||||||
void LastPut(const byte *inString, size_t length);
|
void LastPut(const byte *inString, size_t length);
|
||||||
|
|
||||||
HashVerificationFilter m_hashVerifier;
|
HashVerificationFilter m_hashVerifier;
|
||||||
|
|
@ -926,6 +962,17 @@ public:
|
||||||
|
|
||||||
void FirstPut(const byte * inString)
|
void FirstPut(const byte * inString)
|
||||||
{CRYPTOPP_UNUSED(inString);}
|
{CRYPTOPP_UNUSED(inString);}
|
||||||
|
|
||||||
|
//! \brief Input the last block of data
|
||||||
|
//! \param inString the input byte buffer
|
||||||
|
//! \param length the size of the input buffer, in bytes
|
||||||
|
//! \details LastPut() processes the last block of data and signals attached filters to do the same.
|
||||||
|
//! LastPut() is always called. The pseudo algorithm for the logic is:
|
||||||
|
//! <pre>
|
||||||
|
//! if totalLength < firstSize</tt> then length == totalLength
|
||||||
|
//! else if totalLength <= firstSize+lastSize then length == totalLength-firstSize
|
||||||
|
//! else lastSize <= length < lastSize+blockSize
|
||||||
|
//! </pre>
|
||||||
void LastPut(const byte *inString, size_t length)
|
void LastPut(const byte *inString, size_t length)
|
||||||
{CRYPTOPP_UNUSED(inString), CRYPTOPP_UNUSED(length); m_filter->MessageEnd();}
|
{CRYPTOPP_UNUSED(inString), CRYPTOPP_UNUSED(length); m_filter->MessageEnd();}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue