RMW desert 5.0.0
Loading...
Searching...
No Matches
AeadParams.h
Go to the documentation of this file.
1/****************************************************************************
2 * Copyright (C) 2026 Davide Costa *
3 * *
4 * This file is part of RMW desert. *
5 * *
6 * RMW desert is free software: you can redistribute it and/or modify it *
7 * under the terms of the GNU General Public License as published by the *
8 * Free Software Foundation, either version 3 of the License, or any *
9 * later version. *
10 * *
11 * RMW desert is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with RMW desert. If not, see <http://www.gnu.org/licenses/>. *
18 ****************************************************************************/
19
32
33#ifndef SECURITY_CONFIG_H
34#define SECURITY_CONFIG_H
35
37
38#include <cstdint>
39
41
42#define AEAD_ALGO_ASCON_128 "Ascon-AEAD128"
43#define AEAD_ALGO_ASCON_128_64 "Ascon-AEAD128-64"
44#define AEAD_ALGO_ASCON_128_32 "Ascon-AEAD128-32"
45
46#define KDF_ALGO_ASCON_256 "HKDF-Ascon256"
47
48namespace security
49{
50
51enum AeadAlgorithms
52{
53 ASCON_AEAD128,
54 ASCON_AEAD128_64,
55 ASCON_AEAD128_32,
56 A128GCM,
57 AEAD_UNKNOWN
58};
59
60enum KdfAlgorithms
61{
62 HKDF_ASCON,
63 HKDF_HMAC256,
64 KDF_UNKNOWN
65};
66
68{
69 public:
75 AeadParams(AeadAlgorithms alg);
76
82 AeadAlgorithms get_alg() const { return alg_; }
83
89 uint16_t get_key_size() const { return key_size_; }
90
96 uint16_t get_nonce_size() const { return nonce_size_; }
97
103 uint16_t get_tag_size() const { return tag_size_; }
104
105 private:
106 AeadAlgorithms alg_;
107 uint16_t key_size_;
108 uint16_t nonce_size_;
109 uint16_t tag_size_;
110};
111
112} // namespace security
113
114#endif
AeadAlgorithms get_alg() const
Returns the configured AEAD algorithm.
Definition AeadParams.h:82
uint16_t get_key_size() const
Returns the size of the AEAD key.
Definition AeadParams.h:89
uint16_t get_tag_size() const
Returns the size of the AEAD authentication tag.
Definition AeadParams.h:103
uint16_t get_nonce_size() const
Returns the size of the AEAD nonce.
Definition AeadParams.h:96
AeadParams(AeadAlgorithms alg)
Creates the parameter set for an AEAD algorithm.
Definition AeadParams.cpp:8