From: tedu Date: Tue, 23 Dec 2014 20:34:41 +0000 (+0000) Subject: as in libc, there's no need to check for calling Init on null context X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=df3c826f71b4e5a1d03551814d9a1c044c2cf109;p=openbsd as in libc, there's no need to check for calling Init on null context --- diff --git a/sys/crypto/sha2.c b/sys/crypto/sha2.c index 48541f5ba99..b54da2b7559 100644 --- a/sys/crypto/sha2.c +++ b/sys/crypto/sha2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha2.c,v 1.14 2014/12/23 19:21:58 tedu Exp $ */ +/* $OpenBSD: sha2.c,v 1.15 2014/12/23 20:34:41 tedu Exp $ */ /* * FILE: sha2.c @@ -257,8 +257,6 @@ const static u_int64_t sha512_initial_hash_value[8] = { void SHA256Init(SHA2_CTX *context) { - if (context == NULL) - return; memcpy(context->state.st32, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); memset(context->buffer, 0, SHA256_BLOCK_LENGTH); @@ -541,8 +539,6 @@ SHA256Final(u_int8_t digest[], SHA2_CTX *context) void SHA512Init(SHA2_CTX *context) { - if (context == NULL) - return; memcpy(context->state.st64, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); memset(context->buffer, 0, SHA512_BLOCK_LENGTH); @@ -837,8 +833,6 @@ SHA512Final(u_int8_t digest[], SHA2_CTX *context) void SHA384Init(SHA2_CTX *context) { - if (context == NULL) - return; memcpy(context->state.st64, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); memset(context->buffer, 0, SHA384_BLOCK_LENGTH);