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
This commit is contained in:
Michael Cardell Widerkrantz 2025-08-27 11:31:20 +02:00
parent 13767ee7df
commit d3492e2a34
No known key found for this signature in database
GPG key ID: D3DB3DDF57E704E5
2 changed files with 4 additions and 4 deletions

View file

@ -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 <stdint.h>\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)