wickr-crypto-c
Data Structures | Functions
Wickr_transport_packet_meta

Data Structures

struct  wickr_transport_handshake_meta
 Metadata specifically for handshake packets within a transport. More...
 
struct  wickr_transport_data_meta
 Metadata specifically for user data packets within a transport. More...
 
struct  wickr_transport_packet_meta
 Packet metadata included with all transport packets. More...
 

Functions

void wickr_transport_packet_meta_initialize_handshake (wickr_transport_packet_meta_t *meta_out, uint8_t protocol_version, wickr_transport_packet_mac_type mac_type)
 
void wickr_transport_packet_meta_initialize_data (wickr_transport_packet_meta_t *meta_out, uint64_t sequence_number, wickr_transport_packet_mac_type mac_type)
 
int wickr_transport_packet_meta_initialize_buffer (wickr_transport_packet_meta_t *meta_out, const wickr_buffer_t *buffer)
 
wickr_buffer_twickr_transport_packet_meta_serialize (const wickr_transport_packet_meta_t *meta)
 

Detailed Description

Function Documentation

◆ wickr_transport_packet_meta_initialize_buffer()

int wickr_transport_packet_meta_initialize_buffer ( wickr_transport_packet_meta_t meta_out,
const wickr_buffer_t buffer 
)

Initialize packet metadata with a serialized packet meta buffer

Parameters
meta_outa pointer to initialize for the handshake metadata
buffera buffer containing a serialized packet
Returns
the number of bytes from buffer that had to be read to initialize meta_out or a negative int to indicate failure

◆ wickr_transport_packet_meta_initialize_data()

void wickr_transport_packet_meta_initialize_data ( wickr_transport_packet_meta_t meta_out,
uint64_t  sequence_number,
wickr_transport_packet_mac_type  mac_type 
)

Initialize packet metadata for a data packet

Parameters
meta_outa pointer to initialize for the handshake metadata
sequence_numberthe sequence number of this packet within the current stream of data
mac_typethe type of mac or signature to be used to authenticate the body data of the packet

◆ wickr_transport_packet_meta_initialize_handshake()

void wickr_transport_packet_meta_initialize_handshake ( wickr_transport_packet_meta_t meta_out,
uint8_t  protocol_version,
wickr_transport_packet_mac_type  mac_type 
)

Initialize packet metadata for a handshake packet

Parameters
meta_outa pointer to initialize for the handshake metadata
protocol_versionthe protocol version the handshake will be using (default 1)
mac_typethe type of mac or signature to be used to authenticate the body data of the packet

◆ wickr_transport_packet_meta_serialize()

wickr_buffer_t* wickr_transport_packet_meta_serialize ( const wickr_transport_packet_meta_t meta)
Parameters
metathe metadata to serialize
Returns
a serialized representation of meta or NULL if there was a failure during serialization