~ubuntu-branches/debian/jessie/armory/jessie

« back to all changes in this revision

Viewing changes to cppForSwig/cryptopp/rc6.h

  • Committer: Package Import Robot
  • Author(s): Joseph Bisch
  • Date: 2014-10-07 10:22:45 UTC
  • Revision ID: package-import@ubuntu.com-20141007102245-2s3x3rhjxg689hek
Tags: upstream-0.92.3
ImportĀ upstreamĀ versionĀ 0.92.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CRYPTOPP_RC6_H
 
2
#define CRYPTOPP_RC6_H
 
3
 
 
4
/** \file
 
5
*/
 
6
 
 
7
#include "seckey.h"
 
8
#include "secblock.h"
 
9
 
 
10
NAMESPACE_BEGIN(CryptoPP)
 
11
 
 
12
//! _
 
13
struct RC6_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 255>, public VariableRounds<20>
 
14
{
 
15
        static const char *StaticAlgorithmName() {return "RC6";}
 
16
        typedef word32 RC6_WORD;
 
17
};
 
18
 
 
19
/// <a href="http://www.weidai.com/scan-mirror/cs.html#RC6">RC6</a>
 
20
class RC6 : public RC6_Info, public BlockCipherDocumentation
 
21
{
 
22
        class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC6_Info>
 
23
        {
 
24
        public:
 
25
                void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
 
26
 
 
27
        protected:
 
28
                unsigned int r;       // number of rounds
 
29
                SecBlock<RC6_WORD> sTable;  // expanded key table
 
30
        };
 
31
 
 
32
        class CRYPTOPP_NO_VTABLE Enc : public Base
 
33
        {
 
34
        public:
 
35
                void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
 
36
        };
 
37
 
 
38
        class CRYPTOPP_NO_VTABLE Dec : public Base
 
39
        {
 
40
        public:
 
41
                void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
 
42
        };
 
43
 
 
44
public:
 
45
        typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
 
46
        typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
 
47
};
 
48
 
 
49
typedef RC6::Encryption RC6Encryption;
 
50
typedef RC6::Decryption RC6Decryption;
 
51
 
 
52
NAMESPACE_END
 
53
 
 
54
#endif