- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# rc6.h

Go to the documentation of this file.

    00001 #ifndef CRYPTOPP_RC6_H
    00002 #define CRYPTOPP_RC6_H
    00003
    00004 /** \file
    00005 */
    00006
    00007 #include "seckey.h"
    00008 #include "secblock.h"
    00009
    00010 NAMESPACE_BEGIN(CryptoPP)
    00011
    00012 //! _
    00013 struct RC6_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 255>, public VariableRounds<20>
    00014 {
    00015         static const char *StaticAlgorithmName() {return "RC6";}
    00016         typedef word32 RC6_WORD;
    00017 };
    00018
    00019 /// <a href="http://www.weidai.com/scan-mirror/cs.html#RC6">RC6</a>
    00020 class RC6 : public RC6_Info, public BlockCipherDocumentation
    00021 {
    00022         class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC6_Info>
    00023         {
    00024         public:
    00025                 void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length, unsigned int rounds);
    00026
    00027         protected:
    00028                 unsigned int r;       // number of rounds
    00029                 SecBlock<RC6_WORD> sTable;  // expanded key table
    00030         };
    00031
    00032         class CRYPTOPP_NO_VTABLE Enc : public Base
    00033         {
    00034         public:
    00035                 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
    00036         };
    00037
    00038         class CRYPTOPP_NO_VTABLE Dec : public Base
    00039         {
    00040         public:
    00041                 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
    00042         };
    00043
    00044 public:
    00045         typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
    00046         typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
    00047 };
    00048
    00049 typedef RC6::Encryption RC6Encryption;
    00050 typedef RC6::Decryption RC6Decryption;
    00051
    00052 NAMESPACE_END
    00053
    00054 #endif