Commit 6d888db2 authored by Eric Biggers's avatar Eric Biggers Committed by Keith Busch
Browse files

crypto: remove HKDF library



Remove crypto/hkdf.c, since it's no longer used.  Originally it had two
users, but now both of them just inline the needed HMAC computations
using the HMAC library APIs.  That ends up being better, since it
eliminates all the complexity and performance issues associated with the
crypto_shash abstraction and multi-step HMAC input formatting.

Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
Acked-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarEric Biggers <ebiggers@kernel.org>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 26c8c2dd
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -141,12 +141,6 @@ config CRYPTO_ACOMP
	select CRYPTO_ALGAPI
	select CRYPTO_ACOMP2

config CRYPTO_HKDF
	tristate
	select CRYPTO_SHA256 if CRYPTO_SELFTESTS
	select CRYPTO_SHA512 if CRYPTO_SELFTESTS
	select CRYPTO_HASH2

config CRYPTO_MANAGER
	tristate
	default CRYPTO_ALGAPI if CRYPTO_SELFTESTS
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o
obj-$(CONFIG_CRYPTO_AKCIPHER2) += akcipher.o
obj-$(CONFIG_CRYPTO_SIG2) += sig.o
obj-$(CONFIG_CRYPTO_KPP2) += kpp.o
obj-$(CONFIG_CRYPTO_HKDF) += hkdf.o

dh_generic-y := dh.o
dh_generic-y += dh_helper.o

crypto/hkdf.c

deleted100644 → 0
+0 −573

File deleted.

Preview size limit exceeded, changes collapsed.

include/crypto/hkdf.h

deleted100644 → 0
+0 −20
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * HKDF: HMAC-based Key Derivation Function (HKDF), RFC 5869
 *
 * Extracted from fs/crypto/hkdf.c, which has
 * Copyright 2019 Google LLC
 */

#ifndef _CRYPTO_HKDF_H
#define _CRYPTO_HKDF_H

#include <crypto/hash.h>

int hkdf_extract(struct crypto_shash *hmac_tfm, const u8 *ikm,
		 unsigned int ikmlen, const u8 *salt, unsigned int saltlen,
		 u8 *prk);
int hkdf_expand(struct crypto_shash *hmac_tfm,
		const u8 *info, unsigned int infolen,
		u8 *okm, unsigned int okmlen);
#endif