generate keyid, remove KEYLEN_MAP