19 #ifndef lime_double_ratchet_hpp
20 #define lime_double_ratchet_hpp
24 #include <unordered_map>
42 using SharedADBuffer = std::array<uint8_t, lime::settings::DRSessionSharedADSize>;
45 template <
typename Curve,
bool = std::is_base_of_v<genericKEM, Curve>>
49 template <
typename Curve>
56 using serializedBuffer = std::array<uint8_t, X<Curve, lime::Xtype::publicKey>::ssize()>;
75 template <
typename Algo>
87 using serializedBuffer = std::array<uint8_t,
102 ARrKey() : m_ec_DHr{}, m_kem_DHr{}, m_kem_CTr{} {};
113 std::vector<uint8_t> serializedKEM(m_kem_DHr.cbegin(), m_kem_DHr.cend());
114 serializedKEM.insert(serializedKEM.end(), m_kem_CTr.cbegin(), m_kem_CTr.cend());
124 const auto KEMIndex = getKEMIndex();
125 index.insert(index.end(), KEMIndex.cbegin(), KEMIndex.cend());
130 std::copy_n(m_ec_DHr.cbegin(), m_ec_DHr.size(), s.begin());
131 std::copy_n(m_kem_DHr.cbegin(), m_kem_DHr.size(), s.begin() + m_ec_DHr.size());
132 std::copy_n(m_kem_CTr.cbegin(), m_kem_CTr.size(), s.begin() + m_ec_DHr.size() + m_kem_DHr.size());
138 template <
typename Curve,
bool = std::is_base_of_v<genericKEM, Curve>>
142 template <
typename Curve>
181 template <
typename Algo>
199 using serializedBuffer =
sBuffer<
216 ARsKey() : m_ec_DHs{}, m_kem_DHs{}, m_kem_CTs{} {};
251 std::copy_n(m_kem_CTs.cbegin(), m_kem_CTs.size(), s.begin()+index);
258 v.insert(v.end(), m_kem_CTs.cbegin(), m_kem_CTs.cend());
269 serializedKEM.insert(serializedKEM.end(), m_kem_CTs.cbegin(), m_kem_CTs.cend());
282 template <
typename Curve>
290 ARKeys(
bool valid=
false) : m_DHr{}, m_DHr_valid{valid}, m_DHs{} {};
313 virtual void ratchetEncrypt(
const std::vector<uint8_t> &plaintext, std::vector<uint8_t> &&AD, std::vector<uint8_t> &ciphertext,
const bool payloadDirectEncryption) = 0;
314 virtual bool ratchetDecrypt(
const std::vector<uint8_t> &
cipherText,
const std::vector<uint8_t> &AD, std::vector<uint8_t> &plaintext,
const bool payloadDirectEncryption) = 0;
318 virtual bool isActive(
void)
const = 0;
319 virtual ~DR() =
default;
321 template <
typename Algo> std::shared_ptr<DR>
make_DR_from_localStorage(std::shared_ptr<lime::Db> localStorage,
long sessionId, std::shared_ptr<RNG> RNG_context);
322 template <
typename Algo> std::shared_ptr<DR>
make_DR_for_sender(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARrKey<Algo> &peerPublicKey,
long int peerDid,
const std::string &peerDeviceId,
const DSA<typename Algo::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDid,
const std::vector<uint8_t> &X3DH_initMessage, std::shared_ptr<RNG> RNG_context);
323 template <
typename Algo> std::shared_ptr<DR>
make_DR_for_receiver(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARsKey<Algo> &selfKeyPair,
long int peerDid,
const std::string &peerDeviceId,
const uint32_t OPk_id,
const DSA<typename Algo::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDeviceId, std::shared_ptr<RNG> RNG_context);
349 void encryptMessage(std::vector<RecipientInfos>& recipients,
const std::vector<uint8_t>& plaintext,
const std::vector<uint8_t>& recipientUserId,
const std::string& sourceDeviceId, std::vector<uint8_t>& cipherMessage,
const lime::EncryptionPolicy encryptionPolicy, std::shared_ptr<lime::Db> localStorage,
const std::shared_ptr<limeRandomSeedCallback> randomSeedCallback =
nullptr);
351 std::shared_ptr<DR>
decryptMessage(
const std::string& sourceDeviceId,
const std::string& recipientDeviceId,
const std::vector<uint8_t>& recipientUserId, std::vector<std::shared_ptr<DR>>& DRSessions,
const std::vector<uint8_t>& DRmessage,
const std::vector<uint8_t>& cipherMessage, std::vector<uint8_t>& plaintext);
354 #ifdef EC25519_ENABLED
355 extern template std::shared_ptr<DR> make_DR_from_localStorage<C255>(std::shared_ptr<lime::Db> localStorage,
long sessionId, std::shared_ptr<RNG> RNG_context);
356 extern template std::shared_ptr<DR>
make_DR_for_sender(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARrKey<C255> &peerPublicKey,
long int peerDid,
const std::string &peerDeviceId,
const DSA<C255::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDid,
const std::vector<uint8_t> &X3DH_initMessage, std::shared_ptr<RNG> RNG_context);
357 extern template std::shared_ptr<DR>
make_DR_for_receiver(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARsKey<C255> &selfKeyPair,
long int peerDid,
const std::string &peerDeviceId,
const uint32_t OPk_id,
const DSA<C255::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDeviceId, std::shared_ptr<RNG> RNG_context);
361 extern template std::shared_ptr<DR> make_DR_from_localStorage<C448>(std::shared_ptr<lime::Db> localStorage,
long sessionId, std::shared_ptr<RNG> RNG_context);
362 extern template std::shared_ptr<DR>
make_DR_for_sender(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARrKey<C448> &peerPublicKey,
long int peerDid,
const std::string &peerDeviceId,
const DSA<C448::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDid,
const std::vector<uint8_t> &X3DH_initMessage, std::shared_ptr<RNG> RNG_context);
363 extern template std::shared_ptr<DR>
make_DR_for_receiver(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARsKey<C448> &selfKeyPair,
long int peerDid,
const std::string &peerDeviceId,
const uint32_t OPk_id,
const DSA<C448::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDeviceId, std::shared_ptr<RNG> RNG_context);
367 #ifdef EC25519_ENABLED
368 extern template std::shared_ptr<DR> make_DR_from_localStorage<C255K512>(std::shared_ptr<lime::Db> localStorage,
long sessionId, std::shared_ptr<RNG> RNG_context);
369 extern template std::shared_ptr<DR>
make_DR_for_sender(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARrKey<C255K512> &peerPublicKey,
long int peerDid,
const std::string &peerDeviceId,
const DSA<C255K512::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDid,
const std::vector<uint8_t> &X3DH_initMessage, std::shared_ptr<RNG> RNG_context);
370 extern template std::shared_ptr<DR>
make_DR_for_receiver(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARsKey<C255K512> &selfKeyPair,
long int peerDid,
const std::string &peerDeviceId,
const uint32_t OPk_id,
const DSA<C255K512::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDeviceId, std::shared_ptr<RNG> RNG_context);
372 extern template std::shared_ptr<DR> make_DR_from_localStorage<C255MLK512>(std::shared_ptr<lime::Db> localStorage,
long sessionId, std::shared_ptr<RNG> RNG_context);
373 extern template std::shared_ptr<DR>
make_DR_for_sender(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARrKey<C255MLK512> &peerPublicKey,
long int peerDid,
const std::string &peerDeviceId,
const DSA<C255MLK512::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDid,
const std::vector<uint8_t> &X3DH_initMessage, std::shared_ptr<RNG> RNG_context);
374 extern template std::shared_ptr<DR>
make_DR_for_receiver(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARsKey<C255MLK512> &selfKeyPair,
long int peerDid,
const std::string &peerDeviceId,
const uint32_t OPk_id,
const DSA<C255MLK512::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDeviceId, std::shared_ptr<RNG> RNG_context);
377 extern template std::shared_ptr<DR> make_DR_from_localStorage<C448MLK1024>(std::shared_ptr<lime::Db> localStorage,
long sessionId, std::shared_ptr<RNG> RNG_context);
378 extern template std::shared_ptr<DR>
make_DR_for_sender(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARrKey<C448MLK1024> &peerPublicKey,
long int peerDid,
const std::string &peerDeviceId,
const DSA<C448MLK1024::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDid,
const std::vector<uint8_t> &X3DH_initMessage, std::shared_ptr<RNG> RNG_context);
379 extern template std::shared_ptr<DR>
make_DR_for_receiver(std::shared_ptr<lime::Db> localStorage,
const DRChainKey &SK,
const SharedADBuffer &AD,
const ARsKey<C448MLK1024> &selfKeyPair,
long int peerDid,
const std::string &peerDeviceId,
const uint32_t OPk_id,
const DSA<C448MLK1024::EC, lime::DSAtype::publicKey> &peerIk,
long int selfDeviceId, std::shared_ptr<RNG> RNG_context);
381 #endif // HAVE_BCTBXPQ
static constexpr size_t serializedSize(void)
Definition: lime_double_ratchet.hpp:82
static constexpr size_t ssize(void)
provide a static size function to be able to call the function not on an object
Definition: lime_crypto_primitives.hpp:105
void encryptMessage(std::vector< RecipientInfos > &recipients, const std::vector< uint8_t > &plaintext, const std::vector< uint8_t > &recipientUserId, const std::string &sourceDeviceId, std::vector< uint8_t > &cipherMessage, const lime::EncryptionPolicy encryptionPolicy, std::shared_ptr< lime::Db > localStorage, const std::shared_ptr< limeRandomSeedCallback > randomSeedCallback)
Encrypt a message to all recipients, identified by their device id.
Definition: lime_double_ratchet.cpp:1589
static constexpr size_t serializedSize(void)
Definition: lime_double_ratchet.hpp:189
static constexpr size_t ssize(void)
provide a static size function to be able to call the function not on an object
Definition: lime_crypto_primitives.hpp:59
ARsKey()
Definition: lime_double_ratchet.hpp:160
std::array< uint8_t, X< Curve, lime::Xtype::publicKey >::ssize()> serializedPublicBuffer
Definition: lime_double_ratchet.hpp:150
static constexpr size_t serializedPublicSize(void)
Definition: lime_double_ratchet.hpp:148
const X< typename Algo::EC, lime::Xtype::publicKey > & ECPublicKey(void) const
Definition: lime_double_ratchet.hpp:236
A virtual class to define the Double Ratchet interface.
Definition: lime_double_ratchet.hpp:311
const K< typename Algo::KEM, lime::Ktype::publicKey > & KEMPublicKey(void) const
Definition: lime_double_ratchet.hpp:238
X< Curve, lime::Xtype::privateKey > & privateKey(void)
access the private key
Definition: lime_crypto_primitives.hpp:80
ARrKey(const serializedBuffer &DHr)
Definition: lime_double_ratchet.hpp:60
ARrKey(const X< typename Algo::EC, lime::Xtype::publicKey > &ecDHr, K< typename Algo::KEM, lime::Ktype::publicKey > &kemDHr)
Definition: lime_double_ratchet.hpp:94
const ARsKey< Curve >::serializedBuffer serializeDHs(void)
Definition: lime_double_ratchet.hpp:304
Definition: lime_double_ratchet.hpp:46
static constexpr size_t serializedSize(void)
Definition: lime_double_ratchet.hpp:147
ARrKey()
Definition: lime_double_ratchet.hpp:61
std::shared_ptr< DR > DRSession
Definition: lime_double_ratchet.hpp:330
Base buffer definition for KEM data structure.
Definition: lime_crypto_primitives.hpp:102
ARsKey()
Definition: lime_double_ratchet.hpp:216
const K< typename Algo::KEM, lime::Ktype::publicKey > & KEMPublicKey(void) const
Definition: lime_double_ratchet.hpp:106
ARsKey(const SignedPreKey< Algo > &SPk)
Definition: lime_double_ratchet.hpp:211
const ARsKey< Curve > & cgetDHs(void) const
Definition: lime_double_ratchet.hpp:303
ARKeys(const ARrKey< Curve > &DHr)
Definition: lime_double_ratchet.hpp:289
X< Curve, lime::Xtype::privateKey > & privateKey(void)
Definition: lime_double_ratchet.hpp:167
void setValid(bool valid)
Definition: lime_double_ratchet.hpp:293
ARsKey(const serializedBuffer &DHs)
Definition: lime_double_ratchet.hpp:218
static constexpr size_t serializedSize(void)
Definition: lime_double_ratchet.hpp:55
const ARrKey< Curve > & cgetDHr(void) const
Definition: lime_double_ratchet.hpp:298
ARrKey(const SignedPreKey< Curve > &SPk)
Definition: lime_double_ratchet.hpp:58
std::shared_ptr< DR > make_DR_for_receiver(std::shared_ptr< lime::Db > localStorage, const DRChainKey &SK, const SharedADBuffer &AD, const ARsKey< Algo > &selfKeyPair, long int peerDid, const std::string &peerDeviceId, const uint32_t OPk_id, const DSA< typename Algo::EC, lime::DSAtype::publicKey > &peerIk, long int selfDeviceId, std::shared_ptr< RNG > RNG_context)
Definition: lime_double_ratchet.cpp:1532
Base buffer definition for DSA data structure.
Definition: lime_crypto_primitives.hpp:148
Key pair structure for key exchange algorithm.
Definition: lime_crypto_primitives.hpp:74
ARrKey(const SignedPreKey< Algo > &SPk)
Definition: lime_double_ratchet.hpp:95
X< typename Algo::EC, lime::Xtype::privateKey > & ECPrivateKey(void)
Definition: lime_double_ratchet.hpp:235
std::vector< uint8_t > serializePublic(void) const
Serialize the public part only to insert in the DR message header.
Definition: lime_double_ratchet.hpp:177
const X< Curve, lime::Xtype::publicKey > & cpublicKey(void) const
Definition: lime_crypto_primitives.hpp:84
ARsKey(const X< Curve, lime::Xtype::publicKey > &DHsPublic, const X< Curve, lime::Xtype::privateKey > &DHsPrivate)
Definition: lime_double_ratchet.hpp:156
structure to hold the keys used in asymmetric ratchet For EC only DR, it holds
Definition: lime_double_ratchet.hpp:283
virtual void ratchetEncrypt(const std::vector< uint8_t > &plaintext, std::vector< uint8_t > &&AD, std::vector< uint8_t > &ciphertext, const bool payloadDirectEncryption)=0
serializedBuffer serialize(void) const
Definition: lime_double_ratchet.hpp:128
std::array< uint8_t, lime::settings::DRSessionSharedADSize > SharedADBuffer
Definition: lime_double_ratchet.hpp:42
ARsKey< Curve > & getDHs(void)
Definition: lime_double_ratchet.hpp:302
ARKeys(bool valid=false)
Definition: lime_double_ratchet.hpp:290
const X< typename Algo::EC, lime::Xtype::publicKey > & ECPublicKey(void) const
Definition: lime_double_ratchet.hpp:105
const K< Algo, lime::Ktype::privateKey > & cprivateKey(void) const
Definition: lime_crypto_primitives.hpp:127
serializedBuffer serialize(void) const
Serialize the key pair (to store in DB): First the public value, then the private one...
Definition: lime_double_ratchet.hpp:170
void setDHr(const ARrKey< Curve > &DHr)
Definition: lime_double_ratchet.hpp:296
K< Algo, lime::Ktype::privateKey > & privateKey(void)
access the private key
Definition: lime_crypto_primitives.hpp:126
std::vector< uint8_t > serializeECPublic(void) const
Serialize the EC public part only to insert in the DR message header when we avoid sending the KEM pa...
Definition: lime_double_ratchet.hpp:262
RecipientInfos(const std::string &deviceId, std::shared_ptr< DR > session)
Definition: lime_double_ratchet.hpp:339
const std::vector< uint8_t > serializePublicDHs(void) const
Definition: lime_double_ratchet.hpp:305
K< Algo, lime::Ktype::publicKey > & publicKey(void)
access the public key
Definition: lime_crypto_primitives.hpp:129
ARsKey(const SignedPreKey< Curve > &SPk)
Definition: lime_double_ratchet.hpp:152
std::vector< uint8_t > serializePublic(void) const
Serialize the public part only to insert in the DR message header: EC public || KEM public || KEM cip...
Definition: lime_double_ratchet.hpp:255
const K< Algo, lime::Ktype::publicKey > & cpublicKey(void) const
Definition: lime_crypto_primitives.hpp:130
ARrKey< Curve > & getDHr(void)
Definition: lime_double_ratchet.hpp:297
std::vector< uint8_t > getIndex(void) const
Index is a hash of public key to identify it without sending/storing it all.
Definition: lime_double_ratchet.hpp:65
std::array< uint8_t, X< Algo, lime::Xtype::publicKey >::ssize()+K< Algo, lime::Ktype::publicKey >::ssize()+K< Algo, lime::Ktype::cipherText >::ssize()> serializedPublicBuffer
Definition: lime_double_ratchet.hpp:207
serializedBuffer serialize(void) const
Serialize the key pair (to store in DB): First the public value, then the private one...
Definition: lime_double_ratchet.hpp:241
const ARrKey< Curve >::serializedBuffer serializeDHr(void)
Definition: lime_double_ratchet.hpp:299
ARsKey(const X< typename Algo::EC, lime::Xtype::publicKey > &ECPublic, const X< typename Algo::EC, lime::Xtype::privateKey > &ECPrivate, const K< typename Algo::KEM, lime::Ktype::publicKey > &KEMPublic, const K< typename Algo::KEM, lime::Ktype::privateKey > &KEMPrivate, const K< typename Algo::KEM, lime::Ktype::cipherText > &KEMCT)
Definition: lime_double_ratchet.hpp:213
std::shared_ptr< DR > make_DR_from_localStorage(std::shared_ptr< lime::Db > localStorage, long sessionId, std::shared_ptr< RNG > RNG_context)
Definition: lime_double_ratchet.cpp:1526
const K< typename Algo::KEM, lime::Ktype::cipherText > & KEMCipherText(void) const
Definition: lime_double_ratchet.hpp:107
ARrKey()
Definition: lime_double_ratchet.hpp:102
ARrKey(const X< typename Algo::EC, lime::Xtype::publicKey > &ecDHr, K< typename Algo::KEM, lime::Ktype::publicKey > &kemDHr, K< typename Algo::KEM, lime::Ktype::cipherText > &kemCTr)
Definition: lime_double_ratchet.hpp:92
std::shared_ptr< DR > decryptMessage(const std::string &sourceDeviceId, const std::string &recipientDeviceId, const std::vector< uint8_t > &recipientUserId, std::vector< std::shared_ptr< DR >> &DRSessions, const std::vector< uint8_t > &DRmessage, const std::vector< uint8_t > &cipherMessage, std::vector< uint8_t > &plaintext)
Decrypt a message.
Definition: lime_double_ratchet.cpp:1737
std::vector< uint8_t > getKEMIndex(void) const
Definition: lime_double_ratchet.hpp:111
Definition: lime_double_ratchet.hpp:139
Key pair structure for key exchange algorithm.
Definition: lime_crypto_primitives.hpp:120
void HMAC< SHA512 >(const uint8_t *const key, const size_t keySize, const uint8_t *const input, const size_t inputSize, uint8_t *hash, size_t hashSize)
Definition: lime_crypto_primitives.cpp:447
ARsKey(const Xpair< typename Algo::EC > &ecDHs, const Kpair< typename Algo::KEM > &kemDHs, const K< typename Algo::KEM, lime::Ktype::cipherText > &kemCTs)
Definition: lime_double_ratchet.hpp:210
std::vector< uint8_t > getIndex(void) const
Definition: lime_double_ratchet.hpp:120
void setECPk(const X< typename Algo::EC, lime::Xtype::publicKey > ec_Pk)
Definition: lime_double_ratchet.hpp:109
ARsKey(const Xpair< typename Algo::EC > &ecDHs, const Kpair< typename Algo::KEM > &kemDHs)
Definition: lime_double_ratchet.hpp:212
std::array< uint8_t, X< Algo, lime::Xtype::publicKey >::ssize()+K< Algo, lime::Ktype::publicKey >::ssize()+K< Algo, lime::Ktype::cipherText >::ssize()> serializedBuffer
Definition: lime_double_ratchet.hpp:90
const X< Curve, lime::Xtype::publicKey > & publicKey(void) const
Definition: lime_double_ratchet.hpp:63
ARKeys(const ARsKey< Curve > &DHs)
Definition: lime_double_ratchet.hpp:291
void setDHs(const ARsKey< Curve > &DHs)
Definition: lime_double_ratchet.hpp:301
ARsKey(const serializedBuffer &DHs)
Definition: lime_double_ratchet.hpp:162
X< Curve, lime::Xtype::publicKey > & publicKey(void)
access the public key
Definition: lime_crypto_primitives.hpp:83
bool getValid(void) const
Definition: lime_double_ratchet.hpp:294
virtual bool ratchetDecrypt(const std::vector< uint8_t > &cipherText, const std::vector< uint8_t > &AD, std::vector< uint8_t > &plaintext, const bool payloadDirectEncryption)=0
RecipientInfos(const std::string &deviceId)
Definition: lime_double_ratchet.hpp:345
std::shared_ptr< DR > make_DR_for_sender(std::shared_ptr< lime::Db > localStorage, const DRChainKey &SK, const SharedADBuffer &AD, const ARrKey< Algo > &peerPublicKey, long int peerDid, const std::string &peerDeviceId, const DSA< typename Algo::EC, lime::DSAtype::publicKey > &peerIk, long int selfDid, const std::vector< uint8_t > &X3DH_initMessage, std::shared_ptr< RNG > RNG_context)
Definition: lime_double_ratchet.cpp:1529
serializedBuffer serialize(void) const
Definition: lime_double_ratchet.hpp:70
extend the RecipientData to add a Double Ratchet session shared with the recipient ...
Definition: lime_double_ratchet.hpp:329
The encrypt function input/output data structure.
Definition: lime.hpp:73
X< Curve, lime::Xtype::publicKey > & publicKey(void)
Definition: lime_double_ratchet.hpp:168
std::vector< uint8_t > getKEMIndex(void) const
Index is a hash of KEM public key/Cipher Text to identify it without sending/storing it all...
Definition: lime_double_ratchet.hpp:266
static constexpr size_t serializedPublicSize(void)
Definition: lime_double_ratchet.hpp:194
void setEC(const X< typename Algo::EC, lime::Xtype::publicKey > &ECPublic, const X< typename Algo::EC, lime::Xtype::privateKey > &ECPrivate)
Set Ec key pair only: used to update this part without touching the KEM one.
Definition: lime_double_ratchet.hpp:231
virtual bool isActive(void) const =0
return the current status of session
K< typename Algo::KEM, lime::Ktype::privateKey > & KEMPrivateKey(void)
Definition: lime_double_ratchet.hpp:237
EncryptionPolicy
Definition: lime.hpp:47
constexpr size_t DRPkIndexSize
Definition: lime_defines.hpp:81
ARrKey(const serializedBuffer &DHr)
Definition: lime_double_ratchet.hpp:97
const X< Curve, lime::Xtype::privateKey > & cprivateKey(void) const
Definition: lime_crypto_primitives.hpp:81
lime::sBuffer< lime::settings::DRChainKeySize > DRChainKey
Definition: lime_double_ratchet.hpp:39
const std::string deviceId
Definition: lime.hpp:74
K< typename Algo::KEM, lime::Ktype::cipherText > & KEMCipherText(void)
Definition: lime_double_ratchet.hpp:239
std::array< uint8_t, X< Curve, lime::Xtype::publicKey >::ssize()> serializedBuffer
Definition: lime_double_ratchet.hpp:56
virtual long int dbSessionId(void) const =0
return the session's local storage id