Re: [PATCH v2 02/19] crypto: sig - Introduce sig_alg backend

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

 



On Thu Sep 12, 2024 at 10:54 AM EEST, Lukas Wunner wrote:
> On Wed, Sep 11, 2024 at 03:12:33PM +0300, Jarkko Sakkinen wrote:
> > >  static int crypto_sig_init_tfm(struct crypto_tfm *tfm)
> > >  {
> > >  	if (tfm->__crt_alg->cra_type != &crypto_sig_type)
> > >  		return crypto_init_akcipher_ops_sig(tfm);
> > >  
> > > +	struct crypto_sig *sig = __crypto_sig_tfm(tfm);
> > > +	struct sig_alg *alg = crypto_sig_alg(sig);
> > > +
> > > +	if (alg->exit)
> > > +		sig->base.exit = crypto_sig_exit_tfm;
> > > +
> > > +	if (alg->init)
> > > +		return alg->init(sig);
> > 
> > 1. alg->exit == NULL, alg->init == NULL
> > 2. alg->exit != NULL, alg->init == NULL
> > 3. alg->exit == NULL, alg->init != NULL
> > 
> > Which of the three are legit use of the API and which are not?
>
> All three are possible.  Same as crypto_akcipher_init_tfm().

Lot's of nitpicks but...

I try to understand these in detail because I rebase later on my TPM2
ECDSA patches (series last updated in April) on top of this. I'll hold
with that for the sake of less possible conflicts with this larger
series.

Many of the questions rised during the Spring about akcipher so now is
my chance to fill the dots by asking them here.

BR, Jarkko





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