diff --git a/sys/hashes/sha224.c b/sys/hashes/sha224.c index 4bc4c7ed3985..3a9cedb736ad 100644 --- a/sys/hashes/sha224.c +++ b/sys/hashes/sha224.c @@ -40,18 +40,12 @@ void sha224_init(sha224_context_t *ctx) ctx->state[7] = 0xBEFA4FA4; } -void *sha224(const void *data, size_t len, void *digest) +void sha224(const void *data, size_t len, void *digest) { sha224_context_t c; - static unsigned char m[SHA224_DIGEST_LENGTH]; - - if (digest == NULL) { - digest = m; - } + assert(digest); sha224_init(&c); sha224_update(&c, data, len); sha224_final(&c, digest); - - return digest; } diff --git a/sys/include/hashes/sha224.h b/sys/include/hashes/sha224.h index ecfb1fc64c2b..678308af5f6d 100644 --- a/sys/include/hashes/sha224.h +++ b/sys/include/hashes/sha224.h @@ -114,7 +114,7 @@ static inline void sha224_final(sha224_context_t *ctx, void *digest) * be SHA224_DIGEST_LENGTH * if digest == NULL, one static buffer is used */ -void *sha224(const void *data, size_t len, void *digest); +void sha224(const void *data, size_t len, void *digest); #ifdef __cplusplus }