Can anyone help me understand where ‘value’ and ‘guess’ parameters originate from in the function, ‘selection_with_guess’, in PA_CPA_4-Hardware_Crypto_Attack?
# selection_with_guess function must take 2 arguments: value and guess
def selection_function_lastroundHD(byte):
def selection_with_guess(value, guess):
INVSHIFT_undo = [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11]
st10 = value[INVSHIFT_undo[byte]]
st9 = inv_sbox[value[byte] ^ guess]
return hamming(st9 ^ st10)
return selection_with_guess
In the context of this code, I’m unsure about the origins of ‘value’ and ‘guess’. It seems they are passed into the internal function ‘selection_with_guess’, but it’s unclear to me where they would be defined or passed in from the surrounding context. Any clarification on the matter would be appreciated. Thanks!