~ubuntu-branches/debian/sid/botan/sid

« back to all changes in this revision

Viewing changes to include/turing.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2018-03-01 22:23:25 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20180301222325-7p7vc45gu3hta34d
Tags: 2.4.0-2
* Don't remove .doctrees from the manual if it doesn't exist.
* Don't specify parallel to debhelper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*************************************************
2
 
* Turing Header File                             *
3
 
* (C) 1999-2007 The Botan Project                *
4
 
*************************************************/
5
 
 
6
 
#ifndef BOTAN_TURING_H__
7
 
#define BOTAN_TURING_H__
8
 
 
9
 
#include <botan/base.h>
10
 
 
11
 
namespace Botan {
12
 
 
13
 
/*************************************************
14
 
* Turing                                         *
15
 
*************************************************/
16
 
class Turing : public StreamCipher
17
 
   {
18
 
   public:
19
 
      void clear() throw();
20
 
      std::string name() const { return "Turing"; }
21
 
      StreamCipher* clone() const { return new Turing; }
22
 
      Turing() : StreamCipher(4, 32, 4) { position = 0; }
23
 
   private:
24
 
      void cipher(const byte[], byte[], u32bit);
25
 
      void key(const byte[], u32bit);
26
 
      void resync(const byte[], u32bit);
27
 
      void generate();
28
 
 
29
 
      static u32bit fixedS(u32bit);
30
 
      static void gen_sbox(MemoryRegion<u32bit>&, u32bit,
31
 
                           const MemoryRegion<u32bit>&);
32
 
 
33
 
      static const u32bit Q_BOX[256];
34
 
      static const byte SBOX[256], OFFSETS[272];
35
 
 
36
 
      SecureBuffer<u32bit, 256> S0, S1, S2, S3;
37
 
      SecureBuffer<u32bit, 17> R;
38
 
      SecureVector<u32bit> K;
39
 
      SecureBuffer<byte, 340> buffer;
40
 
      u32bit position;
41
 
   };
42
 
 
43
 
}
44
 
 
45
 
#endif