PQS: Post Quantum Shell 1.0.0.0a (A1)
A quantum safe shell application
|
PQS Client functions. More...
Go to the source code of this file.
Functions | |
PQS_EXPORT_API pqs_errors | pqs_client_connect_ipv4 (const pqs_client_verification_key *pubk, const qsc_ipinfo_ipv4_address *address, uint16_t port, void(*send_func)(pqs_connection_state *), void(*receive_callback)(pqs_connection_state *, const uint8_t *, size_t)) |
Connect to the remote server using IPv4 and perform the key exchange. | |
PQS_EXPORT_API pqs_errors | pqs_client_connect_ipv6 (const pqs_client_verification_key *pubk, const qsc_ipinfo_ipv6_address *address, uint16_t port, void(*send_func)(pqs_connection_state *), void(*receive_callback)(pqs_connection_state *, const uint8_t *, size_t)) |
Connect to the remote server using IPv6 and perform the key exchange. | |
PQS Client functions.
This header defines the functions used to implement the Post Quantum Shell (PQS) client. The client is responsible for connecting to a remote PQS server using either an IPv4 or IPv6 address, performing the simplex key exchange, and managing the send and receive operations through callback functions.
The public API includes the following functions:
Both functions initialize the PQS client state, perform the key exchange, and then invoke callback functions to run the send loop (on the main thread) and the receive loop (on a new thread). In case of errors during connection, key exchange, or data transmission, appropriate error logging is performed and the connection is terminated.
PQS_EXPORT_API pqs_errors pqs_client_connect_ipv4 | ( | const pqs_client_verification_key * | pubk, |
const qsc_ipinfo_ipv4_address * | address, | ||
uint16_t | port, | ||
void(* | send_func )(pqs_connection_state *), | ||
void(* | receive_callback )(pqs_connection_state *, const uint8_t *, size_t) ) |
Connect to the remote server using IPv4 and perform the key exchange.
This function attempts to establish a connection to the remote PQS server using the provided IPv4 address and port number. After a successful connection, it performs the client key exchange, and returns the connected socket and PQS client state via callback functions. On success, the function returns pqs_error_none; otherwise, it returns the appropriate error code.
pubk | [const] Pointer to the client's public signature verification key. |
address | [const] Pointer to the server's IPv4 address. |
port | The PQS application port number (typically PQS_SERVER_PORT). |
send_func | Pointer to the send callback function which contains the message send loop. |
receive_callback | Pointer to the receive callback function used to process the incoming server data stream. |
DOXYGEN_IGNORE DOXYGEN_IGNORE
PQS_EXPORT_API pqs_errors pqs_client_connect_ipv6 | ( | const pqs_client_verification_key * | pubk, |
const qsc_ipinfo_ipv6_address * | address, | ||
uint16_t | port, | ||
void(* | send_func )(pqs_connection_state *), | ||
void(* | receive_callback )(pqs_connection_state *, const uint8_t *, size_t) ) |
Connect to the remote server using IPv6 and perform the key exchange.
This function attempts to establish a connection to the remote PQS server using the provided IPv6 address and port number. Following a successful connection, it carries out the client key exchange, and returns the connected socket and PQS client state via callback functions. On success, the function returns pqs_error_none; if any error occurs during the process, an appropriate error code is returned.
pubk | [const] Pointer to the client's public signature verification key. |
address | [const] Pointer to the server's IPv6 address. |
port | The PQS application port number (typically PQS_SERVER_PORT). |
send_func | Pointer to the send callback function which contains the message send loop. |
receive_callback | Pointer to the receive callback function used to process the incoming server data stream. |