Rename `is_valid_length` to `_is_positive_int`

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