On 06.05.2025 16:05, Andrew Cooper wrote: > On 06/05/2025 2:56 pm, Frediano Ziglio wrote: >> diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h >> index 47d97fbf01..ea8bad67e4 100644 >> --- a/xen/include/xen/sha2.h >> +++ b/xen/include/xen/sha2.h >> @@ -9,6 +9,16 @@ >> >> #define SHA2_256_DIGEST_SIZE 32 >> >> +struct sha2_256_state { >> + uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)]; >> + uint8_t buf[64]; >> + size_t count; /* Byte count. */ >> +}; >> + >> +void sha2_256_init(struct sha2_256_state *s); >> +void sha2_256_update(struct sha2_256_state *s, const void *msg, >> + size_t len); >> +void sha2_256_final(struct sha2_256_state *s, void *_dst); >> void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE], >> const void *msg, size_t len); > > sha2_256_digest() is unlike the others as it holds sha2_256_state > internally. I'd suggest having all of the additions below this point, > which group them more nicely. > > Can fix on commit. Otherwise LGTM.
I notice this was committed, but isn't this introducing new Misra violations (extern functions without external callers)? Jan