|
| | jecdsaed (ike_hash_t hash, CryptoPP::OID curve, std::shared_ptr< InterfacePP::jlogger > &logger) |
| |
| | jecdsaed (std::shared_ptr< jecdsaedsa > &security) |
| |
|
virtual | ~jecdsaed ()=default |
| | Standard deconstructor.
|
| |
| template<typename T > |
| void | set_field (field_t field, T fieldval) |
| |
| template<typename T > |
| T | get_field (field_t field) |
| |
|
void | gen_keypair () |
| | Generate a public key pair.
|
| |
| void | sign (std::shared_ptr< jarray< uint8_t > > &data, std::shared_ptr< jarray< uint8_t > > &signature) |
| |
| void | verify (std::shared_ptr< jarray< uint8_t > > &data) |
| |
| void | get_security (std::shared_ptr< jecdsaedsa > &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, jarray< uint8_t > &hdr) |
| |
| void | encap_packet (std::shared_ptr< jarray< uint8_t > > &input, std::shared_ptr< jarray< uint8_t > > &output) |
| |
| void | decap_packet (std::shared_ptr< jarray< uint8_t > > &input, std::shared_ptr< jarray< uint8_t > > &output) |
| |
|
| jecdsaed (jecdsaed &jecdsaed)=delete |
| |
|
| jecdsaed (const jecdsaed &jecdsaed)=delete |
| |
| | 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 |
| |
|
| 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) |
| |
| 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) |
| |
|
direction_t | m_dir |
| | direction of processing
|
| |
| uint32_t | m_status |
| |
|
std::shared_ptr< jrand > | m_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
|
| |
◆ jecdsaed() [1/2]
ECDSA Constructor for Ed25519 type (see /ref jenum)
- Parameters
-
| hash | - hash type for curve (SHA2_512 only) |
| curve | - curve for Ed25519 (curve25519 only) |
| logger | - logging object |
◆ jecdsaed() [2/2]
| ProtocolPP::jecdsaed::jecdsaed |
( |
std::shared_ptr< jecdsaedsa > & |
security | ) |
|
|
explicit |
ECDSA Constructor for Ed25519 type (see /ref jenum)
- Parameters
-
| security | - ECDSA Ed25519 Security Association |
◆ decap_packet()
Not used in this protocol
- Parameters
-
| input | - encapsulated data |
| output | - decapsulated packet |
Implements ProtocolPP::jprotocol.
◆ encap_packet()
Not used in this protocol
- Parameters
-
| input | - data to encapsulate |
| output | - encapsulated packet |
Implements ProtocolPP::jprotocol.
◆ get_field() [1/2]
| T ProtocolPP::jecdsaed::get_field |
( |
field_t |
field | ) |
|
|
virtual |
Returns the version field of the ECDSAEd object
ECDSAEd Get Fields
| field type | field name | Example |
| keymode_t | MODE | keymode_t mode = get_field<keymode_t>(field_t::MODE) |
| ike_hash_t | ECHASH | ike_hash_t hash = get_field<ike_hash_t>(field_t::ECHASH) |
| CryptoPP::OID | CURVE | CryptoPP::OID curve = get_field<CryptoPP::OID>(field_t::CURVE) |
| CryptoPP::ed25519PublicKey | PUBKEY | CryptoPP::ed25519PublicKey pubkey = get_field<CryptoPP::ed25519PublicKey>(field_t::PUBKEY) |
| CryptoPP::ed25519PrivateKey | PRVKEY | CryptoPP::ed25519PrivateKey prvkey = get_field<CryptoPP::ed25519PrivateKey>(field_t::PRVKEY) |
- Parameters
-
| field | - field to retrieve from the ECDSAEd object |
- Returns
- field of the ECDSAEd object
Reimplemented from ProtocolPP::jprotocol.
◆ get_field() [2/2]
◆ get_hdr()
◆ get_security()
| void ProtocolPP::jecdsaed::get_security |
( |
std::shared_ptr< jecdsaedsa > & |
sec | ) |
|
get_security
- Parameters
-
| sec | - Shared pointer to hold the security association |
◆ set_field() [1/2]
| void ProtocolPP::jecdsaed::set_field |
( |
field_t |
field, |
|
|
T |
fieldval |
|
) |
| |
Allows the user to update the ECDSAEd object
ECDSAEd Set Fields
| field type | field name | Example |
| keymode_t | MODE | set_field<keymode_t>(field_t::MODE, keymode_t::PKIVERIFY) |
| ike_hash_t | ECHASH | set_field<ike_hash_t>(field_t::ECHASH, hash) |
| CryptoPP::OID | CURVE | set_field<CryptoPP::OID>(field_t::CURVE, CryptoPP::curve25519) |
| CryptoPP::ed25519PrivateKey | PRVKEY | set_field<CryptoPP::ed25519PrivateKey>(field_t::PRVKEY, pubkey) |
| CryptoPP::ed25519PublicKey | PUBKEY | set_field<CryptoPP::ed25519PublicKey>(field_t::PUBKEY, prvkey) |
- Parameters
-
| field | - field to update for ECDSAEd |
| fieldval | - value to update for ECDSAEd |
◆ set_field() [2/2]
Not used in this protocol
- Parameters
-
| field | - field to update |
| value | - new value for the field |
Implements ProtocolPP::jprotocol.
◆ set_hdr()
◆ sign()
Generate a public key pair
- Parameters
-
| data | - data to sign |
| signature | - Signature generated from private key and data |
◆ to_json()
| void ProtocolPP::jecdsaed::to_json |
( |
std::ofstream & |
myjson, |
|
|
direction_t |
direction, |
|
|
std::string & |
indent |
|
) |
| |
|
virtual |
Prints the protocol object in JSON
- Parameters
-
| myjson | - JSON object to print to |
| direction | - randomzation |
| indent | - indentation for JSON output |
Implements ProtocolPP::jprotocol.
◆ to_xml()
Prints the protocol object in XML
- Parameters
-
| myxml | - XMLPrinter object to print to |
| direction | - randomzation |
Implements ProtocolPP::jprotocol.
◆ verify()
Verify the signature using the received public key
- Parameters
-
| data | - data and signature concatenated to verify (data || signature) returns result of signature verification in status word |
The documentation for this class was generated from the following file: