raaz-crypto/raaz — pull request #178 by satvikc (2014-08-14 10:45:48+00:00)
Title: Moving initialize and finalize to Memory

This is a big pull request. I have grouped commits mainly on package basis.

I have created Initializable and Finalizable Memory classes and made required changes to Assymetric and Symmetric crypto-primitive classes. The idea is to move initialization and finalization of memory from gadget to the memory itself, so the same memory can now be shared across gadgets.

Now `Cxt` is a typefamily instead of a data family and its sole purpose is to put constraint on the `IV` of the gadget's memory. Maybe we can get a better name for this later on. For all gadgets of a primitive, IV remains same. However, memory of the individual gadgets can still change.

Note that, we haven't put this interface in the `Memory` class itself because instances for classes with associated types can not be derived using `deriving` or standalone deriving. Also all memories dont have a finalization value (for example, memory for cipher gadgets).

The above change has simplified a lot of code in cipher and hash packages. For example, now same memory is shared across all SHA family of hashes. Also the gadget interface now looks much cleaner and compact.