From d3492e2a34d04c7070569c4ef3ec4e51cdf3f1b9 Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Wed, 27 Aug 2025 11:31:20 +0200 Subject: [PATCH] tool: Change b2s to output exact variable used - Use correct name. - Don't declare it as static. - Lose the toolchain - Use only basename of path in the b2s comment --- hw/application_fpga/tools/b2s/b2s.go | 6 ++++-- hw/application_fpga/tools/b2s/go.mod | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/application_fpga/tools/b2s/b2s.go b/hw/application_fpga/tools/b2s/b2s.go index bfd9afe..083a366 100644 --- a/hw/application_fpga/tools/b2s/b2s.go +++ b/hw/application_fpga/tools/b2s/b2s.go @@ -7,6 +7,7 @@ import ( "flag" "fmt" "os" + "path" "golang.org/x/crypto/blake2s" ) @@ -16,8 +17,9 @@ func usage() { } func printCDigest(digest [blake2s.Size]byte, fileName string) { - fmt.Printf("// BLAKE2s digest of %v\n", fileName) - fmt.Printf("const uint8_t digest[32] = {\n") + fmt.Printf("#include \n\n") + fmt.Printf("// BLAKE2s digest of %v\n", path.Base(fileName)) + fmt.Printf("const uint8_t allowed_app_digest[32] = {\n") for _, n := range digest { fmt.Printf("0x%02x, ", n) diff --git a/hw/application_fpga/tools/b2s/go.mod b/hw/application_fpga/tools/b2s/go.mod index 5c98d9b..b328422 100644 --- a/hw/application_fpga/tools/b2s/go.mod +++ b/hw/application_fpga/tools/b2s/go.mod @@ -2,8 +2,6 @@ module b2s go 1.23.0 -toolchain go1.23.7 - require golang.org/x/crypto v0.36.0 require golang.org/x/sys v0.31.0 // indirect