FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
rc4.c File Reference
#include "avutil.h"
#include "common.h"
#include "rc4.h"

Go to the source code of this file.

Functions

int av_rc4_init (AVRC4 *r, const uint8_t *key, int key_bits, int decrypt)
 Initializes an AVRC4 context.
 
void av_rc4_crypt (AVRC4 *r, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
 Encrypts / decrypts using the RC4 algorithm.
 

Function Documentation

int av_rc4_init ( struct AVRC4 d,
const uint8_t key,
int  key_bits,
int  decrypt 
)

Initializes an AVRC4 context.

Parameters
key_bitsmust be a multiple of 8
decrypt0 for encryption, 1 for decryption, currently has no effect

Definition at line 29 of file rc4.c.

Referenced by ff_asfcrypt_dec(), and ff_rtmpe_compute_secret_key().

void av_rc4_crypt ( struct AVRC4 d,
uint8_t dst,
const uint8_t src,
int  count,
uint8_t iv,
int  decrypt 
)

Encrypts / decrypts using the RC4 algorithm.

Parameters
countnumber of bytes
dstdestination array, can be equal to src
srcsource array, can be equal to dst, may be NULL
ivnot (yet) used for RC4, should be NULL
decrypt0 for encryption, 1 for decryption, not (yet) used

Definition at line 50 of file rc4.c.

Referenced by ff_asfcrypt_dec(), ff_rtmpe_update_keystream(), rtmpe_read(), and rtmpe_write().