Re: [PATCH v4 3/4] Crypto: rockchip/crypto - add crypto driver for rk3288

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

 



On Tue, Nov 17, 2015 at 12:00:46PM +0800, Zain Wang wrote:
>
> +static void rk_ablk_hw_init(struct rk_crypto_info *dev)
> +{
> +	struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(dev->ablk_req);
> +	struct rk_cipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
> +	u32 conf_reg = 0;
> +
> +	if (dev->mode & TDES) {
> +		dev->mode &= ~TDES;
> +		dev->mode |= RK_CRYPTO_TDES_FIFO_MODE |
> +			     RK_CRYPTO_TDES_BYTESWAP_KEY |
> +			     RK_CRYPTO_TDES_BYTESWAP_IV;
> +		CRYPTO_WRITE(dev, RK_CRYPTO_TDES_CTRL, dev->mode);
> +
> +		memcpy(dev->reg + RK_CRYPTO_TDES_IV_0, dev->ablk_req->info, 8);

Please ensure that the IV is copied back after the operation.
I know that many existing drivers are buggy in this regard but
they will be fixed soon and we will start enforcing this rule
so I don't want to add any new drivers that break this rule.

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