Regression fix: Encrypting in v0 and v1 was calculating HMAC incorrectly
Improved handling of invalid schema versions