lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Loading...
Searching...
No Matches
lime_defines.hpp
Go to the documentation of this file.
1/*
2 lime_defines.hpp
3 @author Johan Pascal
4 @copyright Copyright (C) 2017 Belledonne Communications SARL
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef lime_defines_hpp
21#define lime_defines_hpp
22
23#include <string>
24#include <functional>
25#include <vector>
26#include <memory>
27
28namespace lime {
37using limeRandomSeedCallback = std::function<bool(const bool get, std::shared_ptr<std::vector<uint8_t>> &randomSeed)>;
38
48namespace settings {
49
50/******************************************************************************/
51/* */
52/* Double Ratchet related definitions */
53/* */
54/******************************************************************************/
55
57 constexpr size_t DRChainKeySize=32;
59 const std::string hkdf_DRChainKey_info{"DR Root Chain Key Derivation"};
60
62 constexpr size_t DRMessageKeySize=32;
64 constexpr size_t DRMessageIVSize=16;
65
71 constexpr size_t DRrandomSeedSize=32;
77 const std::string hkdf_randomSeed_info{"DR Message Key Derivation"};
78
81 constexpr size_t DRPkIndexSize=12;
82
84 constexpr size_t DRMessageAuthTagSize=16;
85
86/******************************************************************************/
87/* */
88/* Local Storage related definitions */
89/* */
90/******************************************************************************/
95 constexpr int DBuserVersion=0x000300;
96 constexpr uint16_t DBInactiveUserBit = 0x0100;
97 constexpr uint16_t DBCurveIdByte = 0x00FF;
98 constexpr uint8_t DBInvalidIk = 0x00;
99
100/******************************************************************************/
101/* */
102/* X3DH related definitions */
103/* */
104/******************************************************************************/
106 const std::string X3DH_SK_info{"Lime"};
108 const std::string X3DH_AD_info{"X3DH Associated Data"};
109} // namespace settings
110
111} // namespace lime
112
113#endif /* lime_defines_hpp */
Hold constants definition used as settings in all components of the lime library.
Definition lime_defines.hpp:48
constexpr size_t DRMessageAuthTagSize
AEAD generates tag 16 bytes long.
Definition lime_defines.hpp:84
constexpr size_t DRrandomSeedSize
Definition lime_defines.hpp:71
constexpr size_t DRMessageKeySize
DR Message Key are composed of a 32 bytes key and 16 bytes of IV.
Definition lime_defines.hpp:62
const std::string hkdf_DRChainKey_info
String used as info in the root key derivation.
Definition lime_defines.hpp:59
const std::string X3DH_AD_info
used to generate a shared AD based on Ik and deviceID
Definition lime_defines.hpp:108
constexpr uint16_t DBInactiveUserBit
Definition lime_defines.hpp:96
constexpr uint16_t DBCurveIdByte
Definition lime_defines.hpp:97
const std::string X3DH_SK_info
shall be an ASCII string identifying the application (X3DH spec section 2.1)
Definition lime_defines.hpp:106
const std::string hkdf_randomSeed_info
Definition lime_defines.hpp:77
constexpr size_t DRMessageIVSize
DR Message Key are composed of a 32 bytes key and 16 bytes of IV.
Definition lime_defines.hpp:64
constexpr int DBuserVersion
Definition lime_defines.hpp:95
constexpr uint8_t DBInvalidIk
Definition lime_defines.hpp:98
constexpr size_t DRChainKeySize
Sending, Receiving and Root key chain use 32 bytes keys (spec 3.2).
Definition lime_defines.hpp:57
constexpr size_t DRPkIndexSize
Definition lime_defines.hpp:81
Definition lime.cpp:33
std::function< bool(const bool get, std::shared_ptr< std::vector< uint8_t > > &randomSeed)> limeRandomSeedCallback
define a callback function type used to get or set the random seed when performing multiple encryptio...
Definition lime_defines.hpp:37