fw: Use existing compute_app_digest function when loading from client

This commit is contained in:
Mikael Ågren 2025-04-07 16:40:20 +02:00
parent 06f67f3eec
commit 16e478a993
No known key found for this signature in database
GPG key ID: E02DA3D397792C46

View file

@ -294,7 +294,6 @@ static enum state loading_commands(const struct frame_header *hdr,
ctx->left -= nbytes;
if (ctx->left == 0) {
blake2s_ctx b2s_ctx = {0};
int blake2err = 0;
debug_puts("Fully loaded ");
@ -303,9 +302,7 @@ static enum state loading_commands(const struct frame_header *hdr,
// Compute Blake2S digest of the app,
// storing it for FW_STATE_RUN
blake2err = blake2s(&ctx->digest, 32, NULL, 0,
(const void *)TK1_RAM_BASE,
*app_size, &b2s_ctx);
blake2err = compute_app_digest(ctx->digest);
assert(blake2err == 0);
print_digest(ctx->digest);