Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

aria.h
Go to the documentation of this file.
1 /*
2 * ARIA
3 * (C) 2017 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 *
7 * This ARIA implementation is based on the 32-bit implementation by Aaram Yun from the
8 * National Security Research Institute, KOREA. Aaram Yun's implementation is based on
9 * the 8-bit implementation by Jin Hong. The source files are available in ARIA.zip from
10 * the Korea Internet & Security Agency website.
11 * <A HREF="https://tools.ietf.org/html/rfc5794">RFC 5794, A Description of the ARIA Encryption Algorithm</A>,
12 * <A HREF="http://seed.kisa.or.kr/iwt/ko/bbs/EgovReferenceList.do?bbsId=BBSMSTR_000000000002">Korea
13 * Internet & Security Agency homepage</A>
14 */
15
16 #ifndef BOTAN_ARIA_H_
17 #define BOTAN_ARIA_H_
18
19 #include <botan/block_cipher.h>
20
21 BOTAN_FUTURE_INTERNAL_HEADER(aria.h)
22
23 namespace Botan {
24
25 /**
26 * ARIA-128
27 */
28 class BOTAN_PUBLIC_API(2,3) ARIA_128 final : public Block_Cipher_Fixed_Params<16, 16>
29 {
30 public:
31 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
32 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
33
34 void clear() override;
35 std::string name() const override { return "ARIA-128"; }
36 BlockCipher* clone() const override { return new ARIA_128; }
37 private:
38 void key_schedule(const uint8_t key[], size_t length) override;
39
40 // Encryption and Decryption round keys.
41 secure_vector<uint32_t> m_ERK, m_DRK;
42 };
43
44 /**
45 * ARIA-192
46 */
47 class BOTAN_PUBLIC_API(2,3) ARIA_192 final : public Block_Cipher_Fixed_Params<16, 24>
48 {
49 public:
50 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
51 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
52
53 void clear() override;
54 std::string name() const override { return "ARIA-192"; }
55 BlockCipher* clone() const override { return new ARIA_192; }
56 private:
57 void key_schedule(const uint8_t key[], size_t length) override;
58
59 // Encryption and Decryption round keys.
60 secure_vector<uint32_t> m_ERK, m_DRK;
61 };
62
63 /**
64 * ARIA-256
65 */
66 class BOTAN_PUBLIC_API(2,3) ARIA_256 final : public Block_Cipher_Fixed_Params<16, 32>
67 {
68 public:
69 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
70 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
71
72 void clear() override;
73 std::string name() const override { return "ARIA-256"; }
74 BlockCipher* clone() const override { return new ARIA_256; }
75 private:
76 void key_schedule(const uint8_t key[], size_t length) override;
77
78 // Encryption and Decryption round keys.
79 secure_vector<uint32_t> m_ERK, m_DRK;
80 };
81
82 }
83
84 #endif
Botan::ARIA_256::clone
BlockCipher * clone() const override
Definition: aria.h:74
Botan::ARIA_128::clone
BlockCipher * clone() const override
Definition: aria.h:36
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::ARIA_192::name
std::string name() const override
Definition: aria.h:54
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:65
Botan::ARIA_256
Definition: aria.h:66
Botan
Definition: alg_id.cpp:13
Botan::ARIA_192
Definition: aria.h:47
Botan::ARIA_256::name
std::string name() const override
Definition: aria.h:73
Botan::ARIA_128
Definition: aria.h:28
Botan::ARIA_192::clone
BlockCipher * clone() const override
Definition: aria.h:55
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:221
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
Botan::ARIA_128::name
std::string name() const override
Definition: aria.h:35
Botan::BlockCipher
Definition: block_cipher.h:21