mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
crypto: add CTR mode support
Introduce CTR mode support for the cipher APIs. CTR mode uses a counter rather than a traditional IV. The counter has additional properties, including a nonce and initial counter block. We reuse the ctx->iv as the counter for conveniences. Both libgcrypt and nettle are support CTR mode, the cipher-builtin doesn't support yet. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
committed by
Daniel P. Berrange
parent
f844836ddc
commit
3c28292f39
@@ -55,6 +55,7 @@ static bool mode_need_iv[QCRYPTO_CIPHER_MODE__MAX] = {
|
||||
[QCRYPTO_CIPHER_MODE_ECB] = false,
|
||||
[QCRYPTO_CIPHER_MODE_CBC] = true,
|
||||
[QCRYPTO_CIPHER_MODE_XTS] = true,
|
||||
[QCRYPTO_CIPHER_MODE_CTR] = true,
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user