~ubuntu-branches/ubuntu/intrepid/libcrypto++/intrepid

« back to all changes in this revision

Viewing changes to serpent.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Machard
  • Date: 2004-08-27 12:35:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040827123505-7evgxiu7k8memiyk
Tags: 5.2.1a-1
* Urgency set to high because lastest upload was unclean
* Rename libcrypto++-5.2.1.orig.tar.gz in  libcrypto++-5.2.1a.orig.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
NAMESPACE_BEGIN(CryptoPP)
11
11
 
 
12
//! _
12
13
struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 1, 32>, public FixedRounds<32>
13
14
{
14
15
        static const char *StaticAlgorithmName() {return "Serpent";}
17
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Serpent">Serpent</a>
18
19
class Serpent : public Serpent_Info, public BlockCipherDocumentation
19
20
{
20
 
        class Base : public BlockCipherBaseTemplate<Serpent_Info>
 
21
        class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Serpent_Info>
21
22
        {
22
23
        public:
23
24
                void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
26
27
                FixedSizeSecBlock<word32, 140> m_key;
27
28
        };
28
29
 
29
 
        class Enc : public Base
 
30
        class CRYPTOPP_NO_VTABLE Enc : public Base
30
31
        {
31
32
        public:
32
33
                void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
33
34
        };
34
35
 
35
 
        class Dec : public Base
 
36
        class CRYPTOPP_NO_VTABLE Dec : public Base
36
37
        {
37
38
        public:
38
39
                void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
39
40
        };
40
41
 
41
42
public:
42
 
        typedef BlockCipherTemplate<ENCRYPTION, Enc> Encryption;
43
 
        typedef BlockCipherTemplate<DECRYPTION, Dec> Decryption;
 
43
        typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
 
44
        typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
44
45
};
45
46
 
46
47
typedef Serpent::Encryption SerpentEncryption;