Re: [v2 PATCH 7/16] crypto: simd - Add simd skcipher helper

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

 



On Sun, Nov 13, 2016 at 06:27:40PM -0800, Eric Biggers wrote:
> On Sun, Nov 13, 2016 at 07:45:38PM +0800, Herbert Xu wrote:
> > This patch adds the simd skcipher helper which is meant to be
> > a replacement for ablk helper.  It replaces the underlying blkcipher
> > interface with skcipher, and also presents the top-level algorithm
> > as an skcipher.
> 
> I assume this means it's planned for all users of ablk_helper to be migrated to
> crypto_simd, and ablk_helper will be removed?

Yes that's the idea.

> > +	salg = kzalloc(sizeof(*alg), GFP_KERNEL);
> > +	if (!salg) {
> > +		salg = ERR_PTR(-ENOMEM);
> > +		goto out_put_tfm;
> > +	}
> 
> Shouldn't this be 'sizeof(*salg)'?

Good catch.  I'll fix this.

> > +	tfm = crypto_alloc_skcipher(basename, CRYPTO_ALG_INTERNAL,
> > +				    CRYPTO_ALG_INTERNAL | CRYPTO_ALG_ASYNC);
> > +	if (IS_ERR(tfm))
> > +		return ERR_CAST(tfm);
> > +
> > +	ialg = crypto_skcipher_alg(tfm);
> 
> It seems this really just needs an algorithm and not a transform.  Perhaps it
> should be calling crypto_find_alg() directly?

crypto_find_alg is an internal API function that should not be used
unless you're implementing a crypto_type.  Ugh I see that it is being
abused already.  I'll get this fixed.

As a rule internal.h should only be used by API implementors, not
algorithm implementors.

Thanks,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux