SATP: Symmetric Authenticated Tunneling Protocol 1.0.0.0a (A1)
A quantum secure symmetric pre-shared key tunneling protocol
server.h
Go to the documentation of this file.
1/* 2025 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE: This software and all accompanying materials are the exclusive
5 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
6 * The intellectual and technical concepts contained within this implementation
7 * are proprietary to QRCS and its authorized licensors and are protected under
8 * applicable U.S. and international copyright, patent, and trade secret laws.
9 *
10 * CRYPTOGRAPHIC STANDARDS:
11 * - This software includes implementations of cryptographic algorithms such as
12 * SHA3, AES, and others. These algorithms are public domain or standardized
13 * by organizations such as NIST and are NOT the property of QRCS.
14 * - However, all source code, optimizations, and implementations in this library
15 * are original works of QRCS and are protected under this license.
16 *
17 * RESTRICTIONS:
18 * - Redistribution, modification, or unauthorized distribution of this software,
19 * in whole or in part, is strictly prohibited.
20 * - This software is provided for non-commercial, educational, and research
21 * purposes only. Commercial use in any form is expressly forbidden.
22 * - Licensing and authorized distribution are solely at the discretion of QRCS.
23 * - Any use of this software implies acceptance of these restrictions.
24 *
25 * DISCLAIMER:
26 * This software is provided "as is," without warranty of any kind, express or
27 * implied, including but not limited to warranties of merchantability or fitness
28 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
29 * incidental, or consequential damages resulting from the use or misuse of this software.
30 *
31 * FULL LICENSE:
32 * This software is subject to the **Quantum Resistant Cryptographic Solutions
33 * Proprietary License (QRCS-PL)**. The complete license terms are included
34 * in the LICENSE.txt file distributed with this software.
35 *
36 * Written by: John G. Underhill
37 * Contact: john.underhill@protonmail.com
38 */
39
40#ifndef SATP_SERVER_H
41#define SATP_SERVER_H
42
43#include "satp.h"
44#include "../../QSC/QSC/rcs.h"
45#include "../../QSC/QSC/socketserver.h"
46
66
74#define SATP_SERVER_PAUSE_INTERVAL 100
75
86SATP_EXPORT_API void satp_server_broadcast(const uint8_t* message, size_t msglen);
87
94SATP_EXPORT_API void satp_server_passphrase_generate(char* passphrase, size_t length);
95
103SATP_EXPORT_API void satp_server_passphrase_hash_generate(uint8_t* phash, char* passphrase, size_t passlen);
104
114SATP_EXPORT_API bool satp_server_passphrase_hash_verify(const uint8_t* phash, char* passphrase, size_t passlen);
115
123SATP_EXPORT_API void satp_server_pause(void);
124
132SATP_EXPORT_API void satp_server_quit(void);
133
141SATP_EXPORT_API void satp_server_resume(void);
142
160SATP_EXPORT_API satp_errors satp_server_start_ipv4(const satp_server_key* skey,
161 void (*receive_callback)(satp_connection_state*, const uint8_t*, size_t),
162 void (*disconnect_callback)(satp_connection_state*),
163 bool (*authentication_callback)(satp_connection_state*, const uint8_t*, size_t));
164
180SATP_EXPORT_API satp_errors satp_server_start_ipv6(const satp_server_key* skey,
181 void (*receive_callback)(satp_connection_state*, const uint8_t*, size_t),
182 void (*disconnect_callback)(satp_connection_state*),
183 bool (*authentication_callback)(satp_connection_state*, const uint8_t*, size_t));
184
185#endif
SATP support header Common defined parameters and functions of the SATP client and server implementat...
satp_errors
The SATP error values. This enumeration defines the error codes returned by SATP functions.
Definition satp.h:452
SATP_EXPORT_API bool satp_server_passphrase_hash_verify(const uint8_t *phash, char *passphrase, size_t passlen)
Verify a passphrase against the hash.
Definition server.c:428
SATP_EXPORT_API void satp_server_resume(void)
Resume the server listener.
Definition server.c:472
SATP_EXPORT_API satp_errors satp_server_start_ipv6(const satp_server_key *skey, void(*receive_callback)(satp_connection_state *, const uint8_t *, size_t), void(*disconnect_callback)(satp_connection_state *), bool(*authentication_callback)(satp_connection_state *, const uint8_t *, size_t))
Start the IPv6 multi-threaded server.
Definition server.c:524
SATP_EXPORT_API void satp_server_pause(void)
Pause the server.
Definition server.c:437
SATP_EXPORT_API void satp_server_quit(void)
Quit the server.
Definition server.c:442
SATP_EXPORT_API void satp_server_passphrase_hash_generate(uint8_t *phash, char *passphrase, size_t passlen)
Generate the passphrase hash.
Definition server.c:419
SATP_EXPORT_API satp_errors satp_server_start_ipv4(const satp_server_key *skey, void(*receive_callback)(satp_connection_state *, const uint8_t *, size_t), void(*disconnect_callback)(satp_connection_state *), bool(*authentication_callback)(satp_connection_state *, const uint8_t *, size_t))
Start the IPv4 multi-threaded server.
Definition server.c:477
SATP_EXPORT_API void satp_server_broadcast(const uint8_t *message, size_t msglen)
Broadcast a message to all connected hosts.
Definition server.c:360
SATP_EXPORT_API void satp_server_passphrase_generate(char *passphrase, size_t length)
Generate a readable pseudo-random passphrase.
Definition server.c:390
The SATP socket connection state structure.
Definition satp.h:511
The SATP server key structure. This structure represents the SATP server key, which is derived from t...
Definition satp.h:557