24#ifndef RCBENCH_LINK_UPDATE_IMAGE_H
25#define RCBENCH_LINK_UPDATE_IMAGE_H
37#define LINK_IMAGE_SCAN_BYTES 4096u
39#define LINK_IMAGE_MAX_BLOCKS 8u
41#define LINK_IMAGE_TBYB_BIT 0x80u
77 int32_t flag_at,
bool flag_set);
89uint8_t
link_image_byte(
const uint8_t *img, uint32_t at, int32_t flag_at,
SHA-256 (Secure Hash Algorithm, 256-bit digest), as FIPS (Federal Information Processing Standard) 18...
#define LINK_SHA256_BYTES
Bytes in a digest.
Definition link_sha256.h:27
void link_image_hash_end(link_image_hash_t *h, uint8_t out[LINK_SHA256_BYTES])
Write the digest; only meaningful once link_image_hash_step() said so.
Definition link_update_image.c:196
bool link_image_hash_step(link_image_hash_t *h, const uint8_t *src, uint32_t n)
Fold in up to n bytes from src, which holds the image's bytes from h->pos on.
Definition link_update_image.c:169
uint8_t link_image_byte(const uint8_t *img, uint32_t at, int32_t flag_at, bool flag_set)
The byte at at of img as the hash and the transfer read it: the TBYB bit set or cleared at flag_at,...
Definition link_update_image.c:159
void link_image_hash_begin(link_image_hash_t *h, uint32_t len, int32_t flag_at, bool flag_set)
Start a hash of an image.
Definition link_update_image.c:133
void link_update_build_hash(const uint8_t *img, uint32_t len, uint8_t out[LINK_SHA256_BYTES])
The SHA-256 that names the build in img: every byte, the TBYB flag read as clear.
Definition link_update_image.c:204
int32_t link_update_tbyb_byte(const uint8_t *img, uint32_t len)
The byte offset of the TBYB flag in img: byte 3 of the IMAGE_TYPE item of the last IMAGE_DEF block of...
Definition link_update_image.c:92
A SHA-256 over len bytes fed in pieces, the byte at flag_at read with LINK_IMAGE_TBYB_BIT set or clea...
Definition link_update_image.h:60
The state of a SHA-256 computation in progress.
Definition link_sha256.h:32