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

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

 



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().

Thanks,

Lukas




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