mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Update documentation
This commit is contained in:
parent
69a40e992c
commit
69fd4a040d
32
authenc.h
32
authenc.h
@ -1,8 +1,20 @@
|
||||
// authenc.h - originally written and placed in the public domain by Wei Dai
|
||||
|
||||
//! \file
|
||||
//! \headerfile authenc.h
|
||||
//! \brief Base classes for working with authenticated encryption modes of encryption
|
||||
//! \brief Classes for authenticated encryption modes of operation
|
||||
//! \details Authenticated encryption (AE) schemes combine confidentiality and authenticity
|
||||
//! into a single mode of operation They gained traction in the early 2000's because manually
|
||||
//! combining them was error prone for the typical developer. Around that time, the desire to
|
||||
//! authenticate but not ecrypt additional data (AAD) was also identified. When both features
|
||||
//! are available from a scheme, the system is referred to as an AEAD scheme.
|
||||
//! \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
|
||||
//! and OCB mode. All modes derive from AuthenticatedSymmetricCipherBase() and the
|
||||
//! motivation for the API, like calling AAD a "header", can be found in Bellare,
|
||||
//! Rogaway and Wagner's <A HREF="http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf">The EAX
|
||||
//! Mode of Operation</A>. The EAX paper suggested a basic API to help standardize AEAD
|
||||
//! schemes in software and promote adoption of the modes.
|
||||
//! \sa <A HREF="http://www.cryptopp.com/wiki/Authenticated_Encryption">Authenticated
|
||||
//! Encryption</A> on the Crypto++ wiki.
|
||||
//! \since Crypto++ 5.6.0
|
||||
|
||||
#ifndef CRYPTOPP_AUTHENC_H
|
||||
@ -14,7 +26,17 @@
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
//! \class AuthenticatedSymmetricCipherBase
|
||||
//! \brief Base implementation for one direction (encryption or decryption) of a stream cipher or block cipher mode with authentication
|
||||
//! \brief Base class for authenticated encryption modes of operation
|
||||
//! \details AuthenticatedSymmetricCipherBase() serves as a base implementation for one direction
|
||||
//! (encryption or decryption) of a stream cipher or block cipher mode with authentication.
|
||||
//! \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
|
||||
//! and OCB mode. All modes derive from AuthenticatedSymmetricCipherBase() and the
|
||||
//! motivation for the API, like calling AAD a "header", can be found in Bellare,
|
||||
//! Rogaway and Wagner's <A HREF="http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf">The EAX
|
||||
//! Mode of Operation</A>. The EAX paper suggested a basic API to help standardize AEAD
|
||||
//! schemes in software and promote adoption of the modes.
|
||||
//! \sa <A HREF="http://www.cryptopp.com/wiki/Authenticated_Encryption">Authenticated
|
||||
//! Encryption</A> on the Crypto++ wiki.
|
||||
//! \since Crypto++ 5.6.0
|
||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipherBase : public AuthenticatedSymmetricCipher
|
||||
{
|
||||
@ -22,6 +44,7 @@ public:
|
||||
AuthenticatedSymmetricCipherBase() : m_state(State_Start), m_bufferedDataLength(0),
|
||||
m_totalHeaderLength(0), m_totalMessageLength(0), m_totalFooterLength(0) {}
|
||||
|
||||
// StreamTransformation interface
|
||||
bool IsRandomAccess() const {return false;}
|
||||
bool IsSelfInverting() const {return true;}
|
||||
|
||||
@ -42,7 +65,8 @@ public:
|
||||
|
||||
protected:
|
||||
void AuthenticateData(const byte *data, size_t len);
|
||||
const SymmetricCipher & GetSymmetricCipher() const {return const_cast<AuthenticatedSymmetricCipherBase *>(this)->AccessSymmetricCipher();};
|
||||
const SymmetricCipher & GetSymmetricCipher() const
|
||||
{return const_cast<AuthenticatedSymmetricCipherBase *>(this)->AccessSymmetricCipher();};
|
||||
|
||||
virtual SymmetricCipher & AccessSymmetricCipher() =0;
|
||||
virtual bool AuthenticationIsOnPlaintext() const =0;
|
||||
|
2
misc.h
2
misc.h
@ -111,7 +111,7 @@
|
||||
# define SIZE_MAX SIZE_T_MAX
|
||||
# elif defined(__SIZE_TYPE__)
|
||||
# define SIZE_MAX (~(__SIZE_TYPE__)0)
|
||||
#else
|
||||
# else
|
||||
# define SIZE_MAX ((std::numeric_limits<size_t>::max)())
|
||||
# endif
|
||||
#endif
|
||||
|
14
secblock.h
14
secblock.h
@ -615,6 +615,20 @@ public:
|
||||
m_mark = ELEMS_MAX;
|
||||
}
|
||||
|
||||
//! \brief Set contents from a value
|
||||
//! \param count the number of values to copy
|
||||
//! \param value the value, repeated count times
|
||||
//! \details If the memory block is reduced in size, then the reclaimed memory is set to 0.
|
||||
//! Assign() resets the element count after the previous block is zeroized.
|
||||
void Assign(size_type count, T value)
|
||||
{
|
||||
New(count);
|
||||
for (size_t i=0; i<count; ++i)
|
||||
m_ptr[i] = value;
|
||||
|
||||
m_mark = ELEMS_MAX;
|
||||
}
|
||||
|
||||
//! \brief Copy contents from another SecBlock
|
||||
//! \param t the other SecBlock
|
||||
//! \details Assign checks for self assignment.
|
||||
|
Loading…
Reference in New Issue
Block a user