monotone

monotone Mtn Source Tree

Root/botan/aes.h

1/*************************************************
2* AES Header File *
3* (C) 1999-2006 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 TE[1024], TD[1024];
31 SecureBuffer<u32bit, 52> EK, DK;
32 SecureBuffer<byte, 32> ME, MD;
33 u32bit ROUNDS;
34 };
35
36/*************************************************
37* AES-128 *
38*************************************************/
39class AES_128 : public AES
40 {
41 public:
42 std::string name() const { return "AES-128"; }
43 BlockCipher* clone() const { return new AES_128; }
44 AES_128() : AES(16) {}
45 };
46
47/*************************************************
48* AES-192 *
49*************************************************/
50class AES_192 : public AES
51 {
52 public:
53 std::string name() const { return "AES-192"; }
54 BlockCipher* clone() const { return new AES_192; }
55 AES_192() : AES(24) {}
56 };
57
58/*************************************************
59* AES-256 *
60*************************************************/
61class AES_256 : public AES
62 {
63 public:
64 std::string name() const { return "AES-256"; }
65 BlockCipher* clone() const { return new AES_256; }
66 AES_256() : AES(32) {}
67 };
68
69}
70
71#endif

Archive Download this file

Branches

Tags

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