Only crypto uses new_mem_buf so move it back there for ease of exception handling.

Also replace all of the ZeroDivisionErrors in crypto with proper (yet untested) exception-raising behavior.
2 files changed