MATLAB Control of CW Lite

Hello Franz,

Thanks for your response. I was actually getting this error when calling measure_AES (using the capture v4):

[textout, trace] = measure_AES(scope, target, [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15],[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15])
Error using blockalgo>init (line 141)
Python Error: ValueError: AES key must be either 16, 24, or 32 bytes long

Error in AES>init (line 59)
blockalgo.BlockAlgo.init(self, _AES, key, *args, **kwargs)

Error in AES>new (line 95)
return AESCipher(key, *args, **kwargs)

Error in _base>getExpected (line 139)
cipher = AES.new(str(self.key), AES.MODE_ECB)

Error in SimpleSerial>getExpected (line 541)
return TargetTemplate.getExpected(self)

Error in SimpleSerial>runCommand (line 402)
(“$EXPECTED$”, self.getExpected(), “Expected Ciphertext”)]

Error in SimpleSerial>go (line 509)
self.runCommand(self.findParam(‘cmdgo’).getValue())

Error in cwapi>measure_AES (line 40)
target.go()

Can you help in this regard?

Regards,
Debayan

Hi debayan,

I believe I have fixed the problem, I pushed the changes to the api repository. I also made some other unrelated changes to the api as it was missing some function calls and explicit parameters settings to avoid problems in the future.

Make sure when you pull the changes, that you also update your chipwhisperer repository to the newest release, the latest on was released on Saturday and included multiple bug fixes.

Side Note: The matlab api only works if you have the target already programed with the aes-firmware. This cannot be done through the matlab api. The ChipWhisperer software can be used for this. Also the matlab api sets up target parameters (e.g. clock speed, baud rate) which only work for the XMEGA target and the STM32Fx series targets. Any other target requires manually changing of the setup params in the cwapi.py file.

I hope this solves the problem you were having.

Cheers,
Franz