lagarith: Correctly compute hash_shift