RMW desert 5.0.0
Loading...
Searching...
No Matches
SecurityParams.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
33#ifndef SECURITY_CONFIG_H
34#define SECURITY_CONFIG_H
35
38#include <cstdint>
39
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:
76 AeadParams(AeadAlgorithms alg);
77
83 AeadAlgorithms get_alg() const { return alg_; }
84
90 uint16_t get_key_size() const { return key_size_; }
91
97 uint16_t get_nonce_size() const { return nonce_size_; }
98
104 uint16_t get_tag_size() const { return tag_size_; }
105
106 private:
107 AeadAlgorithms alg_;
108 uint16_t key_size_;
109 uint16_t nonce_size_;
110 uint16_t tag_size_;
111};
112
113} // namespace security
114
115#endif
Definition SecurityParams.h:68
AeadAlgorithms get_alg() const
Returns the configured AEAD algorithm.
Definition SecurityParams.h:83
uint16_t get_key_size() const
Returns the size of the AEAD key.
Definition SecurityParams.h:90
uint16_t get_tag_size() const
Returns the size of the AEAD authentication tag.
Definition SecurityParams.h:104
uint16_t get_nonce_size() const
Returns the size of the AEAD nonce.
Definition SecurityParams.h:97