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

Go to the source code of this file.

Classes

struct  lime::X3DH_peerBundle< Curve >
 Holds everything found in a key bundle received from X3DH server. More...
 

Namespaces

 lime
 
 lime::x3dh_protocol
 Group in this namespace all the functions related to building or parsing x3dh packets.
 

Enumerations

enum  lime::X3DHKeyBundleFlag : uint8_t { lime::X3DHKeyBundleFlag::noOPk =0, lime::X3DHKeyBundleFlag::OPk =1, lime::X3DHKeyBundleFlag::noBundle =2 }
 Set possible values for a flag in the keyBundle X3DH packet. More...
 
enum  lime::x3dh_protocol::x3dh_message_type : uint8_t {
  lime::x3dh_protocol::x3dh_message_type::deprecated_registerUser =0x01, lime::x3dh_protocol::x3dh_message_type::deleteUser =0x02, lime::x3dh_protocol::x3dh_message_type::postSPk =0x03, lime::x3dh_protocol::x3dh_message_type::postOPks =0x04,
  lime::x3dh_protocol::x3dh_message_type::getPeerBundle =0x05, lime::x3dh_protocol::x3dh_message_type::peerBundle =0x06, lime::x3dh_protocol::x3dh_message_type::getSelfOPks =0x07, lime::x3dh_protocol::x3dh_message_type::selfOPks =0x08,
  lime::x3dh_protocol::x3dh_message_type::registerUser =0x09, lime::x3dh_protocol::x3dh_message_type::error =0xff
}
 the x3dh message type exchanged with the X3DH server More...
 
enum  lime::x3dh_protocol::x3dh_error_code : uint8_t {
  lime::x3dh_protocol::x3dh_error_code::bad_content_type =0x00, lime::x3dh_protocol::x3dh_error_code::bad_curve =0x01, lime::x3dh_protocol::x3dh_error_code::missing_senderId =0x02, lime::x3dh_protocol::x3dh_error_code::bad_x3dh_protocol_version =0x03,
  lime::x3dh_protocol::x3dh_error_code::bad_size =0x04, lime::x3dh_protocol::x3dh_error_code::user_already_in =0x05, lime::x3dh_protocol::x3dh_error_code::user_not_found =0x06, lime::x3dh_protocol::x3dh_error_code::db_error =0x07,
  lime::x3dh_protocol::x3dh_error_code::bad_request =0x08, lime::x3dh_protocol::x3dh_error_code::server_failure =0x09, lime::x3dh_protocol::x3dh_error_code::resource_limit_reached =0x0a, lime::x3dh_protocol::x3dh_error_code::unknown_error_code =0xfe,
  lime::x3dh_protocol::x3dh_error_code::unset_error_code =0xff
}
 the error codes included in the x3dh error message received from the X3DH server More...
 

Functions

template<typename Curve >
void lime::x3dh_protocol::buildMessage_registerUser (std::vector< uint8_t > &message, const DSA< typename Curve::EC, lime::DSAtype::publicKey > &Ik, const SignedPreKey< Curve > &SPk, const std::vector< OneTimePreKey< Curve >> &OPks) noexcept
 build a registerUser message : Identity Key<EDDSA Public Key length> More...
 
template<typename Curve >
void lime::x3dh_protocol::buildMessage_deleteUser (std::vector< uint8_t > &message) noexcept
 build a deleteUser message More...
 
template<typename Curve >
void lime::x3dh_protocol::buildMessage_publishSPk (std::vector< uint8_t > &message, const SignedPreKey< Curve > &SPk) noexcept
 build a postSPk message More...
 
template<typename Curve >
void lime::x3dh_protocol::buildMessage_publishOPks (std::vector< uint8_t > &message, const std::vector< OneTimePreKey< Curve >> &OPks) noexcept
 build a postOPks message More...
 
template<typename Curve >
void lime::x3dh_protocol::buildMessage_getPeerBundles (std::vector< uint8_t > &message, std::vector< std::string > &peer_device_ids) noexcept
 build a getPeerBundle message More...
 
template<typename Curve >
void lime::x3dh_protocol::buildMessage_getSelfOPks (std::vector< uint8_t > &message) noexcept
 build a getSelfOPks message More...
 
template<typename Curve >
bool lime::x3dh_protocol::parseMessage_getType (const std::vector< uint8_t > &body, x3dh_message_type &message_type, x3dh_error_code &error_code, const std::shared_ptr< limeCallback > callback) noexcept
 
template<typename Curve >
bool lime::x3dh_protocol::parseMessage_getPeerBundles (const std::vector< uint8_t > &body, std::vector< X3DH_peerBundle< Curve >> &peersBundle) noexcept
 Parse a peerBundles message and populate a vector of peerBundles. More...
 
template<typename Curve >
bool lime::x3dh_protocol::parseMessage_selfOPks (const std::vector< uint8_t > &body, std::vector< uint32_t > &selfOPkIds) noexcept
 Parse a selfOPk message and populate a self OPk ids. More...