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

« back to all changes in this revision

Viewing changes to shacal2.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:
 
1
#ifndef CRYPTOPP_SHACAL2_H
 
2
#define CRYPTOPP_SHACAL2_H
 
3
 
 
4
/** \file
 
5
*/
 
6
 
 
7
#include "seckey.h"
 
8
#include "secblock.h"
 
9
 
 
10
NAMESPACE_BEGIN(CryptoPP)
 
11
 
 
12
//! _
 
13
struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64>
 
14
{
 
15
        static const char *StaticAlgorithmName() {return "SHACAL-2";}
 
16
};
 
17
 
 
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SHACAL-2">SHACAL-2</a>
 
19
class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation
 
20
{
 
21
        class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>
 
22
        {
 
23
        public:
 
24
                void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
 
25
 
 
26
        protected:
 
27
                FixedSizeSecBlock<word32, 64> m_key;
 
28
 
 
29
                static const word32 K[64];
 
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 SHACAL2::Encryption SHACAL2Encryption;
 
50
typedef SHACAL2::Decryption SHACAL2Decryption;
 
51
 
 
52
NAMESPACE_END
 
53
 
 
54
#endif