Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jxmss Class Reference
Inheritance diagram for ProtocolPP::jxmss:
Collaboration diagram for ProtocolPP::jxmss:

Public Member Functions

 jxmss (std::shared_ptr< jrand > &rand)
 
 jxmss (std::shared_ptr< jrand > &rand, xmss_algorithm_t type, xmssmt_algorithm_t mtype)
 
 jxmss (std::shared_ptr< jrand > &rand, std::shared_ptr< jxmssa > &security)
 
virtual ~jxmss ()=default
 default
 
void gen_keypair ()
 Generate a XMSS key pair and place them in the security association.
 
void sign (std::shared_ptr< jarray< uint8_t >> &message, std::shared_ptr< jarray< uint8_t >> &signmsg)
 
void verify (std::shared_ptr< jarray< uint8_t >> &signmsg, std::shared_ptr< jarray< uint8_t >> &message)
 
void get_security (std::shared_ptr< jxmssa > &sec)
 
void to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction)
 
void to_json (std::ofstream &myjson, direction_t direction, std::string &indent)
 
void set_hdr (jarray< uint8_t > &hdr)
 
void set_field (field_t field, uint64_t value)
 
jarray< uint8_t > get_hdr ()
 
uint64_t get_field (field_t field)
 
uint64_t get_field (field_t field, jarray< uint8_t > &hdr)
 
void encap_packet (std::shared_ptr< jarray< uint8_t >> &input, std::shared_ptr< jarray< uint8_t >> &output)
 Not used in this protocol.
 
void decap_packet (std::shared_ptr< jarray< uint8_t >> &input, std::shared_ptr< jarray< uint8_t >> &output)
 Not used in this protocol.
 
- Public Member Functions inherited from ProtocolPP::jprotocol
 jprotocol (direction_t dir)
 
 jprotocol (direction_t dir, std::string &file)
 
 jprotocol (direction_t dir, std::shared_ptr< jrand > &rand)
 
 jprotocol (direction_t dir, std::shared_ptr< jrand > &rand, std::string &file)
 
virtual ~jprotocol ()
 Standard deconstructor.
 
virtual void encap_packet (std::shared_ptr< jarray< uint8_t >> &output)
 
virtual void decap_packet (std::shared_ptr< jarray< uint8_t >> &input)
 
bool hasfile ()
 
uint32_t get_status ()
 
jarray< uint8_t > checksum (iana_t prot, direction_t dir, jarray< uint8_t > &check, uint32_t offset=0)
 
jarray< uint8_t > pad (pad_t padtype, uint32_t len)
 
 jprotocol (jprotocol &jprotocol)=delete
 
 jprotocol (const jprotocol &jprotocol)=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from ProtocolPP::jprotocol
const static std::string currentDateTime ()
 
static std::string str_status (uint32_t status)
 
static jarray< uint8_t > to_array (uint8_t input)
 
static jarray< uint8_t > to_array (uint16_t input)
 
static jarray< uint8_t > to_array (uint32_t input)
 
static jarray< uint8_t > to_array (uint64_t input)
 
static uint8_t to_u8 (jarray< uint8_t > src_array)
 
static uint16_t to_u16 (jarray< uint8_t > src_array)
 
static uint32_t to_u32 (jarray< uint8_t > src_array)
 
static uint64_t to_u64 (jarray< uint8_t > src_array)
 
static uint32_t fnv_hash (std::shared_ptr< jarray< uint8_t >> &header, jarray< uint8_t > &mask, uint32_t hdrlen)
 
- Protected Member Functions inherited from ProtocolPP::jprotocol
template<typename T , typename TE >
std::shared_ptr< jreplay< T, TE > > update_replay (protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t size)
 
template<typename T , typename TE >
std::shared_ptr< jreplay< T, TE > > update_replay (protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t size, jarray< uint8_t > &window)
 
void update_status (uint32_t stat)
 
void get_data (std::shared_ptr< jarray< uint8_t >> &data)
 
void put_data (std::shared_ptr< jarray< uint8_t >> &wdata)
 
void encryptdat (std::shared_ptr< jarray< uint8_t >> &red, std::shared_ptr< jarray< uint8_t >> &black)
 
