Integer based scrypt_ilog2
Applied sanity check of N