Botan 3.0.0
Crypto and TLS for C&
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
21namespace Botan {
22
23/**
24* ARIA-128
25*/
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 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<ARIA_128>(); }
35
36 bool has_keying_material() const override;
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*/
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 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<ARIA_192>(); }
56
57 bool has_keying_material() const override;
58 private:
59 void key_schedule(const uint8_t key[], size_t length) override;
60
61 // Encryption and Decryption round keys.
62 secure_vector<uint32_t> m_ERK, m_DRK;
63 };
64
65/**
66* ARIA-256
67*/
69 {
70 public:
71 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
72 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
73
74 void clear() override;
75 std::string name() const override { return "ARIA-256"; }
76 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<ARIA_256>(); }
77
78 bool has_keying_material() const override;
79 private:
80 void key_schedule(const uint8_t key[], size_t length) override;
81
82 // Encryption and Decryption round keys.
83 secure_vector<uint32_t> m_ERK, m_DRK;
84 };
85
86}
87
88#endif
std::unique_ptr< BlockCipher > new_object() const override
Definition: aria.h:34
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition: aria.cpp:412
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition: aria.cpp:430
std::string name() const override
Definition: aria.h:33
void clear() override
Definition: aria.cpp:467
bool has_keying_material() const override
Definition: aria.cpp:448
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition: aria.cpp:418
void clear() override
Definition: aria.cpp:473
std::unique_ptr< BlockCipher > new_object() const override
Definition: aria.h:55
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition: aria.cpp:436
std::string name() const override
Definition: aria.h:54
bool has_keying_material() const override
Definition: aria.cpp:449
void clear() override
Definition: aria.cpp:479
std::unique_ptr< BlockCipher > new_object() const override
Definition: aria.h:76
bool has_keying_material() const override
Definition: aria.cpp:450
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition: aria.cpp:424
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition: aria.cpp:442
std::string name() const override
Definition: aria.h:75
int(* final)(unsigned char *, CTX *)
Definition: alg_id.cpp:12
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:64