lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Loading...
Searching...
No Matches
lime::OneTimePreKey< Algo, true > Struct Template Reference

#include <lime_x3dh.hpp>

Public Types

using serializedBuffer

Public Member Functions

 OneTimePreKey (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, uint32_t Id)
 OneTimePreKey ()
 OneTimePreKey (const serializedBuffer &OPk, uint32_t Id)
 Unserializing constructor: from data read in DB.
 OneTimePreKey (const std::vector< uint8_t >::const_iterator s)
 Unserializing constructor: from data read in received bundle EC public key || KEM public key || Id.
const X< typename Algo::EC, lime::Xtype::privateKey > & cECprivateKey (void) const
 accessors
const X< typename Algo::EC, lime::Xtype::publicKey > & cECpublicKey (void) const
const K< typename Algo::KEM, lime::Ktype::privateKey > & cKEMprivateKey (void) const
const K< typename Algo::KEM, lime::Ktype::publicKey > & cKEMpublicKey (void) const
uint32_t get_Id (void) const
void set_Id (uint32_t Id)
serializedBuffer serialize (void) const
 Serialize the key pair (to store in DB): EC public || EC private || KEM public || KEM private.
std::vector< uint8_t > serializePublic (void) const
void dump (std::ostringstream &os, std::string indent=" ") const
 Dump the public key and Id.

Static Public Member Functions

static constexpr size_t serializedPublicSize (void)
static constexpr size_t serializedSize (void)

Member Typedef Documentation

◆ serializedBuffer

template<typename Algo>
using lime::OneTimePreKey< Algo, true >::serializedBuffer
Initial value:
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
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
auto clean fixed size buffer(std::array based)
Definition lime_crypto_primitives.hpp:42

Constructor & Destructor Documentation

◆ OneTimePreKey() [1/4]

template<typename Algo>
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( 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,
uint32_t Id )
inline

◆ OneTimePreKey() [2/4]

template<typename Algo>
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( )
inline

◆ OneTimePreKey() [3/4]

template<typename Algo>
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( const serializedBuffer & OPk,
uint32_t Id )
inline

Unserializing constructor: from data read in DB.

◆ OneTimePreKey() [4/4]

template<typename Algo>
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( const std::vector< uint8_t >::const_iterator s)
inline

Unserializing constructor: from data read in received bundle EC public key || KEM public key || Id.

Member Function Documentation

◆ cECprivateKey()

template<typename Algo>
const X< typename Algo::EC, lime::Xtype::privateKey > & lime::OneTimePreKey< Algo, true >::cECprivateKey ( void ) const
inline

accessors

◆ cECpublicKey()

template<typename Algo>
const X< typename Algo::EC, lime::Xtype::publicKey > & lime::OneTimePreKey< Algo, true >::cECpublicKey ( void ) const
inline

◆ cKEMprivateKey()

template<typename Algo>
const K< typename Algo::KEM, lime::Ktype::privateKey > & lime::OneTimePreKey< Algo, true >::cKEMprivateKey ( void ) const
inline

◆ cKEMpublicKey()

template<typename Algo>
const K< typename Algo::KEM, lime::Ktype::publicKey > & lime::OneTimePreKey< Algo, true >::cKEMpublicKey ( void ) const
inline

◆ dump()

template<typename Algo>
void lime::OneTimePreKey< Algo, true >::dump ( std::ostringstream & os,
std::string indent = "        " ) const
inline

Dump the public key and Id.

◆ get_Id()

template<typename Algo>
uint32_t lime::OneTimePreKey< Algo, true >::get_Id ( void ) const
inline

◆ serialize()

template<typename Algo>
serializedBuffer lime::OneTimePreKey< Algo, true >::serialize ( void ) const
inline

Serialize the key pair (to store in DB): EC public || EC private || KEM public || KEM private.

◆ serializedPublicSize()

template<typename Algo>
constexpr size_t lime::OneTimePreKey< Algo, true >::serializedPublicSize ( void )
inlinestaticconstexpr

Serializing:

  • public is EC public Key || KEM public key || Id (4bytes) -> used to publish
  • storage EC public Key || EC private Key || KEM public key || KEM private key -> used to store in DB, Id is stored separately

◆ serializedSize()

template<typename Algo>
constexpr size_t lime::OneTimePreKey< Algo, true >::serializedSize ( void )
inlinestaticconstexpr

◆ serializePublic()

template<typename Algo>
std::vector< uint8_t > lime::OneTimePreKey< Algo, true >::serializePublic ( void ) const
inline

Serialize the public key and Id to publish on the server : EC public key || KEM public key || Id

Parameters
[in]signedMessagewhen true return the only the OPk part to be signed

◆ set_Id()

template<typename Algo>
void lime::OneTimePreKey< Algo, true >::set_Id ( uint32_t Id)
inline

The documentation for this struct was generated from the following file: