FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
aes_ctr.h File Reference
#include <stdint.h>
#include "attributes.h"
#include "version.h"

Go to the source code of this file.

Macros

#define AES_CTR_KEY_SIZE   (16)
 
#define AES_CTR_IV_SIZE   (8)
 

Functions

struct AVAESCTRav_aes_ctr_alloc (void)
 Allocate an AVAESCTR context. More...
 
int av_aes_ctr_init (struct AVAESCTR *a, const uint8_t *key)
 Initialize an AVAESCTR context. More...
 
void av_aes_ctr_free (struct AVAESCTR *a)
 Release an AVAESCTR context. More...
 
void av_aes_ctr_crypt (struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size)
 Process a buffer using a previously initialized context. More...
 
const uint8_tav_aes_ctr_get_iv (struct AVAESCTR *a)
 Get the current iv. More...
 
void av_aes_ctr_set_random_iv (struct AVAESCTR *a)
 Generate a random iv. More...
 
void av_aes_ctr_set_iv (struct AVAESCTR *a, const uint8_t *iv)
 Forcefully change the iv. More...
 
void av_aes_ctr_increment_iv (struct AVAESCTR *a)
 Increment the top 64 bit of the iv (performed after each frame) More...
 

Macro Definition Documentation

#define AES_CTR_KEY_SIZE   (16)

Definition at line 30 of file aes_ctr.h.

Referenced by mov_read_header(), and mov_write_header().

#define AES_CTR_IV_SIZE   (8)

Function Documentation

struct AVAESCTR* av_aes_ctr_alloc ( void  )

Allocate an AVAESCTR context.

Definition at line 36 of file aes_ctr.c.

Referenced by ff_mov_cenc_init(), and mov_read_senc().

int av_aes_ctr_init ( struct AVAESCTR a,
const uint8_t key 
)

Initialize an AVAESCTR context.

Parameters
keyencryption key, must have a length of AES_CTR_KEY_SIZE

Definition at line 63 of file aes_ctr.c.

Referenced by ff_mov_cenc_init(), and mov_read_senc().

void av_aes_ctr_free ( struct AVAESCTR a)

Release an AVAESCTR context.

Definition at line 78 of file aes_ctr.c.

Referenced by ff_mov_cenc_free(), and mov_read_close().

void av_aes_ctr_crypt ( struct AVAESCTR a,
uint8_t dst,
const uint8_t src,
int  size 
)

Process a buffer using a previously initialized context.

Parameters
dstdestination array, can be equal to src
srcsource array, can be equal to dst
sizethe size of src and dst

Definition at line 105 of file aes_ctr.c.

Referenced by cenc_filter(), and mov_cenc_write_encrypted().

const uint8_t* av_aes_ctr_get_iv ( struct AVAESCTR a)

Get the current iv.

Definition at line 48 of file aes_ctr.c.

Referenced by mov_cenc_start_packet().

void av_aes_ctr_set_random_iv ( struct AVAESCTR a)

Generate a random iv.

Definition at line 53 of file aes_ctr.c.

Referenced by ff_mov_cenc_init().

void av_aes_ctr_set_iv ( struct AVAESCTR a,
const uint8_t iv 
)

Forcefully change the iv.

Definition at line 41 of file aes_ctr.c.

Referenced by av_aes_ctr_set_random_iv(), and cenc_filter().

void av_aes_ctr_increment_iv ( struct AVAESCTR a)

Increment the top 64 bit of the iv (performed after each frame)

Definition at line 98 of file aes_ctr.c.

Referenced by mov_cenc_end_packet().