Lines Matching refs:cenc
6383 if (!(*sc)->cenc.default_encrypted_sample)
6399 if (!(*sc)->cenc.encryption_index) {
6401 if (!(*sc)->cenc.default_encrypted_sample)
6403 (*sc)->cenc.encryption_index = av_mallocz(sizeof(*frag_stream_info->encryption_index));
6404 if (!(*sc)->cenc.encryption_index)
6408 *encryption_index = (*sc)->cenc.encryption_index;
6419 if (!sc->cenc.default_encrypted_sample) {
6424 *sample = av_encryption_info_clone(sc->cenc.default_encrypted_sample);
6428 if (sc->cenc.per_sample_iv_size != 0) {
6429 if ((ret = ffio_read_size(pb, (*sample)->iv, sc->cenc.per_sample_iv_size)) < 0) {
6560 ret = mov_read_sample_encryption_info(c, pb, sc, sample, sample_info_size > sc->cenc.per_sample_iv_size);
6640 if (sc->cenc.default_encrypted_sample) {
6641 if (aux_info_type != sc->cenc.default_encrypted_sample->scheme) {
6662 } else if (!sc->cenc.default_encrypted_sample) {
6714 if (sc->cenc.default_encrypted_sample) {
6715 if (aux_info_type != sc->cenc.default_encrypted_sample->scheme) {
6736 } else if (!sc->cenc.default_encrypted_sample) {
7006 if (!sc->cenc.default_encrypted_sample) {
7007 sc->cenc.default_encrypted_sample = av_encryption_info_alloc(0, 16, 16);
7008 if (!sc->cenc.default_encrypted_sample) {
7013 sc->cenc.default_encrypted_sample->scheme = avio_rb32(pb);
7033 if (!sc->cenc.default_encrypted_sample) {
7034 sc->cenc.default_encrypted_sample = av_encryption_info_alloc(0, 16, 16);
7035 if (!sc->cenc.default_encrypted_sample) {
7050 sc->cenc.default_encrypted_sample->crypt_byte_block = pattern >> 4;
7051 sc->cenc.default_encrypted_sample->skip_byte_block = pattern & 0xf;
7055 if (is_protected && !sc->cenc.encryption_index) {
7057 sc->cenc.encryption_index = av_mallocz(sizeof(MOVEncryptionIndex));
7058 if (!sc->cenc.encryption_index)
7061 sc->cenc.per_sample_iv_size = avio_r8(pb);
7062 if (sc->cenc.per_sample_iv_size != 0 && sc->cenc.per_sample_iv_size != 8 &&
7063 sc->cenc.per_sample_iv_size != 16) {
7067 if (avio_read(pb, sc->cenc.default_encrypted_sample->key_id, 16) != 16) {
7072 if (is_protected && !sc->cenc.per_sample_iv_size) {
7079 if (avio_read(pb, sc->cenc.default_encrypted_sample->iv, iv_size) != iv_size) {
7133 if (!sc->cenc.aes_ctr) {
7135 sc->cenc.aes_ctr = av_aes_ctr_alloc();
7136 if (!sc->cenc.aes_ctr) {
7140 ret = av_aes_ctr_init(sc->cenc.aes_ctr, c->decryption_key);
7146 av_aes_ctr_set_full_iv(sc->cenc.aes_ctr, sample->iv);
7150 av_aes_ctr_crypt(sc->cenc.aes_ctr, input, input, size);
7167 av_aes_ctr_crypt(sc->cenc.aes_ctr, input, input, bytes_of_protected_data);
7187 if (!sc->cenc.aes_ctx) {
7189 sc->cenc.aes_ctx = av_aes_alloc();
7190 if (!sc->cenc.aes_ctx) {
7194 ret = av_aes_init(sc->cenc.aes_ctx, c->decryption_key, 16 * 8, 1);
7205 av_aes_crypt(sc->cenc.aes_ctx, input, input, size/16, iv, 1);
7227 av_aes_crypt(sc->cenc.aes_ctx, input, input, num_of_encrypted_blocks, iv, 1);
7246 if (!sc->cenc.aes_ctr) {
7248 sc->cenc.aes_ctr = av_aes_ctr_alloc();
7249 if (!sc->cenc.aes_ctr) {
7253 ret = av_aes_ctr_init(sc->cenc.aes_ctr, c->decryption_key);
7259 av_aes_ctr_set_full_iv(sc->cenc.aes_ctr, sample->iv);
7264 av_aes_ctr_crypt(sc->cenc.aes_ctr, input, input, size);
7288 av_aes_ctr_crypt(sc->cenc.aes_ctr, data, data, 16*sample->crypt_byte_block);
7312 if (!sc->cenc.aes_ctx) {
7314 sc->cenc.aes_ctx = av_aes_alloc();
7315 if (!sc->cenc.aes_ctx) {
7319 ret = av_aes_init(sc->cenc.aes_ctx, c->decryption_key, 16 * 8, 1);
7329 av_aes_crypt(sc->cenc.aes_ctx, input, input, size/16, iv, 1);
7354 av_aes_crypt(sc->cenc.aes_ctx, data, data, sample->crypt_byte_block, iv, 1);
7403 sc->cenc.frag_index_entry_base = frag_stream_info->index_entry;
7404 encrypted_index = current_index - (frag_stream_info->index_entry - sc->cenc.frag_index_entry_base);
7407 encryption_index = sc->cenc.encryption_index;
7411 encryption_index = sc->cenc.encryption_index;
7428 encrypted_sample = sc->cenc.default_encrypted_sample;
8516 mov_free_encryption_index(&sc->cenc.encryption_index);
8517 av_encryption_info_free(sc->cenc.default_encrypted_sample);
8518 av_aes_ctr_free(sc->cenc.aes_ctr);