According to the official Keccak data, the second preimage resistance of SHAKE256 is given as min(d, 256), where d is the output length. Based on the definition of second preimage resistance, consider the following cases:
Given an input m₁ that produces a 255-bit output out₁, finding another input m₂ (with m₂ ≠ m₁) such that SHAKE256(m₂) = out₁ requires, on average, 2²⁵⁵ attempts (since the security level is 2²⁵⁵).
Given an input m₁ that produces a 256-bit output out₁, finding another input m₂ (with m₂ ≠ m₁) such that SHAKE256(m₂) = out₁ requires, on average, 2²⁵⁶ attempts (since the security level is 2²⁵⁶).
Now, suppose we have an input m₁ that produces a 257-bit output, out₁₍₂₅₇₎. If we truncate out₁₍₂₅₇₎ to its first 256 bits (call this output₁₍₂₅₆₎) and then try to find another input m₂ (with m₂ ≠ m₁) such that SHAKE256(m₂) produces a 257-bit output out₂₍₂₅₇₎ whose first 256 bits (output₂₍₂₅₆₎) equal output₁₍₂₅₆₎, the security level remains 2²⁵⁶—so on average, it should take 2²⁵⁶ attempts. The question then is: In this case, must out₁₍₂₅₇₎ equal out₂₍₂₅₇₎? In other words, do the two 257-bit outputs necessarily have the same final (257th) bit? If not, would the probability of the final bits matching be 1/2? And if it is 1/2, then one might argue that, given an input m₁ that produces a 257-bit output, finding a second preimage m₂ (with m₂ ≠ m₁) such that SHAKE256(m₂) equals m₁’s 257-bit output would require, on average, 2²⁵⁶ × 2 = 2²⁵⁷ attempts—contradicting the official Keccak data.
Based on the reasoning in point 3, it appears that as long as the first 256 bits of the SHAKE256 output are identical, the remaining bits must also be identical.
Is this reasoning correct? If not, what is the error in this derivation?