Rename `is_valid_length` to `is_positive_int`

Also use it to perform a validation check in `generate_iplum`.