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

« back to all changes in this revision

Viewing changes to cppForSwig/cryptopp/serpent.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_SERPENT_H
 
2
#define CRYPTOPP_SERPENT_H
 
3
 
 
4
/** \file
 
5
*/
 
6
 
 
7
#include "seckey.h"
 
8
#include "secblock.h"
 
9
 
 
10
NAMESPACE_BEGIN(CryptoPP)
 
11
 
 
12
//! _
 
13
struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, public FixedRounds<32>
 
14
{
 
15
        static const char *StaticAlgorithmName() {return "Serpent";}
 
16
};
 
17
 
 
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Serpent">Serpent</a>
 
19
class Serpent : public Serpent_Info, public BlockCipherDocumentation
 
20
{
 
21
        class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Serpent_Info>
 
22
        {
 
23
        public:
 
24
                void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
 
25
 
 
26
        protected:
 
27
                FixedSizeSecBlock<word32, 33*4> m_key;
 
28
        };
 
29
 
 
30
        class CRYPTOPP_NO_VTABLE Enc : public Base
 
31
        {
 
32
        public:
 
33
                void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
 
34
        };
 
35
 
 
36
        class CRYPTOPP_NO_VTABLE Dec : public Base
 
37
        {
 
38
        public:
 
39
                void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
 
40
        };
 
41
 
 
42
public:
 
43
        typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
 
44
        typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
 
45
};
 
46
 
 
47
typedef Serpent::Encryption SerpentEncryption;
 
48
typedef Serpent::Decryption SerpentDecryption;
 
49
 
 
50
NAMESPACE_END
 
51
 
 
52
#endif