gdsa: Fix the conversion of hashes to integers to conform to the spec.