KMAC128 is defined as:
newX = bytepad(encode_string(K), 168) || X || right_encode(L).
return cSHAKE128(newX, L, “KMAC”, S).
The definition of bytepad() is as follows: bytepad(X, w):
Validity Conditions: w > 0
1. z = left_encode(w) || X.
2. while len(z) mod 8 ≠ 0:
z = z || 0
3. while (len(z)/8) mod w ≠ 0:
z = z || 00000000
4. return z.
I couldn't find any stipulation about the maximum length of the key anywhere And according to the definition of bytepad it won't cut the key by 168 bytes, but will make it a multiple (mod) of 168 bytes. That is, if the key is longer, it will complement it to a value multiple of 168 byte
In this case,
z = left_encode(w) || X.
not the length as a whole will go to the beginning, but only a multiple value
I don't understand and don't know where to find out whether we should limit the key by length, what can be used as a guide
keccak view as
KMAC128(K, X, L, S) = KECCAK[256]( (“KMAC” || S, 168) || (K, 168) || X || right_encode L || 00, L)