[Cryptech-Commits] [core/util/keywrap] 47/95: Adding tool to generate write commands.

git at cryptech.is git at cryptech.is
Wed Mar 25 17:18:46 UTC 2020


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository core/util/keywrap.

commit d912c9158124c35485538f8b02e2c81542ba7313
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Thu Jul 5 13:03:24 2018 +0200

    Adding tool to generate write commands.
---
 src/tools/gen_cmds.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/tools/gen_cmds.py b/src/tools/gen_cmds.py
new file mode 100755
index 0000000..653afeb
--- /dev/null
+++ b/src/tools/gen_cmds.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+#======================================================================
+# gen_cmds.py
+# -----------
+#
+# Script that generates test writes that we need.
+#======================================================================
+
+cleartext = "8af887c58dfbc38e e0423eefcc0e032d cc79dd116638ca65 ad75dca2a2459f13 934dbe61a62cb26d 8bbddbabf9bf52bb e137ef1d3e30eacf 0fe456ec808d6798 dc29fe54fa1f784a a3c11cf394050095 81d3f1d596843813 a6685e503fac8535 e0c06ecca8561b6a 1f22c578eefb6919 12be2e1667946101 ae8c3501e6c66eb1 7e14f2608c9ce6fb ab4a1597ed49ccb3 930b1060f98c97d8 dc4ce81e35279c4d 30d1bf86c9b919a3 ce4f0109e77929e5 8c4c3aeb5de1ec5e 0afa38ae896df912 1c72c255141f2f5c 9a51be5072547cf8 a3b067404e62f961 5a02479cf8c202e7 feb [...]
+
+
+if __name__ == "__main__":
+
+    bigwords = cleartext.split(" ")
+    i = 0
+    for word in bigwords:
+        first = word[0 : 8]
+        second = word[8:]
+        print("write_word(ADDR_R_DATA0 + %d, 32'h%s);" % (i, first))
+        print("write_word(ADDR_R_DATA0 + %d, 32'h%s);" % (i + 1, second))
+        i = i + 2



More information about the Commits mailing list