Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
crypto.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <stddef.h>
16#include <stdint.h>
17
18#include <unistd.h>
19
23typedef void Compy_CryptoTlsCtx;
24
29
33typedef struct {
35 Compy_CryptoTlsCtx *(*ctx_new)(const char *cert_path, const char *key_path);
36
38 void (*ctx_free)(Compy_CryptoTlsCtx *ctx);
39
41 Compy_CryptoTlsConn *(*accept)(Compy_CryptoTlsCtx *ctx, int fd);
42
44 void (*conn_free)(Compy_CryptoTlsConn *conn);
45
47 ssize_t (*write)(Compy_CryptoTlsConn *conn, const void *data, size_t len);
48
51 ssize_t (*read)(Compy_CryptoTlsConn *conn, void *buf, size_t len);
52
54 int (*shutdown)(Compy_CryptoTlsConn *conn);
55
57 size_t (*pending)(Compy_CryptoTlsConn *conn);
59
66typedef struct {
71 void (*aes128_ecb)(
72 const uint8_t key[16], const uint8_t in[16], uint8_t out[16]);
73
77 void (*hmac_sha1)(
78 const uint8_t *key, size_t key_len, const uint8_t *data,
79 size_t data_len, uint8_t out[20]);
80
85 int (*random_bytes)(uint8_t *buf, size_t len);
87
92
void Compy_CryptoTlsConn
Opaque TLS connection handle (backend-specific).
Definition crypto.h:28
const Compy_CryptoTlsOps compy_crypto_tls_ops
The TLS operations singleton, defined by the compiled backend.
Definition bearssl.c:192
const Compy_CryptoSrtpOps compy_crypto_srtp_ops
The SRTP operations singleton, defined by the compiled backend.
Definition bearssl.c:203
void Compy_CryptoTlsCtx
Opaque TLS context handle (backend-specific).
Definition crypto.h:23
SRTP cryptographic operations provided by the compiled backend.
Definition crypto.h:66
TLS operations provided by the compiled backend.
Definition crypto.h:33