Skip to content

Commit

Permalink
Cleanup old commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
calebofearth committed Apr 23, 2024
1 parent 063b664 commit 3401875
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/integration/test_suites/fw_test_rom/fw_test_rom.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,44 +59,26 @@ clean:
program.hex: key_manifest_pk_hash_val.hex owner_pk_hash_val.hex fw_update.hex $(TEST_DIR)/$(TESTNAME).extracted $(TEST_DIR)/$(TESTNAME)
@-echo "Building program.hex from $(TESTNAME) using Crypto Test rules for pre-compiled RUST executables"
$(GCC_PREFIX)-objcopy -I binary -O verilog --pad-to 0x8000 --gap-fill 0xFF --no-change-warnings $(TEST_DIR)/$(TESTNAME) program.hex
#$(GCC_PREFIX)-objdump -S $(TEST_DIR)/$(TESTNAME) > $(TESTNAME).dis
#$(GCC_PREFIX)-size $(TEST_DIR)/$(TESTNAME) | tee $(TESTNAME).size
du -b $(TEST_DIR)/$(TESTNAME) | cut -f1 > $(TESTNAME).size

fw_update.hex: $(TEST_DIR)/$(TESTNAME).extracted $(TEST_DIR)/$(TESTNAME_fw)
@-echo "Building fw_update.hex from $(TESTNAME_fw) using binary objcopy pre-compiled RUST package"
$(GCC_PREFIX)-objcopy -I binary -O verilog --pad-to 0x20000 --gap-fill 0xFF --no-change-warnings $(TEST_DIR)/$(TESTNAME_fw) fw_update.hex
du -b $(TEST_DIR)/$(TESTNAME_fw) | cut -f1 > fw_update.size
#@echo "Building fw_update.hex from $(TESTNAME_fw) using simple hexdump on pre-compiled RUST package"
#-hexdump -v -e '16/1 "%02x " "\n"' $(TEST_DIR)/$(TESTNAME_fw) > fw_update.hex

# Extract public keys from ROM binary and dump as hex values
#key_manifest_pk_hash_val.hex: key_manifest_ecc_pk_val.hex key_manifest_lms_pk_val.hex
key_manifest_pk_hash_val.hex: key_manifest_pk_val.bin
sha384sum key_manifest_pk_val.bin | sed 's,\s\+\S\+$$,,' > key_manifest_pk_hash_val.hex
#sha384sum <<< "$(shell cat key_manifest_ecc_pk_val.hex | tr -d '\n') $(shell cat key_manifest_lms_pk_val.hex | tr -d '\n')" | sed 's,\s\+-$$,,' > key_manifest_pk_hash_val.hex

key_manifest_pk_val.bin: $(TEST_DIR)/$(TESTNAME).extracted
dd ibs=1 obs=1 if=$(TEST_DIR)/$(TESTNAME_fw) of=key_manifest_pk_val.bin skip=$(KEY_MANIFEST_ECC_PK_ROM_OFFSET) count=$(KEY_MANIFEST_PK_LENGTH)

owner_pk_hash_val.hex: owner_pk_val.bin
sha384sum owner_pk_val.bin | sed 's,\s\+\S\+$$,,' > owner_pk_hash_val.hex
#sha384sum <<< "$(shell cat owner_ecc_pk_val.hex | tr -d '\n') $(shell cat owner_lms_pk_val.hex | tr -d '\n')" | sed 's,\s\+-$$,,' > owner_pk_hash_val.hex

owner_pk_val.bin: $(TEST_DIR)/$(TESTNAME).extracted
dd ibs=1 obs=1 if=$(TEST_DIR)/$(TESTNAME_fw) of=owner_pk_val.bin skip=$(OWNER_ECC_PK_ROM_OFFSET) count=$(OWNER_PK_LENGTH)

#owner_ecc_pk_val.hex: $(TEST_DIR)/$(TESTNAME).extracted
# xxd -p -s+$(OWNER_ECC_PK_ROM_OFFSET) -l $(OWNER_ECC_PK_SIZE) $(TEST_DIR)/$(TESTNAME) owner_ecc_pk_val.hex
#
#owner_lms_pk_val.hex: $(TEST_DIR)/$(TESTNAME).extracted
# xxd -p -s+$(OWNER_LMS_PK_ROM_OFFSET) -l $(OWNER_LMS_PK_SIZE) $(TEST_DIR)/$(TESTNAME) owner_lms_pk_val.hex
#
#key_manifest_ecc_pk_val.hex: $(TEST_DIR)/$(TESTNAME).extracted
# xxd -p -s+$(KEY_MANIFEST_ECC_PK_ROM_OFFSET) -l $(KEY_MANIFEST_ECC_PK_LENGTH) $(TEST_DIR)/$(TESTNAME) key_manifest_ecc_pk_val.hex
#
#key_manifest_lms_pk_val.hex: $(TEST_DIR)/$(TESTNAME).extracted
# xxd -p -s+$(KEY_MANIFEST_LMS_PK_ROM_OFFSET) -l $(KEY_MANIFEST_LMS_PK_LENGTH) $(TEST_DIR)/$(TESTNAME) key_manifest_lms_pk_val.hex

# Extract compiled FW from latest retrieved release
$(TEST_DIR)/$(TESTNAME).extracted: caliptra_release_v$(today)_0.zip
@7z x -o"$(TEST_DIR)" $< caliptra-rom-with-log.bin
Expand Down

0 comments on commit 3401875

Please sign in to comment.