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