title: Linear Approximation Table Calculation For SBox
body: <p>I have a cryptology homework which asks for LAT table calculation for numerous 4*4 s-boxes. For this purpose I wrote a simple C++ program. I am attaching the question text as image. I am not sure if the formula that the instructor gave is a generic formula for LAT table calculation or he made it himself. My problem is the software I prepared gives a LAT table with all zeros. I do not have a test vector for this formula. I will attach the code below. I will be very pleased if someone who knows about linear approximation tables could check the program and tell me what is the problem. (I checked the bit conversion part it works ok!)
  Thanks in advance..</p>
  
  <p>Ferda</p>
  
  <p><a href="https://i.stack.imgur.com/7OdnE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7OdnE.png" alt="enter image description here"></a></p>