<div dir="ltr">I'm implementing Apple HLS SAMPLE-AES decryption and according to their spec, it is required to decrypt different blocks independently.<div><br></div><div>But specs are written for fun, so it is required to take ivec from decrypt process and use it in next decrypt.</div>
<div><br></div><div>crypto:block_decrypt(aes_cbc128,....) returns only decrypted text and looses ivec:</div><div><br></div><div><div>    ret_ptr = enif_make_new_binary(env, data_bin.size, &ret);</div><div>    memcpy(ivec, ivec_bin.data, 16); /* writable copy */</div>
<div>    AES_cbc_encrypt(data_bin.data, ret_ptr, data_bin.size, &aes_key, ivec, i);</div><div>    CONSUME_REDS(env,data_bin);</div><div>    return ret;</div></div><div><br></div><div><br></div><div>modified ivec is lost. So I cannot reuse it and I need to cut all parts for decrypting, glue them together and then split back.</div>
<div><br></div><div>Why modified ivec is ignored? Is it possible to modify api in some way that it would be possible to fix it and return ivec also?</div><div><br></div><div><br></div></div>