Set own AES keys on Chipwhisperer lite

Hi all !
I’m currently trying to implement the Ascon cipher on Chipwhisperer Lite. I’m having a bit of trouble doing that so I’m trying to understand how AES is done on it to apply the same things on Ascon.

I’m currently trying to set my own keys for encryption instead of using the bacis ones.
I wrote my keys as bytearrays and sent them to the chip but got a “Device failed to ack” error.

When getting the type of the response I noticed their type was CWbytearray. I’m now supsecting this to be the reason behind the error.
Do you have information/ressources on this data type ? or do you know how to convert my bytearrays into this type ?

Thanks in advance


Can you post your code? CWbytearray is just a normal byte array that has its string conversion method overrided so that its output is easier to interpret when you print it.


Of course ! Here it is:

target.simpleserial_write(‘p’, text)
ret = scope.capture()
if ret:
print(“Target timed out!”)

response = target.simpleserial_read(‘r’, 16)

Oh ok thanks ! So I can just call it ?


Hi Nathan,

Try doing


Instead and the same for text. Python can get a bit confusing with this stuff, but basically bytes (b'...') behaves more like a string and bytearray behaves more like a list.


Hi Alex,

Thank you so much that worked !
Oh I understand now thanks !
Have a great evening !


1 Like