monotone

monotone Mtn Source Tree

Root/botan/aes.h

1/*************************************************
2* AES Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_AES_H__
7#define BOTAN_AES_H__
8
9#include <botan/base.h>
10
11namespace Botan {
12
13/*************************************************
14* AES *
15*************************************************/
16class AES : public BlockCipher
17 {
18 public:
19 void clear() throw();
20 std::string name() const { return "AES"; }
21 BlockCipher* clone() const { return new AES; }
22 AES() : BlockCipher(16, 16, 32, 8) { ROUNDS = 14; }
23 AES(u32bit);
24 private:
25 void enc(const byte[], byte[]) const;
26 void dec(const byte[], byte[]) const;
27 void key(const byte[], u32bit);
28 static u32bit S(u32bit);
29 static const byte SE[256], SD[256];
30 static const u32bit TE0[256], TE1[256], TE2[256], TE3[256],
31 TD0[256], TD1[256], TD2[256], TD3[256];
32 SecureBuffer<u32bit, 52> EK, DK;
33 SecureBuffer<byte, 32> ME, MD;
34 u32bit ROUNDS;
35 };
36
37/*************************************************
38* AES-128 *
39*************************************************/
40class AES_128 : public AES
41 {
42 public:
43 std::string name() const { return "AES-128"; }
44 BlockCipher* clone() const { return new AES_128; }
45 AES_128() : AES(16) {}
46 };
47
48/*************************************************
49* AES-192 *
50*************************************************/
51class AES_192 : public AES
52 {
53 public:
54 std::string name() const { return "AES-192"; }
55 BlockCipher* clone() const { return new AES_192; }
56 AES_192() : AES(24) {}
57 };
58
59/*************************************************
60* AES-256 *
61*************************************************/
62class AES_256 : public AES
63 {
64 public:
65 std::string name() const { return "AES-256"; }
66 BlockCipher* clone() const { return new AES_256; }
67 AES_256() : AES(32) {}
68 };
69
70}
71
72#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status