mHat[i] has been replaced with a hash based on the master secret (mHatGen) for reducing the ram usage from 520 to 507