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

« back to all changes in this revision

Viewing changes to include/cast256.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
 
* CAST-256 Header File                           *
3
 
* (C) 1999-2007 The Botan Project                *
4
 
*************************************************/
5
 
 
6
 
#ifndef BOTAN_CAST256_H__
7
 
#define BOTAN_CAST256_H__
8
 
 
9
 
#include <botan/base.h>
10
 
 
11
 
namespace Botan {
12
 
 
13
 
/*************************************************
14
 
* CAST-256                                       *
15
 
*************************************************/
16
 
class CAST_256 : public BlockCipher
17
 
   {
18
 
   public:
19
 
      void clear() throw() { MK.clear(); RK.clear(); }
20
 
      std::string name() const { return "CAST-256"; }
21
 
      BlockCipher* clone() const { return new CAST_256; }
22
 
      CAST_256() : BlockCipher(16, 4, 32, 4) {}
23
 
   private:
24
 
      void enc(const byte[], byte[]) const;
25
 
      void dec(const byte[], byte[]) const;
26
 
      void key(const byte[], u32bit);
27
 
      void round1(u32bit&, u32bit, u32bit, u32bit) const;
28
 
      void round2(u32bit&, u32bit, u32bit, u32bit) const;
29
 
      void round3(u32bit&, u32bit, u32bit, u32bit) const;
30
 
      static const u32bit KEY_MASK[192];
31
 
      static const byte   KEY_ROT[32];
32
 
      SecureBuffer<u32bit, 48> MK;
33
 
      SecureBuffer<byte, 48> RK;
34
 
   };
35
 
 
36
 
extern const u32bit CAST_SBOX1[256];
37
 
extern const u32bit CAST_SBOX2[256];
38
 
extern const u32bit CAST_SBOX3[256];
39
 
extern const u32bit CAST_SBOX4[256];
40
 
 
41
 
}
42
 
 
43
 
#endif