From 3c28292f390f642bbb3dba0949ecf36aaf7be0d6 Mon Sep 17 00:00:00 2001 From: Gonglei Date: Mon, 26 Sep 2016 17:23:22 +0800 Subject: 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 Signed-off-by: Daniel P. Berrange --- qapi/crypto.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qapi') diff --git a/qapi/crypto.json b/qapi/crypto.json index 6933b13bd0..5c9d7d4a36 100644 --- a/qapi/crypto.json +++ b/qapi/crypto.json @@ -89,11 +89,12 @@ # @ecb: Electronic Code Book # @cbc: Cipher Block Chaining # @xts: XEX with tweaked code book and ciphertext stealing +# @ctr: Counter (Since 2.8) # Since: 2.6 ## { 'enum': 'QCryptoCipherMode', 'prefix': 'QCRYPTO_CIPHER_MODE', - 'data': ['ecb', 'cbc', 'xts']} + 'data': ['ecb', 'cbc', 'xts', 'ctr']} ## -- cgit v1.2.3