Hsm_is_perfect