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>
This commit is contained in:
Markus Armbruster 2024-09-04 13:18:29 +02:00
parent ef834aa2b2
commit a092c513db
26 changed files with 277 additions and 278 deletions

View file

@ -77,7 +77,7 @@ static QCryptoBlockCreateOptions luks_create_opts_aes256_cbc_plain64 = {
.u.luks = {
.key_secret = (char *)"sec0",
.has_cipher_alg = true,
.cipher_alg = QCRYPTO_CIPHER_ALG_AES_256,
.cipher_alg = QCRYPTO_CIPHER_ALGO_AES_256,
.has_cipher_mode = true,
.cipher_mode = QCRYPTO_CIPHER_MODE_CBC,
.has_ivgen_alg = true,
@ -91,7 +91,7 @@ static QCryptoBlockCreateOptions luks_create_opts_aes256_cbc_essiv = {
.u.luks = {
.key_secret = (char *)"sec0",
.has_cipher_alg = true,
.cipher_alg = QCRYPTO_CIPHER_ALG_AES_256,
.cipher_alg = QCRYPTO_CIPHER_ALGO_AES_256,
.has_cipher_mode = true,
.cipher_mode = QCRYPTO_CIPHER_MODE_CBC,
.has_ivgen_alg = true,
@ -112,7 +112,7 @@ static struct QCryptoBlockTestData {
bool expect_header;
QCryptoCipherAlgorithm cipher_alg;
QCryptoCipherAlgo cipher_alg;
QCryptoCipherMode cipher_mode;
QCryptoHashAlgo hash_alg;
@ -128,7 +128,7 @@ static struct QCryptoBlockTestData {
.expect_header = false,
.cipher_alg = QCRYPTO_CIPHER_ALG_AES_128,
.cipher_alg = QCRYPTO_CIPHER_ALGO_AES_128,
.cipher_mode = QCRYPTO_CIPHER_MODE_CBC,
.ivgen_alg = QCRYPTO_IVGEN_ALG_PLAIN64,
@ -141,7 +141,7 @@ static struct QCryptoBlockTestData {
.expect_header = true,
.cipher_alg = QCRYPTO_CIPHER_ALG_AES_256,
.cipher_alg = QCRYPTO_CIPHER_ALGO_AES_256,
.cipher_mode = QCRYPTO_CIPHER_MODE_XTS,
.hash_alg = QCRYPTO_HASH_ALGO_SHA256,
@ -156,7 +156,7 @@ static struct QCryptoBlockTestData {
.expect_header = true,
.cipher_alg = QCRYPTO_CIPHER_ALG_AES_256,
.cipher_alg = QCRYPTO_CIPHER_ALGO_AES_256,
.cipher_mode = QCRYPTO_CIPHER_MODE_CBC,
.hash_alg = QCRYPTO_HASH_ALGO_SHA256,
@ -171,7 +171,7 @@ static struct QCryptoBlockTestData {
.expect_header = true,
.cipher_alg = QCRYPTO_CIPHER_ALG_AES_256,
.cipher_alg = QCRYPTO_CIPHER_ALGO_AES_256,
.cipher_mode = QCRYPTO_CIPHER_MODE_CBC,
.hash_alg = QCRYPTO_HASH_ALGO_SHA1,