summary refs log tree commit diff stats
path: root/crypto/ivgen.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2024-09-04 13:18:30 +0200
committerMarkus Armbruster <armbru@redhat.com>2024-09-10 14:03:30 +0200
commit5e0e510246816ec2d3e1acf56df10abc4b13a775 (patch)
treeeb7596ac91e604fd89a8b72fa6982b3ee7bb764f /crypto/ivgen.c
parenta092c513dbb1e504ed1556e70ad263df54016e78 (diff)
downloadfocaccia-qemu-5e0e510246816ec2d3e1acf56df10abc4b13a775.tar.gz
focaccia-qemu-5e0e510246816ec2d3e1acf56df10abc4b13a775.zip
qapi/crypto: Rename QCryptoIVGenAlgorithm 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.

QCryptoIVGenAlgorithm has a 'prefix' that overrides the generated
enumeration constants' prefix to QCRYPTO_IVGEN_ALG.

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

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

Rename the type to QCryptoIVGenAlgo instead.  The prefix becomes
QCRYPTO_IV_GEN_ALGO.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20240904111836.3273842-14-armbru@redhat.com>
Diffstat (limited to 'crypto/ivgen.c')
-rw-r--r--crypto/ivgen.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/ivgen.c b/crypto/ivgen.c
index ec0cb1a25b..6b7d24d889 100644
--- a/crypto/ivgen.c
+++ b/crypto/ivgen.c
@@ -27,7 +27,7 @@
 #include "ivgen-essiv.h"
 
 
-QCryptoIVGen *qcrypto_ivgen_new(QCryptoIVGenAlgorithm alg,
+QCryptoIVGen *qcrypto_ivgen_new(QCryptoIVGenAlgo alg,
                                 QCryptoCipherAlgo cipheralg,
                                 QCryptoHashAlgo hash,
                                 const uint8_t *key, size_t nkey,
@@ -40,13 +40,13 @@ QCryptoIVGen *qcrypto_ivgen_new(QCryptoIVGenAlgorithm alg,
     ivgen->hash = hash;
 
     switch (alg) {
-    case QCRYPTO_IVGEN_ALG_PLAIN:
+    case QCRYPTO_IV_GEN_ALGO_PLAIN:
         ivgen->driver = &qcrypto_ivgen_plain;
         break;
-    case QCRYPTO_IVGEN_ALG_PLAIN64:
+    case QCRYPTO_IV_GEN_ALGO_PLAIN64:
         ivgen->driver = &qcrypto_ivgen_plain64;
         break;
-    case QCRYPTO_IVGEN_ALG_ESSIV:
+    case QCRYPTO_IV_GEN_ALGO_ESSIV:
         ivgen->driver = &qcrypto_ivgen_essiv;
         break;
     default:
@@ -73,7 +73,7 @@ int qcrypto_ivgen_calculate(QCryptoIVGen *ivgen,
 }
 
 
-QCryptoIVGenAlgorithm qcrypto_ivgen_get_algorithm(QCryptoIVGen *ivgen)
+QCryptoIVGenAlgo qcrypto_ivgen_get_algorithm(QCryptoIVGen *ivgen)
 {
     return ivgen->algorithm;
 }