Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
srtp.h File Reference

SRTP (Secure Real-time Transport Protocol) API. More...

#include <psa/crypto.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util_macro.h>

Go to the source code of this file.

Data Structures

struct  srtp_policy
 SRTP stream protection policy. More...
struct  srtp_stream
 SRTP per-SSRC cryptographic context. More...
struct  srtp_session_ctx
 SRTP state of an RTP session. More...

Macros

#define SRTP_AES_128_KEY_LEN   16
 Length of an AES-128 key in bytes.
#define SRTP_AES_256_KEY_LEN   32
 Length of an AES-256 key in bytes.
#define SRTP_MASTER_SALT_LEN   14
 Length of the SRTP master and session salt in bytes (RFC 3711).
#define SRTP_AES_GCM_SALT_LEN   12
 Length of the SRTP master and session salt in bytes for AES-GCM (RFC 7714).
#define SRTP_HMAC_SHA1_KEY_LEN   20
 Length of a derived HMAC-SHA1 session authentication key in bytes.
#define SRTP_AES_GCM_TAG_LEN   16
 Length of the AES-GCM authentication tag in bytes (RFC 7714).
#define SRTP_AES_GCM_IV_LEN   12
 Length of the AES-GCM initialization vector in bytes (RFC 7714).
#define SRTP_MKI_MAX_LEN   16
 Maximum length of a master key identifier (MKI) in bytes.
#define SRTP_TRAILER_MAX_LEN   (SRTP_AES_GCM_TAG_LEN + SRTP_MKI_MAX_LEN)
 Maximum number of bytes srtp_stream_protect appends to a packet: the authentication tag plus the MKI, when configured.

Enumerations

enum  srtp_cipher { SRTP_CIPHER_NULL , SRTP_CIPHER_AES_128_CM , SRTP_CIPHER_AES_128_GCM , SRTP_CIPHER_AES_256_GCM }
 SRTP encryption transform. More...
enum  srtp_auth { SRTP_AUTH_NULL , SRTP_AUTH_HMAC_SHA1_80 , SRTP_AUTH_HMAC_SHA1_32 }
 SRTP authentication transform. More...

Functions

int srtp_stream_init (struct srtp_stream *stream, const struct srtp_policy *policy, uint32_t ssrc)
 Initialize an SRTP stream from a policy.
int srtp_stream_deinit (struct srtp_stream *stream)
 Release an SRTP stream.
int srtp_stream_protect (struct srtp_stream *stream, uint8_t *buf, size_t pkt_len, size_t buf_size, size_t *out_len)
 Protect a serialized RTP packet in place (RFC 3711, section-3.3).
int srtp_policy_check (const struct srtp_policy *policy)
 Validate an SRTP policy.
int srtp_stream_unprotect (struct srtp_stream *stream, uint8_t *buf, size_t pkt_len, size_t *out_len)
 Unprotect a serialized SRTP packet in place (RFC 3711, section-3.3).

Detailed Description

SRTP (Secure Real-time Transport Protocol) API.