All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
crypto.c File Reference
#include "avformat.h"
#include "libavutil/aes.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "internal.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  CryptoContext


#define MAX_BUFFER_BLOCKS   150
#define BLOCKSIZE   16
#define OFFSET(x)   offsetof(CryptoContext, x)


static int set_aes_arg (CryptoContext *c, uint8_t **buf, int *buf_len, uint8_t *default_buf, int default_buf_len, const char *desc)
static int crypto_open2 (URLContext *h, const char *uri, int flags, AVDictionary **options)
static int crypto_read (URLContext *h, uint8_t *buf, int size)
static int crypto_write (URLContext *h, const unsigned char *buf, int size)
static int crypto_close (URLContext *h)


static const AVOption options []
static const AVClass crypto_class
const URLProtocol ff_crypto_protocol

Macro Definition Documentation

#define MAX_BUFFER_BLOCKS   150

Definition at line 29 of file crypto.c.

#define BLOCKSIZE   16

Definition at line 30 of file crypto.c.

Referenced by crypto_close(), crypto_open2(), crypto_read(), crypto_write(), and set_aes_arg().

#define OFFSET (   x)    offsetof(CryptoContext, x)

Definition at line 60 of file crypto.c.

Definition at line 61 of file crypto.c.

Definition at line 62 of file crypto.c.

Function Documentation

static int set_aes_arg ( CryptoContext c,
uint8_t **  buf,
int *  buf_len,
uint8_t default_buf,
int  default_buf_len,
const char *  desc 

Definition at line 80 of file crypto.c.

Referenced by crypto_open2().

static int crypto_open2 ( URLContext h,
const char *  uri,
int  flags,
AVDictionary **  options 

Definition at line 107 of file crypto.c.

static int crypto_read ( URLContext h,
uint8_t buf,
int  size 

Definition at line 176 of file crypto.c.

static int crypto_write ( URLContext h,
const unsigned char *  buf,
int  size 

Definition at line 225 of file crypto.c.

static int crypto_close ( URLContext h)

Definition at line 266 of file crypto.c.

Variable Documentation

const AVOption options[]
Initial value:
= {
{"key", "AES encryption/decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, .flags = D|E },
{"iv", "AES encryption/decryption initialization vector", OFFSET(iv), AV_OPT_TYPE_BINARY, .flags = D|E },
{"decryption_key", "AES decryption key", OFFSET(decrypt_key), AV_OPT_TYPE_BINARY, .flags = D },
{"decryption_iv", "AES decryption initialization vector", OFFSET(decrypt_iv), AV_OPT_TYPE_BINARY, .flags = D },
{"encryption_key", "AES encryption key", OFFSET(encrypt_key), AV_OPT_TYPE_BINARY, .flags = E },
{"encryption_iv", "AES encryption initialization vector", OFFSET(encrypt_iv), AV_OPT_TYPE_BINARY, .flags = E },
{ NULL }
#define NULL
Definition: coverity.c:32
#define E
Definition: crypto.c:62
#define D
Definition: crypto.c:61
offset must point to a pointer immediately followed by an int for the length
Definition: opt.h:229
#define OFFSET(x)
Definition: crypto.c:60

Definition at line 63 of file crypto.c.

const AVClass crypto_class
Initial value:
= {
.class_name = "crypto",
.item_name = av_default_item_name,
.option = options,
Definition: version.h:70
static const AVOption options[]
Definition: crypto.c:63

Definition at line 73 of file crypto.c.

const URLProtocol ff_crypto_protocol
Initial value:
= {
.name = "crypto",
.url_open2 = crypto_open2,
.url_read = crypto_read,
.url_write = crypto_write,
.url_close = crypto_close,
.priv_data_size = sizeof(CryptoContext),
.priv_data_class = &crypto_class,
static int crypto_close(URLContext *h)
Definition: crypto.c:266
static int crypto_read(URLContext *h, uint8_t *buf, int size)
Definition: crypto.c:176
static int crypto_open2(URLContext *h, const char *uri, int flags, AVDictionary **options)
Definition: crypto.c:107
Definition: url.h:33
static const AVClass crypto_class
Definition: crypto.c:73
static int crypto_write(URLContext *h, const unsigned char *buf, int size)
Definition: crypto.c:225
static int flags
Definition: cpu.c:47

Definition at line 287 of file crypto.c.