Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jlmots Class Reference

Public Member Functions

 jlmots (std::shared_ptr< jrand > &rand, bool psuedorandom)
 
 jlmots (std::shared_ptr< jrand > &rand, uint32_t que, bool psuedorandom, lmots_algorithm_t type)
 
virtual ~jlmots ()=default
 default
 
jarray< uint8_t > gensk ()
 
jarray< uint8_t > genpk (jarray< uint8_t > &lmots_sk)
 
jarray< uint8_t > sign (jarray< uint8_t > &message, jarray< uint8_t > &lmots_sk)
 
jarray< uint8_t > verify (jarray< uint8_t > &message, jarray< uint8_t > &lmots_sig, jarray< uint8_t > &lmots_pk)
 
template<typename T >
void set_field (field_t field, T fieldval)
 
template<typename T >
get_field (field_t field)
 

Constructor & Destructor Documentation

◆ jlmots() [1/2]

ProtocolPP::jlmots::jlmots ( std::shared_ptr< jrand > &  rand,
bool  psuedorandom 
)

Standard constructor with LMOTS_SHA256_N32_W8

Parameters
rand- psuedorandom with uniform distribution
psuedorandom- psuedorandom method from Appendix A used for private key

◆ jlmots() [2/2]

ProtocolPP::jlmots::jlmots ( std::shared_ptr< jrand > &  rand,
uint32_t  que,
bool  psuedorandom,
lmots_algorithm_t  type 
)

Constructor with private and public key

Parameters
rand- psuedorandom with uniform distribution
que- leaf value for the Merkle tree
psuedorandom- psuedorandom method from Appendix A used for private key
type- Type of LMOTS (LMOTS_SHA256_N32_W1, LMOTS_SHA256_N32_W2, LMOTS_SHA256_N32_W4, LMOTS_SHA256_N32_W8)

Member Function Documentation

◆ genpk()

jarray<uint8_t> ProtocolPP::jlmots::genpk ( jarray< uint8_t > &  lmots_sk)

Generate a LMOTS Public Key from Private Key

Parameters
lmots_sk- LMOTS Private Key
Returns
LMOTS Public Key

◆ gensk()

jarray<uint8_t> ProtocolPP::jlmots::gensk ( )

Generate a LMOTS Private Key

Returns
LMOTS Private Key

◆ get_field()

template<typename T >
T ProtocolPP::jlmots::get_field ( field_t  field)

Returns the field in LMOTS

LMOTS Get Fields
field typefield nameExample
lmots_algorithm_tAUTHProtocolPP::lmots_algorithm_t myalg = get_field<ProtocolPP::lmots_algorithm_t>(ProtocolPP::field_t::AUTH)
uint32_tOTSWuint32_t myw = get_field<uint32_t>(ProtocolPP::field_t::OTSW)
uint32_tOTSQuint32_t myw = get_field<uint32_t>(ProtocolPP::field_t::OTSQ)
uint32_tOTSPuint32_t myw = get_field<uint32_t>(ProtocolPP::field_t::OTSP)
uint32_tOTSNuint32_t myw = get_field<uint32_t>(ProtocolPP::field_t::OTSN)
uint32_tOTSLSuint32_t myw = get_field<uint32_t>(ProtocolPP::field_t::OTSLS)
uint32_tSIGLENuint32_t myw = get_field<uint32_t>(ProtocolPP::field_t::SIGLEN)
Parameters
field- field to retrieve from the security association
Returns
value of the field in the security association

◆ set_field()

template<typename T >
void ProtocolPP::jlmots::set_field ( field_t  field,
fieldval 
)

Allows the user to update the fields LMOTS

LMOTS Set Fields
field typefield nameExample
uint32_tLMOTSQset_field<uint32_t>(ProtocolPP::field_t::LMOTSQ, 0x00000020)
jarray<uint8_t>LMOTSIset_field<jarray<uint8_t>>(ProtocolPP::field_t::LMOTSI, jarray<uint8_t>("11223344556677889900AABBCCDDFF"))
jarray<uint8_t>LMOTSEEDset_field<jarray<uint8_t>>(ProtocolPP::field_t::LMOTSEED, jarray<uint8_t>("11223344556677889900AABBCCDDEEFF11223344556677889900AABBCCDDEEFF"))
Parameters
field- field to update the security association with
fieldval- value to update the security association with

◆ sign()

jarray<uint8_t> ProtocolPP::jlmots::sign ( jarray< uint8_t > &  message,
jarray< uint8_t > &  lmots_sk 
)

Generate a LMOTS Signature from a private key and message

Parameters
message- Message to sign with LMOTS
lmots_sk- LMOTS Private Key
Returns
LMOTS Signature

◆ verify()

jarray<uint8_t> ProtocolPP::jlmots::verify ( jarray< uint8_t > &  message,
jarray< uint8_t > &  lmots_sig,
jarray< uint8_t > &  lmots_pk 
)

Computing a LMOTS public key from a message and signature (verification)

Parameters
message- Message to verify with WOTS+
lmots_sig- LMOTS Signature to verify
lmots_pk- LMOTS Public key
Returns
Temporary LMOTS Public Key

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