File syn_tls.c¶
Go to the source code of this file
Native Zero-Heap TLS 1.3 Protocol Engine & Transport Adapter implementation.
#include "syntropic/net/syn_tls.h"#include "syntropic/crypto/syn_ed25519.h"#include "syntropic/crypto/syn_hmac.h"#include "syntropic/util/syn_random.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_tls_bind_transport (SYN_TLS_Context * tls_ctx, SYN_Transport * tr_out) Wrap a TLS 1.3 context into a standard SYN_Transport abstraction. |
| bool | syn_tls_handshake (SYN_TLS_Context * ctx) Perform a non-blocking TLS 1.3 handshake step. |
| bool | syn_tls_init (SYN_TLS_Context * ctx, const SYN_TLS_Config * config, SYN_Transport * transport, uint8_t * rx_buf, size_t rx_buf_size, uint8_t * tx_buf, size_t tx_buf_size) Initialize a TLS 1.3 context. |
| bool | syn_tls_recv (SYN_TLS_Context * ctx, uint8_t * data, size_t max_len, size_t * out_len) Receive and decrypt TLS 1.3 record payload into caller buffer. |
| bool | syn_tls_send (SYN_TLS_Context * ctx, const uint8_t * data, size_t len) Encrypt and transmit application data payload over TLS 1.3. |
| SYN_PT_Status | syn_tls_task (SYN_PT * pt, SYN_Task * task) Cooperative protothread task — drives the TLS 1.3 client handshake & session. |
Public Functions Documentation¶
function syn_tls_bind_transport¶
Wrap a TLS 1.3 context into a standard SYN_Transport abstraction.
Parameters:
tls_ctxInitialized TLS 1.3 context.tr_out[out] Output transport instance.
function syn_tls_handshake¶
Perform a non-blocking TLS 1.3 handshake step.
Parameters:
ctxTLS 1.3 context.
Returns:
true if handshake completed or progressing, false on fatal error.
function syn_tls_init¶
Initialize a TLS 1.3 context.
bool syn_tls_init (
SYN_TLS_Context * ctx,
const SYN_TLS_Config * config,
SYN_Transport * transport,
uint8_t * rx_buf,
size_t rx_buf_size,
uint8_t * tx_buf,
size_t tx_buf_size
)
Parameters:
ctxContext to initialize.configConfiguration.transportWire transport instance.rx_bufCaller-owned RX record buffer.rx_buf_sizeRX buffer capacity.tx_bufCaller-owned TX record buffer.tx_buf_sizeTX buffer capacity.
Returns:
true on success.
function syn_tls_recv¶
Receive and decrypt TLS 1.3 record payload into caller buffer.
Parameters:
ctxTLS 1.3 context.data[out] Output buffer for decrypted data.max_lenCapacity of output buffer.out_len[out] Actual decrypted bytes written.
Returns:
true if a complete record decrypted.
function syn_tls_send¶
Encrypt and transmit application data payload over TLS 1.3.
Parameters:
ctxTLS 1.3 context.dataApplication data buffer.lenApplication data length.
Returns:
true if record encrypted and sent successfully.
function syn_tls_task¶
Cooperative protothread task — drives the TLS 1.3 client handshake & session.
Parameters:
ptProtothread handle.taskTask descriptor.
Returns:
PT status.
The documentation for this class was generated from the following file src/syntropic/net/syn_tls.c