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=1024;
51 
55  constexpr uint16_t maxMessagesReceivedAfterSkip = 128;
56 
63  constexpr uint16_t maxSendingChain=1000;
64 
66  constexpr unsigned int DRSession_limboTime_days=30;
67 
68 /******************************************************************************/
69 /* */
70 /* X3DH related definitions */
71 /* */
72 /******************************************************************************/
74  constexpr unsigned int SPK_lifeTime_days=7;
76  constexpr unsigned int SPK_limboTime_days=30;
77 
78  // Note: the three following values can be overriden by call parameters when creating the user or calling update
80  constexpr uint16_t OPk_batchSize = 25;
82  constexpr uint16_t OPk_initialBatchSize = 4*OPk_batchSize;
84  constexpr uint16_t OPk_serverLowLimit = 100;
86  constexpr unsigned int OPk_limboTime_days=SPK_lifeTime_days+SPK_limboTime_days;
88  constexpr unsigned int OPk_updatePeriod=86400; // 1 day
89 
90 } // namespace settings
91 
92 } // namespace lime
93 
94 #endif /* lime_settings_hpp */
constexpr uint16_t OPk_initialBatchSize
default batch size when creating a new user
Definition: lime_settings.hpp:82
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:76
constexpr unsigned int DRSession_limboTime_days
Definition: lime_settings.hpp:66
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:74
constexpr uint16_t maxMessageSkip
Definition: lime_settings.hpp:50
constexpr uint16_t maxMessagesReceivedAfterSkip
Definition: lime_settings.hpp:55
constexpr uint16_t OPk_batchSize
default batch size when uploading OPks to X3DH server
Definition: lime_settings.hpp:80
Definition: lime.cpp:30
constexpr unsigned int OPk_limboTime_days
in days, How long shall we keep an OPk in localStorage once we&#39;ve noticed X3DH server dispatched it ...
Definition: lime_settings.hpp:86
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:88
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:84