mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-11-27 10:50:32 -05:00
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:
parent
13767ee7df
commit
d3492e2a34
2 changed files with 4 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
|
|
||||||
"golang.org/x/crypto/blake2s"
|
"golang.org/x/crypto/blake2s"
|
||||||
)
|
)
|
||||||
|
|
@ -16,8 +17,9 @@ func usage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func printCDigest(digest [blake2s.Size]byte, fileName string) {
|
func printCDigest(digest [blake2s.Size]byte, fileName string) {
|
||||||
fmt.Printf("// BLAKE2s digest of %v\n", fileName)
|
fmt.Printf("#include <stdint.h>\n\n")
|
||||||
fmt.Printf("const uint8_t digest[32] = {\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 {
|
for _, n := range digest {
|
||||||
fmt.Printf("0x%02x, ", n)
|
fmt.Printf("0x%02x, ", n)
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ module b2s
|
||||||
|
|
||||||
go 1.23.0
|
go 1.23.0
|
||||||
|
|
||||||
toolchain go1.23.7
|
|
||||||
|
|
||||||
require golang.org/x/crypto v0.36.0
|
require golang.org/x/crypto v0.36.0
|
||||||
|
|
||||||
require golang.org/x/sys v0.31.0 // indirect
|
require golang.org/x/sys v0.31.0 // indirect
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue