Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
Signed-off-by: {Johann Heyszl} <[email protected]>
  • Loading branch information
johannheyszl committed Oct 10, 2023
1 parent aa4ce98 commit e76f8cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cw/simple_capture_aes_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from util import device, plot, trace_util



def abort_handler_during_loop(project, sig, frame):
# Handler for ctrl-c keyboard interrupts
# TODO: Has to be modified according to database (i.e. CW project atm) used
Expand All @@ -31,7 +30,6 @@ def abort_handler_during_loop(project, sig, frame):
sys.exit(0)



if __name__ == '__main__':
# Load configuration from file
with open('simple_capture_aes_sca.yaml') as f:
Expand Down Expand Up @@ -87,7 +85,7 @@ def abort_handler_during_loop(project, sig, frame):
cwfpgahusky.target.simpleserial_write('p', text)

# TODO: Useful code line for batch capture
#cwfpgahusky..simpleserial_write("s", capture_cfg["batch_prng_seed"].to_bytes(4, "little"))
# cwfpgahusky..simpleserial_write("s", capture_cfg["batch_prng_seed"].to_bytes(4, "little"))

# Arm scope
cwfpgahusky.scope.arm()
Expand All @@ -104,7 +102,8 @@ def abort_handler_during_loop(project, sig, frame):
print("Warning: Timeout happened during capture")

# Get response and verify
response = cwfpgahusky.target.simpleserial_read('r', cwfpgahusky.target.output_len, ack=False)
response = cwfpgahusky.target.simpleserial_read('r',
cwfpgahusky.target.output_len, ack=False)
if binascii.b2a_hex(response) != binascii.b2a_hex(cipher.encrypt(bytes(text))):
raise RuntimeError(f'Bad ciphertext: {response} != {cipher.encrypt(bytes(text))}.')

Expand Down
1 change: 1 addition & 0 deletions cw/util/trace_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np


def check_range(waves, bits_per_sample):
""" The ADC output is in the interval [0, 2**bits_per_sample-1]. Check that the recorded
traces are within [1, 2**bits_per_sample-2] to ensure the ADC doesn't saturate. """
Expand Down

0 comments on commit e76f8cf

Please sign in to comment.