Loading...
Searching...
No Matches
lime_settings.hpp
Go to the documentation of this file.
/*
lime_settings.hpp
@author Johan Pascal
@copyright Copyright (C) 2017 Belledonne Communications SARL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef lime_settings_hpp
#define lime_settings_hpp
namespace lime {
namespace settings {
/******************************************************************************/
/* */
/* Double Ratchet related definitions */
/* */
/******************************************************************************/
constexpr size_t DRSessionSharedADSize=32;
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");
constexpr uint16_t maxMessageSkip=1024;
constexpr uint16_t maxMessagesReceivedAfterSkip = 128;
constexpr uint16_t maxSendingChain=1000;
constexpr unsigned int DRSession_limboTime_days=30;
/******************************************************************************/
/* */
/* X3DH related definitions */
/* */
/******************************************************************************/
constexpr unsigned int SPK_lifeTime_days=7;
constexpr unsigned int SPK_limboTime_days=30;
// Note: the three following values can be overriden by call parameters when creating the user or calling update
constexpr uint16_t OPk_batchSize = 25;
constexpr uint16_t OPk_initialBatchSize = 4*OPk_batchSize;
constexpr uint16_t OPk_serverLowLimit = 100;
constexpr unsigned int OPk_limboTime_days=SPK_lifeTime_days+SPK_limboTime_days;
constexpr unsigned int OPk_updatePeriod=86400; // 1 day
} // namespace settings
} // namespace lime
#endif /* lime_settings_hpp */
lime::settings
Hold constants definition used as settings in all components of the lime library.
Definition lime_defines.hpp:35
lime::settings::OPk_batchSize
constexpr uint16_t OPk_batchSize
default batch size when uploading OPks to X3DH server
Definition lime_settings.hpp:80
lime::settings::SPK_lifeTime_days
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
lime::settings::SPK_limboTime_days
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
lime::settings::OPk_initialBatchSize
constexpr uint16_t OPk_initialBatchSize
default batch size when creating a new user
Definition lime_settings.hpp:82
lime::settings::DRSession_limboTime_days
constexpr unsigned int DRSession_limboTime_days
Definition lime_settings.hpp:66
lime::settings::maxMessageSkip
constexpr uint16_t maxMessageSkip
Definition lime_settings.hpp:50
lime::settings::maxSendingChain
constexpr uint16_t maxSendingChain
Maximum length of Sending chain.
Definition lime_settings.hpp:63
lime::settings::OPk_updatePeriod
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
lime::settings::maxMessagesReceivedAfterSkip
constexpr uint16_t maxMessagesReceivedAfterSkip
Definition lime_settings.hpp:55
lime::settings::OPk_serverLowLimit
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
lime::settings::DRSessionSharedADSize
constexpr size_t DRSessionSharedADSize
Definition lime_settings.hpp:45
lime::settings::OPk_limboTime_days
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:86
lime
Definition lime.cpp:30