decode_hex_digest was using hash_digest_size. make it use actual HashType size.