summary refs log tree commit diff stats
path: root/include/crypto/ivgen.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2024-09-04 13:18:29 +0200
committerMarkus Armbruster <armbru@redhat.com>2024-09-10 14:03:30 +0200
commita092c513dbb1e504ed1556e70ad263df54016e78 (patch)
treeb81ae49abf0c6239826c29023c230c3b93487800 /include/crypto/ivgen.h
parentef834aa2b2b52ac44ca97d70d5ef5e975a229034 (diff)
downloadfocaccia-qemu-a092c513dbb1e504ed1556e70ad263df54016e78.tar.gz
focaccia-qemu-a092c513dbb1e504ed1556e70ad263df54016e78.zip
qapi/crypto: Rename QCryptoCipherAlgorithm to *Algo, and drop prefix
QAPI's 'prefix' feature can make the connection between enumeration
type and its constants less than obvious.  It's best used with
restraint.

QCryptoCipherAlgorithm has a 'prefix' that overrides the generated
enumeration constants' prefix to QCRYPTO_CIPHER_ALG.

We could simply drop 'prefix', but then the prefix becomes
QCRYPTO_CIPHER_ALGORITHM, which is rather long.

We could additionally rename the type to QCryptoCipherAlg, but I think
the abbreviation "alg" is less than clear.

Rename the type to QCryptoCipherAlgo instead.  The prefix becomes
QCRYPTO_CIPHER_ALGO.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20240904111836.3273842-13-armbru@redhat.com>
Diffstat (limited to 'include/crypto/ivgen.h')
-rw-r--r--include/crypto/ivgen.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/crypto/ivgen.h b/include/crypto/ivgen.h
index ab5f1a648e..b059e332cd 100644
--- a/include/crypto/ivgen.h
+++ b/include/crypto/ivgen.h
@@ -45,21 +45,21 @@
  * g_assert((ndata % 512) == 0);
  *
  * QCryptoIVGen *ivgen = qcrypto_ivgen_new(QCRYPTO_IVGEN_ALG_ESSIV,
- *                                         QCRYPTO_CIPHER_ALG_AES_128,
+ *                                         QCRYPTO_CIPHER_ALGO_AES_128,
  *                                         QCRYPTO_HASH_ALGO_SHA256,
  *                                         key, nkey, errp);
  * if (!ivgen) {
  *    return -1;
  * }
  *
- * QCryptoCipher *cipher = qcrypto_cipher_new(QCRYPTO_CIPHER_ALG_AES_128,
+ * QCryptoCipher *cipher = qcrypto_cipher_new(QCRYPTO_CIPHER_ALGO_AES_128,
  *                                            QCRYPTO_CIPHER_MODE_CBC,
  *                                            key, nkey, errp);
  * if (!cipher) {
  *     goto error;
  * }
  *
- * niv =  qcrypto_cipher_get_iv_len(QCRYPTO_CIPHER_ALG_AES_128,
+ * niv =  qcrypto_cipher_get_iv_len(QCRYPTO_CIPHER_ALGO_AES_128,
  *                                  QCRYPTO_CIPHER_MODE_CBC);
  * iv = g_new0(uint8_t, niv);
  *
@@ -134,7 +134,7 @@ typedef struct QCryptoIVGen QCryptoIVGen;
  * Returns: a new IV generator, or NULL on error
  */
 QCryptoIVGen *qcrypto_ivgen_new(QCryptoIVGenAlgorithm alg,
-                                QCryptoCipherAlgorithm cipheralg,
+                                QCryptoCipherAlgo cipheralg,
                                 QCryptoHashAlgo hash,
                                 const uint8_t *key, size_t nkey,
                                 Error **errp);
@@ -179,7 +179,7 @@ QCryptoIVGenAlgorithm qcrypto_ivgen_get_algorithm(QCryptoIVGen *ivgen);
  *
  * Returns: the cipher algorithm
  */
-QCryptoCipherAlgorithm qcrypto_ivgen_get_cipher(QCryptoIVGen *ivgen);
+QCryptoCipherAlgo qcrypto_ivgen_get_cipher(QCryptoIVGen *ivgen);
 
 
 /**