diff options
author | Longpeng(Mike) <longpeng2@huawei.com> | 2016-12-08 10:44:02 +0800 |
---|---|---|
committer | Gonglei <arei.gonglei@huawei.com> | 2016-12-24 13:46:27 +0800 |
commit | 48ae36c0ad16bb757d4f6e243b8e9072fc8e8c8e (patch) | |
tree | b3e2d56e79839115dfbd33dd88cd21aef1278834 /backends/cryptodev-builtin.c | |
parent | d7a2127a4c5b2d52c94d5c27a5744a055ddc14f7 (diff) |
cryptodev: add 3des-ede support
This patch add 3des-ede support for cryptodev. However this is effective
only when backend using libgcrypt/nettle, because cipher-builtin doesn't
support 3des-ede yet.
Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Diffstat (limited to 'backends/cryptodev-builtin.c')
-rw-r--r-- | backends/cryptodev-builtin.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index 5fb2836fde..486b4a62bc 100644 --- a/backends/cryptodev-builtin.c +++ b/backends/cryptodev-builtin.c @@ -205,6 +205,18 @@ static int cryptodev_builtin_create_cipher_session( return -1; } break; + case VIRTIO_CRYPTO_CIPHER_3DES_ECB: + mode = QCRYPTO_CIPHER_MODE_ECB; + algo = QCRYPTO_CIPHER_ALG_3DES; + break; + case VIRTIO_CRYPTO_CIPHER_3DES_CBC: + mode = QCRYPTO_CIPHER_MODE_CBC; + algo = QCRYPTO_CIPHER_ALG_3DES; + break; + case VIRTIO_CRYPTO_CIPHER_3DES_CTR: + mode = QCRYPTO_CIPHER_MODE_CTR; + algo = QCRYPTO_CIPHER_ALG_3DES; + break; default: error_setg(errp, "Unsupported cipher alg :%u", sess_info->cipher_alg); |