1. Various optimizations for faster hashing performance.
Fixed scratchpad initialization/finalization for faster looping.