Skip to content

Commit 3241cd0

Browse files
Hannes Reineckekeithbusch
authored andcommitted
crypto,fs: Separate out hkdf_extract() and hkdf_expand()
Separate out the HKDF functions into a separate module to to make them available to other callers. And add a testsuite to the module with test vectors from RFC 5869 (and additional vectors for SHA384 and SHA512) to ensure the integrity of the algorithm. Signed-off-by: Hannes Reinecke <[email protected]> Acked-by: Eric Biggers <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent fc22b34 commit 3241cd0

File tree

6 files changed

+616
-70
lines changed

6 files changed

+616
-70
lines changed

crypto/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ config CRYPTO_ACOMP
141141
select CRYPTO_ALGAPI
142142
select CRYPTO_ACOMP2
143143

144+
config CRYPTO_HKDF
145+
tristate
146+
select CRYPTO_SHA256 if !CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
147+
select CRYPTO_SHA512 if !CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
148+
select CRYPTO_HASH2
149+
144150
config CRYPTO_MANAGER
145151
tristate "Cryptographic algorithm manager"
146152
select CRYPTO_MANAGER2

crypto/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o
3434
obj-$(CONFIG_CRYPTO_AKCIPHER2) += akcipher.o
3535
obj-$(CONFIG_CRYPTO_SIG2) += sig.o
3636
obj-$(CONFIG_CRYPTO_KPP2) += kpp.o
37+
obj-$(CONFIG_CRYPTO_HKDF) += hkdf.o
3738

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

0 commit comments

Comments
 (0)