lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lime::ARsKey< Algo, true > Struct Template Reference

Public Types

using serializedBuffer = sBuffer< X< Algo, lime::Xtype::publicKey >::ssize()+X< Algo, lime::Xtype::privateKey >::ssize()+K< Algo, lime::Ktype::publicKey >::ssize()+K< Algo, lime::Ktype::privateKey >::ssize()+K< Algo, lime::Ktype::cipherText >::ssize()>
 
using serializedPublicBuffer = std::array< uint8_t, X< Algo, lime::Xtype::publicKey >::ssize()+K< Algo, lime::Ktype::publicKey >::ssize()+K< Algo, lime::Ktype::cipherText >::ssize()>
 

Public Member Functions

 ARsKey (const Xpair< typename Algo::EC > &ecDHs, const Kpair< typename Algo::KEM > &kemDHs, const K< typename Algo::KEM, lime::Ktype::cipherText > &kemCTs)
 
 ARsKey (const SignedPreKey< Algo > &SPk)
 
 ARsKey (const Xpair< typename Algo::EC > &ecDHs, const Kpair< typename Algo::KEM > &kemDHs)
 
 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)
 
 ARsKey ()
 
 ARsKey (const serializedBuffer &DHs)
 
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. More...
 
X< typename Algo::EC, lime::Xtype::privateKey > & ECPrivateKey (void)
 
const X< typename Algo::EC, lime::Xtype::publicKey > & ECPublicKey (void) const
 
K< typename Algo::KEM, lime::Ktype::privateKey > & KEMPrivateKey (void)
 
const K< typename Algo::KEM, lime::Ktype::publicKey > & KEMPublicKey (void) const
 
K< typename Algo::KEM, lime::Ktype::cipherText > & KEMCipherText (void)
 
serializedBuffer serialize (void) const
 Serialize the key pair (to store in DB): First the public value, then the private one, then the cipherText. More...
 
std::vector< uint8_t > serializePublic (void) const
 Serialize the public part only to insert in the DR message header: EC public || KEM public || KEM ciphertext. More...
 
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 part. More...
 
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. More...
 

Static Public Member Functions

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

Member Typedef Documentation

template<typename Algo >
using lime::ARsKey< Algo, true >::serializedBuffer = sBuffer< X<Algo, lime::Xtype::publicKey>::ssize() + X<Algo, lime::Xtype::privateKey>::ssize() + K<Algo, lime::Ktype::publicKey>::ssize() + K<Algo, lime::Ktype::privateKey>::ssize() + K<Algo, lime::Ktype::cipherText>::ssize()>
template<typename Algo >
using lime::ARsKey< Algo, true >::serializedPublicBuffer = std::array<uint8_t, X<Algo, lime::Xtype::publicKey>::ssize() + K<Algo, lime::Ktype::publicKey>::ssize() + K<Algo, lime::Ktype::cipherText>::ssize()>

Constructor & Destructor Documentation

template<typename Algo >
lime::ARsKey< Algo, true >::ARsKey ( const Xpair< typename Algo::EC > &  ecDHs,
const Kpair< typename Algo::KEM > &  kemDHs,
const K< typename Algo::KEM, lime::Ktype::cipherText > &  kemCTs 
)
inline
template<typename Algo >
lime::ARsKey< Algo, true >::ARsKey ( const SignedPreKey< Algo > &  SPk)
inline
template<typename Algo >
lime::ARsKey< Algo, true >::ARsKey ( const Xpair< typename Algo::EC > &  ecDHs,
const Kpair< typename Algo::KEM > &  kemDHs 
)
inline
template<typename Algo >
lime::ARsKey< Algo, true >::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 
)
inline
template<typename Algo >
lime::ARsKey< Algo, true >::ARsKey ( )
inline
template<typename Algo >
lime::ARsKey< Algo, true >::ARsKey ( const serializedBuffer DHs)
inline

Member Function Documentation

template<typename Algo >
X<typename Algo::EC, lime::Xtype::privateKey>& lime::ARsKey< Algo, true >::ECPrivateKey ( void  )
inline
template<typename Algo >
const X<typename Algo::EC, lime::Xtype::publicKey>& lime::ARsKey< Algo, true >::ECPublicKey ( void  ) const
inline
template<typename Algo >
std::vector<uint8_t> lime::ARsKey< Algo, true >::getKEMIndex ( void  ) const
inline

Index is a hash of KEM public key/Cipher Text to identify it without sending/storing it all.

template<typename Algo >
K<typename Algo::KEM, lime::Ktype::cipherText>& lime::ARsKey< Algo, true >::KEMCipherText ( void  )
inline
template<typename Algo >
K<typename Algo::KEM, lime::Ktype::privateKey>& lime::ARsKey< Algo, true >::KEMPrivateKey ( void  )
inline
template<typename Algo >
const K<typename Algo::KEM, lime::Ktype::publicKey>& lime::ARsKey< Algo, true >::KEMPublicKey ( void  ) const
inline
template<typename Algo >
serializedBuffer lime::ARsKey< Algo, true >::serialize ( void  ) const
inline

Serialize the key pair (to store in DB): First the public value, then the private one, then the cipherText.

template<typename Algo >
static constexpr size_t lime::ARsKey< Algo, true >::serializedPublicSize ( void  )
inlinestatic
template<typename Algo >
static constexpr size_t lime::ARsKey< Algo, true >::serializedSize ( void  )
inlinestatic
template<typename Algo >
std::vector<uint8_t> lime::ARsKey< Algo, true >::serializeECPublic ( void  ) const
inline

Serialize the EC public part only to insert in the DR message header when we avoid sending the KEM part.

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

Serialize the public part only to insert in the DR message header: EC public || KEM public || KEM ciphertext.

template<typename Algo >
void lime::ARsKey< Algo, true >::setEC ( const X< typename Algo::EC, lime::Xtype::publicKey > &  ECPublic,
const X< typename Algo::EC, lime::Xtype::privateKey > &  ECPrivate 
)
inline

Set Ec key pair only: used to update this part without touching the KEM one.


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