lime
Lime is a C++ library implementing Open Whisper System Signal protocol
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
23namespace lime {
33namespace settings {
34
35/******************************************************************************/
36/* */
37/* Double Ratchet related definitions */
38/* */
39/******************************************************************************/
40
42 constexpr size_t DRChainKeySize=32;
44 const std::string hkdf_DRChainKey_info{"DR Root Chain Key Derivation"};
45
47 constexpr size_t DRMessageKeySize=32;
49 constexpr size_t DRMessageIVSize=16;
50
56 constexpr size_t DRrandomSeedSize=32;
62 const std::string hkdf_randomSeed_info{"DR Message Key Derivation"};
63
65 constexpr size_t DRMessageAuthTagSize=16;
66
67/******************************************************************************/
68/* */
69/* Local Storage related definitions */
70/* */
71/******************************************************************************/
76 constexpr int DBuserVersion=0x000001;
77 constexpr uint16_t DBInactiveUserBit = 0x0100;
78 constexpr uint16_t DBCurveIdByte = 0x00FF;
79 constexpr uint8_t DBInvalidIk = 0x00;
80
81/******************************************************************************/
82/* */
83/* X3DH related definitions */
84/* */
85/******************************************************************************/
87 const std::string X3DH_SK_info{"Lime"};
89 const std::string X3DH_AD_info{"X3DH Associated Data"};
90} // namespace settings
91
92} // namespace lime
93
94#endif /* lime_defines_hpp */
constexpr size_t DRMessageAuthTagSize
AEAD generates tag 16 bytes long.
Definition: lime_defines.hpp:65
constexpr size_t DRrandomSeedSize
Definition: lime_defines.hpp:56
constexpr size_t DRMessageKeySize
DR Message Key are composed of a 32 bytes key and 16 bytes of IV.
Definition: lime_defines.hpp:47
const std::string hkdf_DRChainKey_info
String used as info in the root key derivation.
Definition: lime_defines.hpp:44
const std::string X3DH_AD_info
used to generate a shared AD based on Ik and deviceID
Definition: lime_defines.hpp:89
constexpr uint16_t DBInactiveUserBit
Definition: lime_defines.hpp:77
constexpr uint16_t DBCurveIdByte
Definition: lime_defines.hpp:78
const std::string X3DH_SK_info
shall be an ASCII string identifying the application (X3DH spec section 2.1)
Definition: lime_defines.hpp:87
const std::string hkdf_randomSeed_info
Definition: lime_defines.hpp:62
constexpr size_t DRMessageIVSize
DR Message Key are composed of a 32 bytes key and 16 bytes of IV.
Definition: lime_defines.hpp:49
constexpr int DBuserVersion
Definition: lime_defines.hpp:76
constexpr uint8_t DBInvalidIk
Definition: lime_defines.hpp:79
constexpr size_t DRChainKeySize
Sending, Receiving and Root key chain use 32 bytes keys (spec 3.2)
Definition: lime_defines.hpp:42
Definition: lime.cpp:30