Fix the over-zealous ubiquity optimization for SHA2, add tests.