added support for store and restore of state, only supports storing of block aligned hashs for security resons