Botan 1.10.17
rc2.h
Go to the documentation of this file.
1/*
2* RC2
3* (C) 1999-2007 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_RC2_H__
9#define BOTAN_RC2_H__
10
11#include <botan/block_cipher.h>
12
13namespace Botan {
14
15/**
16* RC2
17*/
18class BOTAN_DLL RC2 : public Block_Cipher_Fixed_Params<8, 1, 32>
19 {
20 public:
21 void encrypt_n(const byte in[], byte out[], size_t blocks) const;
22 void decrypt_n(const byte in[], byte out[], size_t blocks) const;
23
24 /**
25 * Return the code of the effective key bits
26 * @param bits key length
27 * @return EKB code
28 */
29 static byte EKB_code(size_t bits);
30
31 void clear() { zeroise(K); }
32 std::string name() const { return "RC2"; }
33 BlockCipher* clone() const { return new RC2; }
34
35 RC2() : K(64) {}
36 private:
37 void key_schedule(const byte[], size_t);
38
40 };
41
42}
43
44#endif
void encrypt_n(const byte in[], byte out[], size_t blocks) const
Definition rc2.cpp:17
void clear()
Definition rc2.h:31
RC2()
Definition rc2.h:35
static byte EKB_code(size_t bits)
Definition rc2.cpp:144
BlockCipher * clone() const
Definition rc2.h:33
std::string name() const
Definition rc2.h:32
void decrypt_n(const byte in[], byte out[], size_t blocks) const
Definition rc2.cpp:59
void zeroise(MemoryRegion< T > &vec)
Definition secmem.h:428