diff options
author | Markus Armbruster <armbru@redhat.com> | 2024-09-04 13:18:28 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2024-09-10 14:02:16 +0200 |
commit | ef834aa2b2b52ac44ca97d70d5ef5e975a229034 (patch) | |
tree | d175decc323ac64104b4243d6c3389affe1d0804 /backends | |
parent | 5f4059ef33e927ce9f72cb60000efa156566cd5c (diff) |
qapi/crypto: Rename QCryptoHashAlgorithm 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.
QCryptoHashAlgorithm has a 'prefix' that overrides the generated
enumeration constants' prefix to QCRYPTO_HASH_ALG.
We could simply drop 'prefix', but then the prefix becomes
QCRYPTO_HASH_ALGORITHM, which is rather long.
We could additionally rename the type to QCryptoHashAlg, but I think
the abbreviation "alg" is less than clear.
Rename the type to QCryptoHashAlgo instead. The prefix becomes to
QCRYPTO_HASH_ALGO.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20240904111836.3273842-12-armbru@redhat.com>
[Conflicts with merge commit 7bbadc60b58b resolved]
Diffstat (limited to 'backends')
-rw-r--r-- | backends/cryptodev-builtin.c | 8 | ||||
-rw-r--r-- | backends/cryptodev-lkcf.c | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index e95af9bb72..4a49d328ec 100644 --- a/backends/cryptodev-builtin.c +++ b/backends/cryptodev-builtin.c @@ -169,16 +169,16 @@ static int cryptodev_builtin_get_rsa_hash_algo( { switch (virtio_rsa_hash) { case VIRTIO_CRYPTO_RSA_MD5: - return QCRYPTO_HASH_ALG_MD5; + return QCRYPTO_HASH_ALGO_MD5; case VIRTIO_CRYPTO_RSA_SHA1: - return QCRYPTO_HASH_ALG_SHA1; + return QCRYPTO_HASH_ALGO_SHA1; case VIRTIO_CRYPTO_RSA_SHA256: - return QCRYPTO_HASH_ALG_SHA256; + return QCRYPTO_HASH_ALGO_SHA256; case VIRTIO_CRYPTO_RSA_SHA512: - return QCRYPTO_HASH_ALG_SHA512; + return QCRYPTO_HASH_ALGO_SHA512; default: error_setg(errp, "Unsupported rsa hash algo: %d", virtio_rsa_hash); diff --git a/backends/cryptodev-lkcf.c b/backends/cryptodev-lkcf.c index e1ee11a158..6e6012e716 100644 --- a/backends/cryptodev-lkcf.c +++ b/backends/cryptodev-lkcf.c @@ -142,7 +142,7 @@ static int cryptodev_lkcf_set_op_desc(QCryptoAkCipherOptions *opts, if (rsa_opt->padding_alg == QCRYPTO_RSA_PADDING_ALG_PKCS1) { snprintf(key_desc, desc_len, "enc=%s hash=%s", QCryptoRSAPaddingAlgorithm_str(rsa_opt->padding_alg), - QCryptoHashAlgorithm_str(rsa_opt->hash_alg)); + QCryptoHashAlgo_str(rsa_opt->hash_alg)); } else { snprintf(key_desc, desc_len, "enc=%s", @@ -161,19 +161,19 @@ static int cryptodev_lkcf_set_rsa_opt(int virtio_padding_alg, switch (virtio_hash_alg) { case VIRTIO_CRYPTO_RSA_MD5: - opt->hash_alg = QCRYPTO_HASH_ALG_MD5; + opt->hash_alg = QCRYPTO_HASH_ALGO_MD5; break; case VIRTIO_CRYPTO_RSA_SHA1: - opt->hash_alg = QCRYPTO_HASH_ALG_SHA1; + opt->hash_alg = QCRYPTO_HASH_ALGO_SHA1; break; case VIRTIO_CRYPTO_RSA_SHA256: - opt->hash_alg = QCRYPTO_HASH_ALG_SHA256; + opt->hash_alg = QCRYPTO_HASH_ALGO_SHA256; break; case VIRTIO_CRYPTO_RSA_SHA512: - opt->hash_alg = QCRYPTO_HASH_ALG_SHA512; + opt->hash_alg = QCRYPTO_HASH_ALGO_SHA512; break; default: |