tillitis-key/hw/application_fpga/tools/b2s
Michael Cardell Widerkrantz d3492e2a34
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
2025-09-01 18:19:53 +02:00
..
b2s.go tool: Change b2s to output exact variable used 2025-09-01 18:19:53 +02:00
go.mod tool: Change b2s to output exact variable used 2025-09-01 18:19:53 +02:00
go.sum tool: Introduce b2s tool to help compute BLAKE2s digests 2025-04-24 16:03:03 +02:00
README.md tool: Introduce b2s tool to help compute BLAKE2s digests 2025-04-24 16:03:03 +02:00

b2s

The firmware included a BLAKE2s digest of the expected device app in the first app slot. The firmware refuses to start the app if the computed digest differs from the constant.

To simplify computing the digest, use this tool with the -c flag for including the digest in a C program:

Building

go build

Running

./b2s -m b2s -c
// BLAKE2s digest of b2s
uint8_t digest[32] = {
0x17, 0x36, 0xe9, 0x4e, 0xeb, 0x1b, 0xa2, 0x30, 0x89, 0xa9, 0xaa, 0xe, 0xf2, 0x6f, 0x35, 0xb2, 0xa9, 0x89, 0xac, 0x64, 0x63, 0xde, 0x38, 0x60, 0x47, 0x40, 0x91, 0x4e, 0xd7, 0x72, 0xa0, 0x58,
};

To print the digest in a more user friendly way, leave out the -c:

./b2s -m b2s
1736e94eeb1ba23089a9aa0ef26f35b2a989ac6463de38604740914ed772a058 b2s