Wrong scores in LAB 3_3

I am using the code in the solution notebook for this lab and for the section AES guesser the reasults are a lot smaller than the expected values
This is the code i run
import numpy as np
mean_diffs = np.zeros(256)

guessed_byte = 0

for guess in range(0, 256):

import numpy as npmean_diffs = np.zeros(256)

guessed_byte = 0

for guess in range(0, 256):
one_list = []
zero_list = []

for trace_index in range(numtraces):
    
    #Get a hypothetical leakage list - use aes_internal(guess, input_byte)
    hypothetical_leakage = aes_internal(guess, textin_array[trace_index][guessed_byte])

    #Mask off the lowest bit - is it 0 or 1? Depending on that add trace to array
    if hypothetical_leakage & 0x01:        
        one_list.append(trace_array[trace_index])
    else:
        zero_list.append(trace_array[trace_index])
        
one_avg = np.asarray(one_list).mean(axis=0)
zero_avg = np.asarray(zero_list).mean(axis=0)
mean_diffs[guess] = np.max(abs(one_avg - zero_avg))

print("Guessing %02x: %f"%(guess, mean_diffs[guess])) 

and the scores i get are
Guessing 24: 0.000746 Guessing 25: 0.000797 Guessing 26: 0.000699 Guessing 27: 0.000777 Guessing 28: 0.000792 Guessing 29: 0.000780 Guessing 2a: 0.000692 Guessing 2b: 0.000781

while the expected scores should be something like this
Guessing 28: 0.001397 Guessing 29: 0.000927 Guessing 2a: 0.001953 Guessing 2b: 0.005278 Guessing 2c: 0.000919 Guessing 2d: 0.002510 Guessing 2e: 0.001241 Guessing 2f: 0.001242

I believe that i am missing something in my chipwhisperer setup for the capturing of correct power traces
I use chipwhisperer husky with the sam4s target board and the chipwhisperer CW313 and i have connected the POS SMA cable to the J4 pin in the CW313

You will never get exactly the same values as the example that is shown in the notebook. This is because of differences in noise, environmental conditions, target batches, etc…

You should see that every time you run the notebook, you get somewhat different values.

Furthermore, if you keep going through the notebook, the “Ghost Peaks” section explains why the attack may fail, and what you can do about that.

yeah i figured that but it seemed strange that there was such a large difference in the value (0.000781 and 0.002510) i changed the SMA cable from J4 to J3 and the reasults were more normal

J3 and J4 are connected together, it does not matter which one you use (schematic).

If nothing else changed, then you simply got “lucky” when you used J3.