Skip to content

Commit

Permalink
[otbn/sca] add config option to disable mask
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Tempelmeier <[email protected]>
  • Loading branch information
m-temp committed Feb 28, 2023
1 parent 8f0e9f1 commit 4ede900
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cw/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,15 @@ def capture_otbn_vertical(ot, ktp, fw_bin, pll_frequency, capture_cfg):

ot.scope.adc.offset = capture_cfg["offset"]

# Generate a new random mask for each trace.
mask = ktp.next_text()
tqdm.write(f'mask = {mask.hex()}')
if capture_cfg["masks_off"] is True:
# Use a constant mask for each trace
mask = bytearray(capture_cfg["plain_text_len_bytes"]) # all zeros
else:
# Generate a new random mask for each trace.
mask = ktp.next_text()

tqdm.write("Starting new trace....")
tqdm.write(f'mask = {mask.hex()}')

if sample_fixed:
# Use the fixed seed.
Expand Down
1 change: 1 addition & 0 deletions cw/capture_otbn_vertical.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ capture:
use_fixed_key_iter: False # See https://github.com/lowRISC/ot-sca/issues/116
key_len_bytes: 40
plain_text_len_bytes: 40
masks_off: true
# Output length (most likely unused).
output_len_bytes: 40
# Samples per trace
Expand Down

0 comments on commit 4ede900

Please sign in to comment.