qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Longpeng (Mike)" <longpeng2@huawei.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Wubin (H)" <wu.wubin@huawei.com>,
	"Zhoujian (jay, Euler)" <jianjay.zhou@huawei.com>
Subject: Re: [Qemu-devel] [PATCH for-2.9 1/2] cryptodev: fix the check of aes algorithm
Date: Mon, 5 Dec 2016 17:51:43 +0800	[thread overview]
Message-ID: <584538AF.8020805@huawei.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020DA152B6F@DGGEMA505-MBX.china.huawei.com>

Hi Gonglei,

On 2016/12/5 17:34, Gonglei (Arei) wrote:

> 
......
>>
>> +#define AES_KEYSIZE_128 16
>> +#define AES_KEYSIZE_128_XTS 32
>> +#define AES_KEYSIZE_192 24
>> +#define AES_KEYSIZE_256 32
>> +#define AES_KEYSIZE_256_XTS 64
>> +
>>  static int
>> -cryptodev_builtin_get_aes_algo(uint32_t key_len, Error **errp)
>> +cryptodev_builtin_get_aes_algo(uint32_t key_len, int mode, Error **errp)
>>  {
>>      int algo;
>>
>> -    if (key_len == 128 / 8) {
>> +    if (key_len == AES_KEYSIZE_128) {
>>          algo = QCRYPTO_CIPHER_ALG_AES_128;
>> -    } else if (key_len == 192 / 8) {
>> +    } else if (key_len == AES_KEYSIZE_192) {
>>          algo = QCRYPTO_CIPHER_ALG_AES_192;
>> -    } else if (key_len == 256 / 8) {
>> -        algo = QCRYPTO_CIPHER_ALG_AES_256;
>> +    } else if (key_len == AES_KEYSIZE_256) { /* equals AES_KEYSIZE_128_XTS
>> */
> 
> So I think you can:
> 	#define AES_KEYSIZE_128_XTS  AES_KEYSIZE_256


All right,  I send a V2 later. :)

> 
> 
> Regards,
> -Gonglei
> 
......
> 


-- 
Regards,
Longpeng(Mike)

  reply	other threads:[~2016-12-05  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05  7:44 [Qemu-devel] [PATCH for-2.9 0/2] cryptodev: support xts(aes) algorithm Longpeng(Mike)
2016-12-05  7:44 ` [Qemu-devel] [PATCH for-2.9 1/2] cryptodev: fix the check of aes algorithm Longpeng(Mike)
2016-12-05  9:34   ` Gonglei (Arei)
2016-12-05  9:51     ` Longpeng (Mike) [this message]
2016-12-05  7:44 ` [Qemu-devel] [PATCH for-2.9 2/2] cryptodev: add xts(aes) support Longpeng(Mike)
2016-12-05  9:35   ` Gonglei (Arei)

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=584538AF.8020805@huawei.com \
    --to=longpeng2@huawei.com \
    --cc=arei.gonglei@huawei.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wu.wubin@huawei.com \
    /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).