diff mbox

[for-2.9,2/2] cryptodev: add xts(aes) support

Message ID 1480923846-166484-3-git-send-email-longpeng2@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Longpeng(Mike) Dec. 5, 2016, 7:44 a.m. UTC
This patch add xts(aes) support.

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
---
 backends/cryptodev-builtin.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Gonglei (Arei) Dec. 5, 2016, 9:35 a.m. UTC | #1
> -----Original Message-----
> From: longpeng
> Sent: Monday, December 05, 2016 3:44 PM
> To: Gonglei (Arei)
> Cc: longpeng; qemu-devel@nongnu.org; Wubin (H); Zhoujian (jay, Euler)
> Subject: [PATCH for-2.9 2/2] cryptodev: add xts(aes) support
> 
> This patch add xts(aes) support.
> 
> Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
> ---
>  backends/cryptodev-builtin.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
diff mbox

Patch

diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
index 9dec6b8..ecad565 100644
--- a/backends/cryptodev-builtin.c
+++ b/backends/cryptodev-builtin.c
@@ -197,6 +197,14 @@  static int cryptodev_builtin_create_cipher_session(
             return -1;
         }
         break;
+    case VIRTIO_CRYPTO_CIPHER_AES_XTS:
+        mode = QCRYPTO_CIPHER_MODE_XTS;
+        algo = cryptodev_builtin_get_aes_algo(sess_info->key_len,
+                                                    mode, errp);
+        if (algo < 0)  {
+            return -1;
+        }
+        break;
     case VIRTIO_CRYPTO_CIPHER_DES_ECB:
         mode = QCRYPTO_CIPHER_MODE_ECB;
         algo = QCRYPTO_CIPHER_ALG_DES_RFB;