A proposal for new approach to encryption/decryption flow. In my opinion it is much easier to read and follow the RFC spec.
simplified encryption and decryption flow for every scenario by introducing dedicated wrappers
request-response context fields are now updated only after successful operation
fixed bug in byte_array_cpy (destination buffer might be understood as too short just because it has short value assigned, regardless of its actual allocated size)
A proposal for new approach to encryption/decryption flow. In my opinion it is much easier to read and follow the RFC spec.