Botan 3.6.1
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 public:
28 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
29 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
30
31 void clear() override;
32
33 std::string name() const override { return "ARIA-128"; }
34
35 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<ARIA_128>(); }
36
37 bool has_keying_material() const override;
38
39 private:
40 void key_schedule(std::span<const uint8_t> key) override;
41
42 // Encryption and Decryption round keys.
43 secure_vector<uint32_t> m_ERK, m_DRK;
44};
45
46/**
47* ARIA-192
48*/
50 public:
51 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
52 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
53
54 void clear() override;
55
56 std::string name() const override { return "ARIA-192"; }
57
58 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<ARIA_192>(); }
59
60 bool has_keying_material() const override;
61
62 private:
63 void key_schedule(std::span<const uint8_t> key) override;
64
65 // Encryption and Decryption round keys.
66 secure_vector<uint32_t> m_ERK, m_DRK;
67};
68
69/**
70* ARIA-256
71*/
73 public:
74 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
75 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
76
77 void clear() override;
78
79 std::string name() const override { return "ARIA-256"; }
80
81 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<ARIA_256>(); }
82
83 bool has_keying_material() const override;
84
85 private:
86 void key_schedule(std::span<const uint8_t> key) override;
87
88 // Encryption and Decryption round keys.
89 secure_vector<uint32_t> m_ERK, m_DRK;
90};
91
92} // namespace Botan
93
94#endif
std::unique_ptr< BlockCipher > new_object() const override
Definition aria.h:35
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition aria.cpp:363
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition aria.cpp:378
std::string name() const override
Definition aria.h:33
void clear() override
Definition aria.cpp:417
bool has_keying_material() const override
Definition aria.cpp:393
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition aria.cpp:368
void clear() override
Definition aria.cpp:422
std::unique_ptr< BlockCipher > new_object() const override
Definition aria.h:58
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition aria.cpp:383
std::string name() const override
Definition aria.h:56
bool has_keying_material() const override
Definition aria.cpp:397
void clear() override
Definition aria.cpp:427
std::unique_ptr< BlockCipher > new_object() const override
Definition aria.h:81
bool has_keying_material() const override
Definition aria.cpp:401
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition aria.cpp:373
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition aria.cpp:388
std::string name() const override
Definition aria.h:79
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61