29 #define MAX_BUFFER_BLOCKS 150
60 #define OFFSET(x) offsetof(CryptoContext, x)
61 #define D AV_OPT_FLAG_DECODING_PARAM
62 #define E AV_OPT_FLAG_ENCODING_PARAM
81 uint8_t *default_buf,
int default_buf_len,
85 if (!default_buf_len) {
88 }
else if (default_buf_len !=
BLOCKSIZE) {
90 "invalid %s size (%d bytes, block size is %d)\n",
94 *buf =
av_memdup(default_buf, default_buf_len);
97 *buf_len = default_buf_len;
100 "invalid %s size (%d bytes, block size is %d)\n",
109 const char *nested_url;
122 c->
key, c->
keylen,
"decryption key")) < 0)
125 c->
key, c->
keylen,
"decryption IV")) < 0)
131 c->
key, c->
keylen,
"encryption key")) < 0)
135 c->
key, c->
keylen,
"encryption IV")) < 0)
145 if (flags & AVIO_FLAG_READ) {
156 if (flags & AVIO_FLAG_WRITE) {
182 memcpy(buf, c->
outptr, size);
227 int total_size, blocks, pad_len, out_size;
231 total_size = size + c->
pad_len;
233 out_size = total_size - pad_len;
256 memcpy(c->
pad, &buf[size - pad_len], pad_len);
293 .priv_data_class = &crypto_class,