RE: [PATCH v3 3/3] crypto: drbg: Export CTR DRBG DF functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Sent: Monday, July 7, 2025 8:47 AM
> To: Jain, Harsh (AECG-SSW) <h.jain@xxxxxxx>
> Cc: davem@xxxxxxxxxxxxx; linux-crypto@xxxxxxxxxxxxxxx;
> devicetree@xxxxxxxxxxxxxxx; Botcha, Mounika <Mounika.Botcha@xxxxxxx>;
> Savitala, Sarat Chand <sarat.chand.savitala@xxxxxxx>; Dhanawade, Mohan
> <mohan.dhanawade@xxxxxxx>; Simek, Michal <michal.simek@xxxxxxx>;
> Stephan Mueller <smueller@xxxxxxxxxx>
> Subject: Re: [PATCH v3 3/3] crypto: drbg: Export CTR DRBG DF functions
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Thu, Jun 12, 2025 at 10:55:42AM +0530, Harsh Jain wrote:
> > Export drbg_ctr_df() derivative function to re-use it in xilinx trng
> > driver. Changes has been tested by enabling
> CONFIG_CRYPTO_USER_API_RNG_CAVP
> >
> > Signed-off-by: Harsh Jain <h.jain@xxxxxxx>
> > ---
> >  crypto/drbg.c                       | 108 +++++++++++++++-------------
> >  drivers/crypto/Kconfig              |   2 +
> >  drivers/crypto/xilinx/xilinx-trng.c |  32 ++++++++-
> >  include/crypto/drbg.h               |  15 ++++
> >  4 files changed, 103 insertions(+), 54 deletions(-)
>
> Please move the df function out into its own module like crypto/hkdf.c.

Thanks Herbert,

There is hkdf.c and kdf_sp800108.c module, Both implements different NIST Specifications and DRBG derivative function represents different NIST Specification.
Moving it to hkdf.c may not be a best fit. How about adding new module for " crypto_drbg_ctr_df ()"?

>
> You should also keep the drbg changes to a minimum.

drbg_ctr_df() needs tfm, blocklen, statelen which is currently derived from struct drbg_state.
If I updated structure drbg_state, It needs code changes in HMAC as well.
To keep code changes minimum, I added required inputs as function arguments.
Do you have any other idea in mind?

>
> Thanks,
> --
> Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux