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 
23 
24 namespace lime {
34 namespace settings {
35 
36 /******************************************************************************/
37 /* */
38 /* Double Ratchet related definitions */
39 /* */
40 /******************************************************************************/
41 
45  constexpr size_t DRSessionSharedADSize=32;
46 
47  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");
48 
50  constexpr uint16_t maxMessageSkip=512;
51 
55  constexpr uint16_t maxMessagesReceivedAfterSkip = 64;
56 
63  constexpr uint16_t maxSendingChain=500;
64 
70  constexpr uint16_t KEMRatchetChainSize=42;
71  constexpr unsigned int maxKEMRatchetChainPeriod=86400; // 1 day
72 
74  constexpr unsigned int DRSession_limboTime_days=30;
75 
76 /******************************************************************************/
77 /* */
78 /* X3DH related definitions */
79 /* */
80 /******************************************************************************/
82  constexpr unsigned int SPK_lifeTime_days=7;
84  constexpr unsigned int SPK_limboTime_days=30;
85 
86  // Note: the three following values can be overriden by call parameters when creating the user or calling update
88  constexpr uint16_t OPk_batchSize = 25;
90  constexpr uint16_t OPk_initialBatchSize = 4*OPk_batchSize;
92  constexpr uint16_t OPk_serverLowLimit = 100;
94  constexpr unsigned int OPk_limboTime_days=SPK_lifeTime_days+SPK_limboTime_days;
96  constexpr unsigned int OPk_updatePeriod=86400; // 1 day
97 
98 } // namespace settings
99 
100 } // namespace lime
101 
102 #endif /* lime_settings_hpp */
constexpr uint16_t OPk_initialBatchSize
default batch size when creating a new user
Definition: lime_settings.hpp:90
constexpr size_t DRSessionSharedADSize
Definition: lime_settings.hpp:45
constexpr uint16_t maxSendingChain
Maximum length of Sending chain.
Definition: lime_settings.hpp:63
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:84
constexpr uint16_t KEMRatchetChainSize
KEM ratchet chain settings :
Definition: lime_settings.hpp:70
constexpr unsigned int DRSession_limboTime_days
Definition: lime_settings.hpp:74
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:82
constexpr uint16_t maxMessageSkip
Definition: lime_settings.hpp:50
constexpr uint16_t maxMessagesReceivedAfterSkip
Definition: lime_settings.hpp:55
constexpr unsigned int maxKEMRatchetChainPeriod
Definition: lime_settings.hpp:71
constexpr uint16_t OPk_batchSize
default batch size when uploading OPks to X3DH server
Definition: lime_settings.hpp:88
Definition: lime.cpp:33
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:94
constexpr unsigned int OPk_updatePeriod
in seconds, how often should we perform an update (check if we should publish new OPk...
Definition: lime_settings.hpp:96
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:92