lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Classes | Namespaces | Enumerations | Functions | Variables
lime_double_ratchet_protocol.hpp File Reference

Go to the source code of this file.

Classes

class  lime::double_ratchet_protocol::DRHeader< Curve >
 helper class and functions to parse Double Ratchet message header and access its components More...
 

Namespaces

 lime
 
 lime::double_ratchet_protocol
 Group in this namespace all the functions related to building or parsing double ratchet packets.
 

Enumerations

enum  lime::double_ratchet_protocol::DR_message_type : uint8_t { lime::double_ratchet_protocol::DR_message_type::X3DH_init_flag =0x01, lime::double_ratchet_protocol::DR_message_type::payload_direct_encryption_flag =0x02 }
 DR message type byte bit mapping. More...
 
enum  lime::double_ratchet_protocol::DR_X3DH_OPk_flag : uint8_t { lime::double_ratchet_protocol::DR_X3DH_OPk_flag::withoutOPk =0x00, lime::double_ratchet_protocol::DR_X3DH_OPk_flag::withOPk =0x01 }
 haveOPk byte from X3DH init message mapping More...
 

Functions

template<typename Curve >
constexpr size_t lime::double_ratchet_protocol::headerSize () noexcept
 return the size of the double ratchet packet header More...
 
template<typename Curve >
constexpr size_t lime::double_ratchet_protocol::X3DHinitSize (bool haveOPk) noexcept
 return the size of the X3DH init packet included in the double ratchet packet header More...
 
template<typename Curve >
void lime::double_ratchet_protocol::buildMessage_X3DHinit (std::vector< uint8_t > &message, const DSA< Curve, lime::DSAtype::publicKey > &Ik, const X< Curve, lime::Xtype::publicKey > &Ek, const uint32_t SPk_id, const uint32_t OPk_id, const bool OPk_flag) noexcept
 build an X3DH init message to insert in DR header More...
 
template<typename Curve >
void lime::double_ratchet_protocol::parseMessage_X3DHinit (const std::vector< uint8_t >message, DSA< Curve, lime::DSAtype::publicKey > &Ik, X< Curve, lime::Xtype::publicKey > &Ek, uint32_t &SPk_id, uint32_t &OPk_id, bool &OPk_flag) noexcept
 Parse the X3DH init message and extract peer Ik, peer Ek, self SPk id and seld OPk id if present. More...
 
template<typename Curve >
bool lime::double_ratchet_protocol::parseMessage_get_X3DHinit (const std::vector< uint8_t > &message, std::vector< uint8_t > &X3DH_initMessage) noexcept
 check the message for presence of X3DH init in the header, extract it if there is one More...
 
template<typename Curve >
void lime::double_ratchet_protocol::buildMessage_header (std::vector< uint8_t > &header, const uint16_t Ns, const uint16_t PN, const X< Curve, lime::Xtype::publicKey > &DHs, const std::vector< uint8_t > X3DH_initMessage, const bool payloadDirectEncryption) noexcept
 Build a header string from needed info. More...
 

Variables

constexpr std::uint8_t lime::double_ratchet_protocol::DR_v01 =0x01