'Called by the garbage collector and used to safely dereference and
release the context.'

def _release_cipher_ctx(self, ctx):

    if (ctx[0] != self._ffi.NULL):
        res = self._lib.CCCryptorRelease(ctx[0])
        self._check_cipher_response(res)
        ctx[0] = self._ffi.NULL