void decryptdat (std::shared_ptr< jarray< uint8_t >> &black, std::shared_ptr< jarray< uint8_t >> &red)
 
uint32_t roundup (uint32_t value, uint32_t mult)
 
- Protected Attributes inherited from ProtocolPP::jprotocol
direction_t m_dir
 direction of processing
 
uint32_t m_status
 
std::shared_ptr< jrandm_rand
 random data generator passed into constructor
 
std::string m_filename
 file input string for this protocol
 
std::fstream m_file
 input file stream object for this protocol
 
endian_t m_endian
 endianess string for this protocol
 

Constructor & Destructor Documentation

◆ jxmss() [1/3]

ProtocolPP::jxmss::jxmss ( std::shared_ptr< jrand > &  rand)
explicit

Standard constructor

Parameters
rand- pseudorandom with uniform distribution

◆ jxmss() [2/3]

ProtocolPP::jxmss::jxmss ( std::shared_ptr< jrand > &  rand,
xmss_algorithm_t  type,
xmssmt_algorithm_t  mtype 
)

Standard constructor with XMSS type

Parameters
rand- pseudorandom with uniform distribution
type- XMSS algorithm type
mtype- XMSS^MT algorithm type

◆ jxmss() [3/3]

ProtocolPP::jxmss::jxmss ( std::shared_ptr< jrand > &  rand,
std::shared_ptr< jxmssa > &  security 
)

Constructor with jxmssa security association

Parameters
rand- pseudorandom with uniform distribution
security- XMSS security association

Member Function Documentation

◆ get_field() [1/2]

uint64_t ProtocolPP::jxmss::get_field ( field_t  field)
virtual

Retrieve the field from the XMMS

Parameters
field- field to return
Returns
field

Reimplemented from ProtocolPP::jprotocol.

◆ get_field() [2/2]

uint64_t ProtocolPP::jxmss::get_field ( field_t  field,
jarray< uint8_t > &  hdr 
)
virtual

Not used in this protocol

Returns
0

Implements ProtocolPP::jprotocol.

◆ get_hdr()

jarray<uint8_t> ProtocolPP::jxmss::get_hdr ( )
virtual

Not used in this protocol

Returns
empty array

Implements ProtocolPP::jprotocol.

◆ get_security()

void ProtocolPP::jxmss::get_security ( std::shared_ptr< jxmssa > &  sec)

get_security

Parameters
sec- Shared pointer to hold the security association

◆ set_field()

void ProtocolPP::jxmss::set_field ( field_t  field,
uint64_t  value 
)
virtual

Not used in this protocol

Parameters
field- field to update
value- new value of the field

Implements ProtocolPP::jprotocol.

◆ set_hdr()

void ProtocolPP::jxmss::set_hdr ( jarray< uint8_t > &  hdr)
virtual

Not used in this protocol

Parameters
hdr- header of the packet

Implements ProtocolPP::jprotocol.

◆ sign()

void ProtocolPP::jxmss::sign ( std::shared_ptr< jarray< uint8_t >> &  message,
std::shared_ptr< jarray< uint8_t >> &  signmsg 
)

Generate a XMSS signature and update XMSS private key

Parameters
message- Message to sign with XMSS
signmsg- XMSS signed message with signature as signature || message

◆ to_json()

void ProtocolPP::jxmss::to_json ( std::ofstream &  myjson,
direction_t  direction,
std::string &  indent 
)
virtual

Prints the protocol as an JSON object

Parameters
myjson- JSON object to print with
direction- randomization
indent- indentation for JSON output

Implements ProtocolPP::jprotocol.

◆ to_xml()

void ProtocolPP::jxmss::to_xml ( tinyxml2::XMLPrinter myxml,
direction_t  direction 
)
virtual

Prints the protocol as an XML object

Parameters
myxml- XMLPrinter object to print with
direction- randomization

Implements ProtocolPP::jprotocol.

◆ verify()

void ProtocolPP::jxmss::verify ( std::shared_ptr< jarray< uint8_t >> &  signmsg,
std::shared_ptr< jarray< uint8_t >> &  message 
)

Verify the XMSS signature

Parameters
signmsg- Message and Signature used to generate the signature concatenated as signature || message
message- Message if signature has passed verification, zero array otherwise

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