Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aes] Fix aes_fvsr_key_batch on CW305 #137

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cw/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ def capture_aes_fvsr_key_batch(ot, ktp, capture_cfg, scope_type, gen_ciphertexts
# Seed the target's PRNG
ot.target.simpleserial_write("s", capture_cfg["batch_prng_seed"].to_bytes(4, "little"))

# Set and transfer the fixed key.
# Without the sleep statement, the CW305 seems to fail to configure the batch PRNG
# seed and/or the fixed key and then gets completely out of sync.
time.sleep(0.5)
key_fixed = bytearray([0x81, 0x1E, 0x37, 0x31, 0xB0, 0x12, 0x0A, 0x78,
0x42, 0x78, 0x1E, 0x22, 0xB2, 0x5C, 0xDD, 0xF9])
tqdm.write(f'Fixed key: {binascii.b2a_hex(bytes(key_fixed))}')
Expand Down