lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Loading...
Searching...
No Matches
lime_x3dh_protocol.cpp File Reference

Namespaces

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

Functions

static std::string lime::x3dh_protocol::x3dh_messageTypeString (const x3dh_message_type message_type)
 Helper function to get human readable trace of x3dh messages types.
static std::vector< uint8_t > lime::x3dh_protocol::X3DH_makeHeader (const x3dh_message_type message_type, const lime::CurveId curve) noexcept
 Build X3DH message header using current protocol Version byte.
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>
template<typename Curve>
void lime::x3dh_protocol::buildMessage_deleteUser (std::vector< uint8_t > &message) noexcept
 build a deleteUser message
template<typename Curve>
void lime::x3dh_protocol::buildMessage_publishSPk (std::vector< uint8_t > &message, const SignedPreKey< Curve > &SPk) noexcept
 build a postSPk message
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
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
template<typename Curve>
void lime::x3dh_protocol::buildMessage_getSelfOPks (std::vector< uint8_t > &message) noexcept
 build a getSelfOPks message
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.
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.

Variables

constexpr uint8_t lime::x3dh_protocol::X3DH_protocolVersion = 0x01
constexpr size_t lime::x3dh_protocol::X3DH_headerSize = 3