Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jan 2, 2020
1 parent 1cf7706 commit 20a4626
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 47 deletions.
7 changes: 4 additions & 3 deletions cryptlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2027,6 +2027,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm,
virtual bool GetNextMessage();

/// \brief Skip a number of meessages
/// \param count number of messages to skip
/// \return 0 if the requested number of messages was skipped, non-0 otherwise
/// \details SkipMessages() skips count number of messages. If there is an AttachedTransformation()
/// then SkipMessages() is called on the attached transformation. If there is no attached
Expand All @@ -2047,10 +2048,10 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm,

/// \brief Copy messages from this object to another BufferedTransformation
/// \param target the destination BufferedTransformation
/// \param count the number of messages to transfer
/// \param channel the channel on which the transfer should occur
/// \param count the number of messages to copy
/// \param channel the channel on which the copy should occur
/// \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
/// \details CopyMessagesTo copies messages from this object and copies them to the destination.
/// \details CopyMessagesTo copies messages from this object to the destination.
/// If all bytes are not transferred for a message, then processing stops and the number of remaining
/// bytes is returned. CopyMessagesTo() does not proceed to the next message.
/// \details A return value of 0 indicates all messages were successfully copied.
Expand Down
17 changes: 16 additions & 1 deletion serpent.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/// \file serpent.h
/// \brief Classes for the Serpent block cipher
/// \sa <a href="https://www.cl.cam.ac.uk/~rja14/serpent.html">A
/// Candidate Block Cipher for the Advanced Encryption Standard</a>

#ifndef CRYPTOPP_SERPENT_H
#define CRYPTOPP_SERPENT_H
Expand All @@ -19,10 +21,15 @@ struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16
};

/// \brief Serpent block cipher
/// \sa <a href="http://www.cryptopp.com/wiki/Serpent">Serpent</a>
/// \sa <a href="http://www.cryptopp.com/wiki/Serpent">Serpent</a> on the
/// Crypto++ wiki, <a href="https://www.cl.cam.ac.uk/~rja14/serpent.html">A
/// Candidate Block Cipher for the Advanced Encryption Standard</a>
/// \since Crypto++ 3.1
class Serpent : public Serpent_Info, public BlockCipherDocumentation
{
/// \brief Serpen block cipher base implementation
/// \details Provides implementation common to encryption and decryption
/// \since Crypto++ 3.1
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Serpent_Info>
{
public:
Expand All @@ -32,12 +39,20 @@ class Serpent : public Serpent_Info, public BlockCipherDocumentation
FixedSizeSecBlock<word32, 33*4> m_key;
};

/// \brief Serpent encryption transformation
/// \details Enc provides the encryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 3.1
class CRYPTOPP_NO_VTABLE Enc : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
};

