Fix buffer overruns when storing SHA512 digests