From ae42e15f211feb8625450e5dcc899ae29d885ba7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 9 Feb 2019 21:30:06 +0100 Subject: Fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- init.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'init.c') diff --git a/init.c b/init.c index a7ffa73..34eadb7 100644 --- a/init.c +++ b/init.c @@ -107,18 +107,13 @@ libsha2_init(struct libsha2_state *restrict state, enum libsha2_algorithm algori } /* Set round constants, and chunk size. */ - switch (algorithm) { - case LIBSHA2_224: - case LIBSHA2_256: + if (algorithm <= LIBSHA2_256) { for (i = 0; i < 64; i++) state->k.b32[i] = (uint32_t)(ROUND_CONSTANTS[i] >> 32); state->chunk_size = 64; - break; - - default: + } else { memcpy(state->k.b64, ROUND_CONSTANTS, sizeof(ROUND_CONSTANTS)); state->chunk_size = 128; - break; } return 0; -- cgit v1.2.3-70-g09d2