/// \brief Serpent decryption transformation
/// \details Dec provides the decryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 3.1
class CRYPTOPP_NO_VTABLE Dec : public Base
{
public:
Expand Down
58 changes: 29 additions & 29 deletions simon.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/// \file simon.h
/// \brief Classes for the Simon block cipher
/// \details Simon is a block cipher designed by Ray Beaulieu, Douglas Shors, Jason Smith,
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
/// \sa <A HREF="http://eprint.iacr.org/2013/404">The SIMON and SPECK Families of
/// Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
/// The Simon and Speck GitHub</A> and <A HREF="https://www.cryptopp.com/wiki/SIMON">
/// SIMON</A> on the Crypto++ wiki.
/// Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
/// The Simon and Speck GitHub</A> and <A HREF="https://www.cryptopp.com/wiki/SIMON">
/// SIMON</A> on the Crypto++ wiki.
/// \since Crypto++ 6.0

#ifndef CRYPTOPP_SIMON_H
Expand Down Expand Up @@ -54,7 +54,7 @@ struct SIMON_Info : public FixedBlockSize<L>, VariableKeyLength<D, N, M>
/// \brief The algorithm name
/// \returns the algorithm name
/// \details StaticAlgorithmName returns the algorithm's name as a static
/// member function.
/// member function.
static const std::string StaticAlgorithmName()
{
// Format is Cipher-Blocksize(Keylength)
Expand Down Expand Up @@ -82,17 +82,17 @@ struct SIMON_Base

/// \brief SIMON 64-bit block cipher
/// \details Simon is a block cipher designed by Ray Beaulieu, Douglas Shors, Jason Smith,
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
/// \details SIMON64 provides 64-bit block size. The valid key sizes are 96-bit and 128-bit.
/// \sa SIMON64, SIMON128, <A HREF="http://eprint.iacr.org/2013/404">The SIMON and SIMON
/// Families of Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
/// The Simon and Speck GitHub</A>, <a href="http://www.cryptopp.com/wiki/SIMON">SIMON</a> on the
/// Crypto++ wiki
/// Families of Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
/// The Simon and Speck GitHub</A>, <a href="http://www.cryptopp.com/wiki/SIMON">SIMON</a> on the
/// Crypto++ wiki
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE SIMON64 : public SIMON_Info<8, 12, 12, 16>, public BlockCipherDocumentation
{
public:
/// \brief SIMON block cipher transformation functions
/// \brief SIMON64 block cipher base implementation
/// \details Provides implementation common to encryption and decryption
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Base : protected SIMON_Base<word32>, public BlockCipherImpl<SIMON_Info<8, 12, 12, 16> >
Expand All @@ -101,7 +101,7 @@ class CRYPTOPP_NO_VTABLE SIMON64 : public SIMON_Info<8, 12, 12, 16>, public Bloc
/// \brief The algorithm name
/// \returns the algorithm name
/// \details AlgorithmName returns the algorithm's name as a
/// member function.
/// member function.
std::string AlgorithmName() const {
return StaticAlgorithmName() + (m_kwords == 0 ? "" :
"(" + IntToString(m_kwords*sizeof(word32)*8) + ")");
Expand All @@ -118,9 +118,9 @@ class CRYPTOPP_NO_VTABLE SIMON64 : public SIMON_Info<8, 12, 12, 16>, public Bloc
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
};

/// \brief Encryption transformation
/// \details Enc provides implementation for encryption transformation. All key
/// sizes are supported.
/// \brief SIMON64 encryption transformation
/// \details Enc provides the encryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Enc : public Base
{
Expand All @@ -131,9 +131,9 @@ class CRYPTOPP_NO_VTABLE SIMON64 : public SIMON_Info<8, 12, 12, 16>, public Bloc
#endif
};

/// \brief Decryption transformation
/// \details Dec provides implementation for decryption transformation. All key
/// sizes are supported.
/// \brief SIMON64 decryption transformation
/// \details Dec provides the decryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Dec : public Base
{
Expand All @@ -150,17 +150,17 @@ class CRYPTOPP_NO_VTABLE SIMON64 : public SIMON_Info<8, 12, 12, 16>, public Bloc

/// \brief SIMON 128-bit block cipher
/// \details Simon is a block cipher designed by Ray Beaulieu, Douglas Shors, Jason Smith,
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
/// \details SIMON128 provides 128-bit block size. The valid key sizes are 128-bit, 192-bit and 256-bit.
/// \sa SIMON64, SIMON128, <A HREF="http://eprint.iacr.org/2013/404">The SIMON and SIMON
/// Families of Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
/// The Simon and Speck GitHub</A>, <a href="http://www.cryptopp.com/wiki/SIMON">SIMON</a> on the
/// Crypto++ wiki
/// Families of Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
/// The Simon and Speck GitHub</A>, <a href="http://www.cryptopp.com/wiki/SIMON">SIMON</a> on the
/// Crypto++ wiki
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE SIMON128 : public SIMON_Info<16, 16, 16, 32>, public BlockCipherDocumentation
{
public:
/// \brief SIMON block cipher transformation functions
/// \brief SIMON128 block cipher base implementation
/// \details Provides implementation common to encryption and decryption
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Base : protected SIMON_Base<word64>, public BlockCipherImpl<SIMON_Info<16, 16, 16, 32> >
Expand All @@ -169,7 +169,7 @@ class CRYPTOPP_NO_VTABLE SIMON128 : public SIMON_Info<16, 16, 16, 32>, public Bl
/// \brief The algorithm name
/// \returns the algorithm name
/// \details AlgorithmName returns the algorithm's name as a
/// member function.
/// member function.
std::string AlgorithmName() const {
return StaticAlgorithmName() + (m_kwords == 0 ? "" :
"(" + IntToString(m_kwords*sizeof(word64)*8) + ")");
Expand All @@ -186,9 +186,9 @@ class CRYPTOPP_NO_VTABLE SIMON128 : public SIMON_Info<16, 16, 16, 32>, public Bl
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
};

/// \brief Encryption transformation
/// \details Enc provides implementation for encryption transformation. All key
/// sizes are supported.
/// \brief SIMON128 encryption transformation
/// \details Enc provides the encryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Enc : public Base
{
Expand All @@ -199,9 +199,9 @@ class CRYPTOPP_NO_VTABLE SIMON128 : public SIMON_Info<16, 16, 16, 32>, public Bl
#endif
};

/// \brief Decryption transformation
/// \details Dec provides implementation for decryption transformation. All key
/// sizes are supported.
/// \brief SIMON128 decryption transformation
/// \details Dec provides the decryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Dec : public Base
{
Expand Down
28 changes: 14 additions & 14 deletions speck.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct SPECK_Base
class CRYPTOPP_NO_VTABLE SPECK64 : public SPECK_Info<8, 12, 12, 16>, public BlockCipherDocumentation
{
public:
/// \brief SPECK block cipher transformation functions
/// \brief SPECK64 block cipher base implementation
/// \details Provides implementation common to encryption and decryption
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Base : protected SPECK_Base<word32>, public BlockCipherImpl<SPECK_Info<8, 12, 12, 16> >
Expand All @@ -118,9 +118,9 @@ class CRYPTOPP_NO_VTABLE SPECK64 : public SPECK_Info<8, 12, 12, 16>, public Bloc
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
};

/// \brief Encryption transformation
/// \details Enc provides implementation for encryption transformation. All key
/// sizes are supported.
/// \brief SPECK64 encryption transformation
/// \details Enc provides the encryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Enc : public Base
{
Expand All @@ -131,9 +131,9 @@ class CRYPTOPP_NO_VTABLE SPECK64 : public SPECK_Info<8, 12, 12, 16>, public Bloc
#endif
};

/// \brief Decryption transformation
/// \details Dec provides implementation for decryption transformation. All key
/// sizes are supported.
/// \brief SPECK64 decryption transformation
/// \details Dec provides the decryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Dec : public Base
{
Expand All @@ -160,7 +160,7 @@ class CRYPTOPP_NO_VTABLE SPECK64 : public SPECK_Info<8, 12, 12, 16>, public Bloc
class CRYPTOPP_NO_VTABLE SPECK128 : public SPECK_Info<16, 16, 16, 32>, public BlockCipherDocumentation
{
public:
/// \brief SPECK block cipher transformation functions
/// \brief SPECK128 block cipher base implementation
/// \details Provides implementation common to encryption and decryption
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Base : protected SPECK_Base<word64>, public BlockCipherImpl<SPECK_Info<16, 16, 16, 32> >
Expand All @@ -186,9 +186,9 @@ class CRYPTOPP_NO_VTABLE SPECK128 : public SPECK_Info<16, 16, 16, 32>, public Bl
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
};

/// \brief Encryption transformation
/// \details Enc provides implementation for encryption transformation. All key
/// sizes are supported.
/// \brief SPECK128 encryption transformation
/// \details Enc provides the encryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Enc : public Base
{
Expand All @@ -199,9 +199,9 @@ class CRYPTOPP_NO_VTABLE SPECK128 : public SPECK_Info<16, 16, 16, 32>, public Bl
#endif
};

/// \brief Decryption transformation
/// \details Dec provides implementation for decryption transformation. All key
/// sizes are supported.
/// \brief SPECK128 decryption transformation
/// \details Dec provides the decryption transformation.
/// All key sizes are supported.
/// \since Crypto++ 6.0
class CRYPTOPP_NO_VTABLE Dec : public Base
{
Expand Down

0 comments on commit 20a4626

Please sign in to comment.