32#define AES_BLOCK_SIZE (16)
55 memcpy(
a->counter, iv,
sizeof(
a->counter));
78 memset(
a->counter, 0,
sizeof(
a->counter));
104 if (
a->block_offset && count > 0) {
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static void av_aes_ctr_increment_be64(uint8_t *counter)
static int BS_FUNC left(const BSCTX *bc)
Return the number of the bits left in a buffer.
struct AVAESCTR * av_aes_ctr_alloc(void)
Allocate an AVAESCTR context.
void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t *iv)
Forcefully change the 8-byte iv.
int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key)
Initialize an AVAESCTR context.
void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t *iv)
Forcefully change the "full" 16-byte iv, including the counter.
void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int count)
Process a buffer using a previously initialized context.
void av_aes_ctr_free(struct AVAESCTR *a)
Release an AVAESCTR context.
void av_aes_ctr_increment_iv(struct AVAESCTR *a)
Increment the top 64 bit of the iv (performed after each frame)
void av_aes_ctr_set_random_iv(struct AVAESCTR *a)
Generate a random iv.
const uint8_t * av_aes_ctr_get_iv(struct AVAESCTR *a)
Get the current iv.
int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt)
Initialize an AVAES context.
void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypt or decrypt a buffer using a previously initialized context.
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
Utility Preprocessor macros.
Memory handling functions.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
uint8_t counter[AES_BLOCK_SIZE]
uint8_t encrypted_counter[AES_BLOCK_SIZE]