Botan  2.4.0
Crypto and TLS for C++11
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 namespace Botan {
22 
23 /**
24 * ARIA-128
25 */
26 class BOTAN_PUBLIC_API(2,3) ARIA_128 final : public Block_Cipher_Fixed_Params<16, 16>
27  {
28  public:
29  void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
30  void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
31 
32  void clear() override;
33  std::string name() const override { return "ARIA-128"; }
34  BlockCipher* clone() const override { return new ARIA_128; }
35  private:
36  void key_schedule(const uint8_t key[], size_t length) override;
37 
38  // Encryption and Decryption round keys.
39  secure_vector<uint32_t> m_ERK, m_DRK;
40  };
41 
42 /**
43 * ARIA-192
44 */
45 class BOTAN_PUBLIC_API(2,3) ARIA_192 final : public Block_Cipher_Fixed_Params<16, 24>
46  {
47  public:
48  void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
49  void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
50 
51  void clear() override;
52  std::string name() const override { return "ARIA-192"; }
53  BlockCipher* clone() const override { return new ARIA_192; }
54  private:
55  void key_schedule(const uint8_t key[], size_t length) override;
56 
57  // Encryption and Decryption round keys.
58  secure_vector<uint32_t> m_ERK, m_DRK;
59  };
60 
61 /**
62 * ARIA-256
63 */
64 class BOTAN_PUBLIC_API(2,3) ARIA_256 final : public Block_Cipher_Fixed_Params<16, 32>
65  {
66  public:
67  void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
68  void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
69 
70  void clear() override;
71  std::string name() const override { return "ARIA-256"; }
72  BlockCipher* clone() const override { return new ARIA_256; }
73  private:
74  void key_schedule(const uint8_t key[], size_t length) override;
75 
76  // Encryption and Decryption round keys.
77  secure_vector<uint32_t> m_ERK, m_DRK;
78  };
79 
80 }
81 
82 #endif
BlockCipher * clone() const override
Definition: aria.h:72
BlockCipher * clone() const override
Definition: aria.h:34
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
std::string name() const override
Definition: aria.h:52
Definition: alg_id.cpp:13
std::string name() const override
Definition: aria.h:71
BlockCipher * clone() const override
Definition: aria.h:53
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88
std::string name() const override
Definition: aria.h:33