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)