[PATCH 1/2] crypto: hkdf: add hkdf_expand_label()

Chris Leech cleech at redhat.com
Wed Aug 20 12:48:22 PDT 2025


On Wed, Aug 20, 2025 at 11:46:33AM -0700, Eric Biggers wrote:
> On Wed, Aug 20, 2025 at 11:12:10AM +0200, hare at kernel.org wrote:
> > From: Chris Leech <cleech at redhat.com>
> > 
> > Provide an implementation of RFC 8446 (TLS 1.3) HKDF-Expand-Label
> > 
> > Cc: Eric Biggers <ebiggers at kernel.org>
> > Signed-off-by: Chris Leech <cleech at redhat.com>
> > Signed-off-by: Hannes Reinecke <hare at kernel.org>
> > ---
> >  crypto/hkdf.c         | 55 +++++++++++++++++++++++++++++++++++++++++++
> >  include/crypto/hkdf.h |  4 ++++
> >  2 files changed, 59 insertions(+)
> > 
> > ...
>
> Does this belong in crypto/hkdf.c?  It seems to be specific to a
> particular user of HKDF.

While this is needed for NVMe/TLS, it's a case of the NVMe
specifications referencing a function defined in the TLS 1.3 RFC to be
used.  I though it would be clearest to fix the open-coded implemenation
by creating an RFC complient function, which is now no-longer specific
to NVMe so I moved it out to crypto/hkdf.c

I don't know that there will be other users, it just seemed to make the
most sense there.

- Chris




More information about the Linux-nvme mailing list