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

[ecdsa-sca] Enable ECDSA-256 secret shares for capture #109

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
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 .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ cw/objs/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit filter=lfs diff=lfs
cw/objs/aes_serial_fpga_nexysvideo.bin filter=lfs diff=lfs merge=lfs -text
cw/objs/lowrisc_systems_chip_earlgrey_cw310_0.1.bit filter=lfs diff=lfs merge=lfs -text
cw/objs/lowrisc_systems_chip_earlgrey_cw310_0.1_kmac_dom.bit filter=lfs diff=lfs merge=lfs -text
cw/objs/lowrisc_systems_chip_earlgrey_cw310_0.1_ecdsa.bit filter=lfs diff=lfs merge=lfs -text
cw/objs/kmac_serial_fpga_cw310.bin filter=lfs diff=lfs merge=lfs -text
cw/objs/sha3_serial_fpga_cw310.bin filter=lfs diff=lfs merge=lfs -text
cw/objs/aes_serial_fpga_cw310.bin filter=lfs diff=lfs merge=lfs -text
cw/objs/ecc_serial_fpga_cw310.bin filter=lfs diff=lfs merge=lfs -text
cw/objs/ecc384_serial_fpga_cw310.bin filter=lfs diff=lfs merge=lfs -text
Comment on lines +9 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think just declaring these files in the .gitattributes here is enough. As you can see further below in the diff, Git still thinks you've pushed new binary files. You probably have to first delete the files using git rm, then add them to Git LFS and last but not least squash the commits into one. For reference this is how the diff should look like: https://github.com/lowRISC/ot-sca/pull/4/files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed steps. I updated the files by following these instructions.

doc/img/cw310_cwhusky.jpg filter=lfs diff=lfs merge=lfs -text
doc/img/sample_traces_aes.png filter=lfs diff=lfs merge=lfs -text
doc/img/sample_traces_kmac.png filter=lfs diff=lfs merge=lfs -text
test/data/tvla_general/* filter=lfs diff=lfs merge=lfs -text
doc/img/ot-sca-cw310-clocking.png filter=lfs diff=lfs merge=lfs -text
386 changes: 254 additions & 132 deletions cw/capture.py

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions cw/capture_ecdsa_cw310.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
device:
fpga_bitstream: objs/lowrisc_systems_chip_earlgrey_cw310_0.1_ecdsa.bit
fw_bin: objs/ecc_serial_fpga_cw310.bin
# Target operating frequency
pll_frequency: 22000000
# Target operating frequency:
# for ecdsa-simple: 25-50MHz (alignment issues above 66MHz)
# for ecdsa-stream: 15-20MHz (sampling_rate-adc_resolution tradeoff)
# More details on Husky stream mode can be found in the following links:
# https://github.com/lowRISC/ot-sca/issues/106#issuecomment-1359530023
# https://rtfm.newae.com/Capture/ChipWhisperer-Husky/#streaming-mode
pll_frequency: 15000000
baudrate: 115200
capture:
# Only ECDSA-256 (32) and ECDSA-384 (48) are supported at this moment.
Expand All @@ -13,7 +18,8 @@ capture:
num_samples: 262140
# Offset in samples
offset: 0
# scope gain in db - 13 for non-stream mode, 32.5 for stream mode
# scope gain in db - This may change for each setup,
# find a value for your setup
scope_gain: 32.5
vogelpi marked this conversation as resolved.
Show resolved Hide resolved
num_traces: 1
project_name: projects/opentitan_ecdsa_256
Expand Down
Binary file modified cw/objs/ecc384_serial_fpga_cw310.bin
100644 → 100755
Binary file not shown.
Binary file modified cw/objs/ecc_serial_fpga_cw310.bin
100644 → 100755
Binary file not shown.
Binary file modified cw/objs/lowrisc_systems_chip_earlgrey_cw310_0.1_ecdsa.bit
100644 → 100755
Binary file not shown.
3 changes: 3 additions & 0 deletions doc/img/ot-sca-cw310-clocking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.