linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephan Müller" <smueller@chronox.de>
To: George Cherian <george.cherian@cavium.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	david.daney@cavium.com, clabbe.montjoie@gmail.com,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH v4 2/3] drivers: crypto: Add the Virtual Function driver for CPT
Date: Wed, 11 Jan 2017 12:12:26 +0100	[thread overview]
Message-ID: <2395769.pOGQxxvRjM@positron.chronox.de> (raw)
In-Reply-To: <1484132211-917-3-git-send-email-george.cherian@cavium.com>

Am Mittwoch, 11. Januar 2017, 10:56:50 CET schrieb George Cherian:

Hi George,

> +int cvm_enc_dec_setkey(struct crypto_ablkcipher *cipher, const u8 *key,
> +		       u32 keylen)
> +{
> +	struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
> +	struct cvm_enc_ctx *ctx = crypto_tfm_ctx(tfm);
> +
> +	if ((keylen == 16) || (keylen == 24) || (keylen == 32)) {
> +		ctx->key_len = keylen;
> +		memcpy(ctx->enc_key, key, keylen);
> +		return 0;
> +	}
> +	crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
> +
> +	return -EINVAL;
> +}

...
> +
> +struct crypto_alg algs[] = { {
> +	.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
> +	.cra_blocksize = AES_BLOCK_SIZE,
> +	.cra_ctxsize = sizeof(struct cvm_enc_ctx),
> +	.cra_alignmask = 7,
> +	.cra_priority = 4001,
> +	.cra_name = "xts(aes)",
> +	.cra_driver_name = "cavium-xts-aes",
> +	.cra_type = &crypto_ablkcipher_type,
> +	.cra_u = {
> +		.ablkcipher = {
> +			.ivsize = AES_BLOCK_SIZE,
> +			.min_keysize = AES_MIN_KEY_SIZE,
> +			.max_keysize = AES_MAX_KEY_SIZE,
> +			.setkey = cvm_enc_dec_setkey,

May I ask how the setkey for XTS is intended to work? The XTS keys are double 
in size than "normal" keys.

> +			.encrypt = cvm_aes_encrypt_xts,
> +			.decrypt = cvm_aes_decrypt_xts,
> +		},


Ciao
Stephan

  reply	other threads:[~2017-01-11 11:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 10:56 [PATCH v4 0/3] Add Support for Cavium Cryptographic Acceleration Unit George Cherian
2017-01-11 10:56 ` [PATCH v4 1/3] drivers: crypto: Add Support for Octeon-tx CPT Engine George Cherian
2017-01-11 10:56 ` [PATCH v4 2/3] drivers: crypto: Add the Virtual Function driver for CPT George Cherian
2017-01-11 11:12   ` Stephan Müller [this message]
2017-01-11 11:28     ` George Cherian
2017-01-11 12:39       ` Stephan Müller
2017-01-12 11:10         ` George Cherian
2017-01-12 11:19           ` Stephan Müller
2017-01-12 11:20             ` George Cherian
2017-01-11 10:56 ` [PATCH v4 3/3] drivers: crypto: Enable CPT options crypto for build George Cherian
2017-01-12 12:40   ` kbuild test robot
2017-01-12 13:38   ` kbuild test robot
2017-01-12 13:38   ` [PATCH] drivers: crypto: fix ifnullfree.cocci warnings kbuild test robot
2017-01-12 14:04   ` [PATCH v4 3/3] drivers: crypto: Enable CPT options crypto for build kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2395769.pOGQxxvRjM@positron.chronox.de \
    --to=smueller@chronox.de \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=george.cherian@cavium.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).