Minor optimisation to KDF algorithm.
Don't need to use temporary buffer if remaining length equals digest length.
This commit is contained in:
parent
e61f5d55bc
commit
3f6b6f0b8c
@ -90,7 +90,7 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
|
|||||||
goto err;
|
goto err;
|
||||||
if (!EVP_DigestUpdate(&mctx, sinfo, sinfolen))
|
if (!EVP_DigestUpdate(&mctx, sinfo, sinfolen))
|
||||||
goto err;
|
goto err;
|
||||||
if (outlen > mdlen)
|
if (outlen >= mdlen)
|
||||||
{
|
{
|
||||||
if (!EVP_DigestFinal(&mctx, out, NULL))
|
if (!EVP_DigestFinal(&mctx, out, NULL))
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user