lime
Lime is a C++ library implementing Open Whisper System Signal protocol
lime_settings.hpp
Go to the documentation of this file.
1/*
2 lime_settings.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_settings_hpp
21#define lime_settings_hpp
22
23namespace lime {
33namespace settings {
34
35/******************************************************************************/
36/* */
37/* Double Ratchet related definitions */
38/* */
39/******************************************************************************/
40
44 constexpr size_t DRSessionSharedADSize=32;
45
46 static_assert(DRSessionSharedADSize<64, "Shared AD is generated through HKDF-Sha512 with only one round implemented so its size can't be more than Sha512 max output size");
47
49 constexpr std::uint16_t maxMessageSkip=1024;
50
54 constexpr std::uint16_t maxMessagesReceivedAfterSkip = 128;
55
62 constexpr std::uint16_t maxSendingChain=1000;
63
65 constexpr unsigned int DRSession_limboTime_days=30;
66
67/******************************************************************************/
68/* */
69/* X3DH related definitions */
70/* */
71/******************************************************************************/
73 constexpr unsigned int SPK_lifeTime_days=7;
75 constexpr unsigned int SPK_limboTime_days=30;
76
77 // Note: the three following values can be overriden by call parameters when creating the user or calling update
79 constexpr uint16_t OPk_batchSize = 25;
81 constexpr uint16_t OPk_initialBatchSize = 4*OPk_batchSize;
83 constexpr uint16_t OPk_serverLowLimit = 100;
86
87} // namespace settings
88
89} // namespace lime
90
91#endif /* lime_settings_hpp */
constexpr uint16_t OPk_batchSize
default batch size when uploading OPks to X3DH server
Definition: lime_settings.hpp:79
constexpr unsigned int SPK_lifeTime_days
in days, Life time of a signed pre-key, it will be set to stale after that period
Definition: lime_settings.hpp:73
constexpr unsigned int SPK_limboTime_days
in days, How long shall we keep a signed pre-key once it has been replaced by a new one
Definition: lime_settings.hpp:75
constexpr uint16_t OPk_initialBatchSize
default batch size when creating a new user
Definition: lime_settings.hpp:81
constexpr unsigned int DRSession_limboTime_days
Definition: lime_settings.hpp:65
constexpr std::uint16_t maxMessageSkip
Definition: lime_settings.hpp:49
constexpr std::uint16_t maxMessagesReceivedAfterSkip
Definition: lime_settings.hpp:54
constexpr uint16_t OPk_serverLowLimit
default limit for keys on server to trigger generation/upload of a new batch of OPks
Definition: lime_settings.hpp:83
constexpr size_t DRSessionSharedADSize
Definition: lime_settings.hpp:44
constexpr unsigned int OPk_limboTime_days
in days, How long shall we keep an OPk in localStorage once we've noticed X3DH server dispatched it
Definition: lime_settings.hpp:85
constexpr std::uint16_t maxSendingChain
Maximum length of Sending chain.
Definition: lime_settings.hpp:62
Definition: lime.cpp:30