| /qemu/crypto/ |
| A D | cipher.c | 156 QCryptoCipher *cipher = NULL; in qcrypto_cipher_new() local 162 if (!cipher) { in qcrypto_cipher_new() 164 if (!cipher) { in qcrypto_cipher_new() 169 cipher->alg = alg; in qcrypto_cipher_new() 170 cipher->mode = mode; in qcrypto_cipher_new() 172 return cipher; in qcrypto_cipher_new() 176 int qcrypto_cipher_encrypt(QCryptoCipher *cipher, in qcrypto_cipher_encrypt() argument 198 int qcrypto_cipher_setiv(QCryptoCipher *cipher, in qcrypto_cipher_setiv() argument 207 void qcrypto_cipher_free(QCryptoCipher *cipher) in qcrypto_cipher_free() argument 209 if (cipher) { in qcrypto_cipher_free() [all …]
|
| A D | block.c | 264 block->free_ciphers[block->n_free_ciphers] = cipher; in qcrypto_block_push_cipher() 275 QCryptoCipher *cipher; in qcrypto_block_init_cipher() local 290 cipher = qcrypto_block_pop_cipher(block, errp); in qcrypto_block_init_cipher() 291 if (!cipher) { in qcrypto_block_init_cipher() 297 qcrypto_block_push_cipher(block, cipher); in qcrypto_block_init_cipher() 407 if (qcrypto_cipher_setiv(cipher, in do_qcrypto_block_cipher_encdec() 415 if (func(cipher, buf, buf, nbytes, errp) < 0) { in do_qcrypto_block_cipher_encdec() 466 if (!cipher) { in qcrypto_block_decrypt_helper() 474 qcrypto_block_push_cipher(block, cipher); in qcrypto_block_decrypt_helper() 488 if (!cipher) { in qcrypto_block_encrypt_helper() [all …]
|
| A D | ivgen-essiv.c | 27 QCryptoCipher *cipher; member 40 nsalt = qcrypto_cipher_get_key_len(ivgen->cipher); in qcrypto_ivgen_essiv_init() 55 essiv->cipher = qcrypto_cipher_new(ivgen->cipher, in qcrypto_ivgen_essiv_init() 59 if (!essiv->cipher) { in qcrypto_ivgen_essiv_init() 77 size_t ndata = qcrypto_cipher_get_block_len(ivgen->cipher); in qcrypto_ivgen_essiv_calculate() 86 if (qcrypto_cipher_encrypt(essiv->cipher, in qcrypto_ivgen_essiv_calculate() 110 qcrypto_cipher_free(essiv->cipher); in qcrypto_ivgen_essiv_cleanup()
|
| A D | cipher-afalg.c | 118 qcrypto_afalg_cipher_setiv(QCryptoCipher *cipher, in qcrypto_afalg_cipher_setiv() argument 122 QCryptoAFAlgo *afalg = container_of(cipher, QCryptoAFAlgo, base); in qcrypto_afalg_cipher_setiv() 126 expect_niv = qcrypto_cipher_get_iv_len(cipher->alg, cipher->mode); in qcrypto_afalg_cipher_setiv() 201 qcrypto_afalg_cipher_encrypt(QCryptoCipher *cipher, in qcrypto_afalg_cipher_encrypt() argument 205 QCryptoAFAlgo *afalg = container_of(cipher, QCryptoAFAlgo, base); in qcrypto_afalg_cipher_encrypt() 211 qcrypto_afalg_cipher_decrypt(QCryptoCipher *cipher, in qcrypto_afalg_cipher_decrypt() argument 215 QCryptoAFAlgo *afalg = container_of(cipher, QCryptoAFAlgo, base); in qcrypto_afalg_cipher_decrypt() 220 static void qcrypto_afalg_comm_ctx_free(QCryptoCipher *cipher) in qcrypto_afalg_comm_ctx_free() argument 222 QCryptoAFAlgo *afalg = container_of(cipher, QCryptoAFAlgo, base); in qcrypto_afalg_comm_ctx_free()
|
| A D | cipher-builtin.c.inc | 2 * QEMU Crypto cipher built-in algorithms 48 static void qcrypto_cipher_ctx_free(QCryptoCipher *cipher) 50 g_free(cipher); 53 static int qcrypto_cipher_no_setiv(QCryptoCipher *cipher, 143 = container_of(cipher, QCryptoCipherBuiltinAES, base); 157 = container_of(cipher, QCryptoCipherBuiltinAES, base); 171 = container_of(cipher, QCryptoCipherBuiltinAES, base); 185 = container_of(cipher, QCryptoCipherBuiltinAES, base); 198 = container_of(cipher, QCryptoCipherBuiltinAES, base); 294 "Unsupported cipher algorithm %s", [all …]
|
| A D | cipher-gcrypt.c.inc | 2 * QEMU Crypto cipher libgcrypt algorithms 119 static void qcrypto_gcrypt_ctx_free(QCryptoCipher *cipher) 121 QCryptoCipherGcrypt *ctx = container_of(cipher, QCryptoCipherGcrypt, base); 127 static int qcrypto_gcrypt_encrypt(QCryptoCipher *cipher, const void *in, 130 QCryptoCipherGcrypt *ctx = container_of(cipher, QCryptoCipherGcrypt, base); 149 static int qcrypto_gcrypt_decrypt(QCryptoCipher *cipher, const void *in, 171 static int qcrypto_gcrypt_setiv(QCryptoCipher *cipher, 194 static int qcrypto_gcrypt_ctr_setiv(QCryptoCipher *cipher, 248 error_setg(errp, "Unsupported cipher algorithm %s", 255 error_setg(errp, "Unsupported cipher mode %s", [all …]
|
| A D | cipherpriv.h | 21 int (*cipher_encrypt)(QCryptoCipher *cipher, 27 int (*cipher_decrypt)(QCryptoCipher *cipher, 33 int (*cipher_setiv)(QCryptoCipher *cipher, 37 void (*cipher_free)(QCryptoCipher *cipher);
|
| A D | cipher-gnutls.c.inc | 2 * QEMU Crypto cipher gnutls algorithms 74 qcrypto_gnutls_cipher_free(QCryptoCipher *cipher) 76 QCryptoCipherGnutls *ctx = container_of(cipher, QCryptoCipherGnutls, base); 87 qcrypto_gnutls_cipher_encrypt(QCryptoCipher *cipher, 93 QCryptoCipherGnutls *ctx = container_of(cipher, QCryptoCipherGnutls, base); 118 error_setg(errp, "Cannot initialize cipher: %s", 147 qcrypto_gnutls_cipher_decrypt(QCryptoCipher *cipher, 179 error_setg(errp, "Cannot initialize cipher: %s", 207 qcrypto_gnutls_cipher_setiv(QCryptoCipher *cipher, 286 error_setg(errp, "Unsupported cipher algorithm %s with %s mode", [all …]
|
| A D | tls-cipher-suites.c | 57 IANA_TLS_CIPHER cipher; in qcrypto_tls_cipher_suites_get_data() local 69 name = gnutls_cipher_suite_info(idx, (unsigned char *)&cipher, in qcrypto_tls_cipher_suites_get_data() 76 g_byte_array_append(byte_array, cipher.data, 2); in qcrypto_tls_cipher_suites_get_data() 77 trace_qcrypto_tls_cipher_suite_info(cipher.data[0], in qcrypto_tls_cipher_suites_get_data() 78 cipher.data[1], in qcrypto_tls_cipher_suites_get_data()
|
| A D | cipher-nettle.c.inc | 2 * QEMU Crypto cipher nettle algorithms 57 static int qcrypto_cipher_no_setiv(QCryptoCipher *cipher, 67 static int NAME##_setiv(QCryptoCipher *cipher, const uint8_t *iv, \ 70 TYPE *ctx = container_of(cipher, TYPE, base); \ 81 static int NAME##_encrypt_ecb(QCryptoCipher *cipher, const void *in, \ 84 TYPE *ctx = container_of(cipher, TYPE, base); \ 91 static int NAME##_decrypt_ecb(QCryptoCipher *cipher, const void *in, \ 94 TYPE *ctx = container_of(cipher, TYPE, base); \ 110 static int NAME##_encrypt_cbc(QCryptoCipher *cipher, const void *in, \ 768 error_setg(errp, "Unsupported cipher algorithm %s", [all …]
|
| A D | meson.build | 8 'cipher.c', 51 crypto_ss.add(if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c')) 54 system_ss.add(when: gnutls, if_true: files('tls-cipher-suites.c'))
|
| A D | ivgen.c | 39 ivgen->cipher = cipheralg; in qcrypto_ivgen_new() 84 return ivgen->cipher; in qcrypto_ivgen_get_cipher()
|
| A D | block-luks.c | 271 size_t keylen = qcrypto_cipher_get_key_len(cipher); in qcrypto_block_luks_essiv_cipher() 273 return cipher; in qcrypto_block_luks_essiv_cipher() 276 switch (cipher) { in qcrypto_block_luks_essiv_cipher() 333 QCryptoCipherAlgo_str(cipher)); in qcrypto_block_luks_essiv_cipher() 716 g_autoptr(QCryptoCipher) cipher = NULL; in qcrypto_block_luks_store_key() 789 cipher = qcrypto_cipher_new(luks->cipher_alg, in qcrypto_block_luks_store_key() 793 if (!cipher) { in qcrypto_block_luks_store_key() 889 g_autoptr(QCryptoCipher) cipher = NULL; in qcrypto_block_luks_load_key() 939 cipher = qcrypto_cipher_new(luks->cipher_alg, in qcrypto_block_luks_load_key() 944 if (!cipher) { in qcrypto_block_luks_load_key() [all …]
|
| A D | blockpriv.h | 102 int qcrypto_block_cipher_decrypt_helper(QCryptoCipher *cipher, 111 int qcrypto_block_cipher_encrypt_helper(QCryptoCipher *cipher,
|
| /qemu/tests/unit/ |
| A D | test-crypto-cipher.c | 653 QCryptoCipher *cipher; in test_cipher() local 676 cipher = qcrypto_cipher_new( in test_cipher() 741 qcrypto_cipher_free(cipher); in test_cipher() 747 QCryptoCipher *cipher; in test_cipher_null_iv() local 752 cipher = qcrypto_cipher_new( in test_cipher_null_iv() 757 g_assert(cipher != NULL); in test_cipher_null_iv() 767 qcrypto_cipher_free(cipher); in test_cipher_null_iv() 773 QCryptoCipher *cipher; in test_cipher_short_plaintext() local 781 cipher = qcrypto_cipher_new( in test_cipher_short_plaintext() 786 g_assert(cipher != NULL); in test_cipher_short_plaintext() [all …]
|
| A D | test-crypto-block.c | 252 QCryptoCipher *cipher; in test_block_assert_setup() local 255 cipher = qcrypto_block_get_cipher(blk); in test_block_assert_setup() 258 g_assert(cipher); in test_block_assert_setup() 260 g_assert_cmpint(data->cipher_alg, ==, cipher->alg); in test_block_assert_setup() 261 g_assert_cmpint(data->cipher_mode, ==, cipher->mode); in test_block_assert_setup()
|
| /qemu/tests/bench/ |
| A D | benchmark-crypto-cipher.c | 22 QCryptoCipher *cipher; in test_cipher_speed() local 52 cipher = qcrypto_cipher_new(alg, mode, in test_cipher_speed() 54 g_assert(cipher != NULL); in test_cipher_speed() 57 g_assert(qcrypto_cipher_setiv(cipher, in test_cipher_speed() 64 g_assert(qcrypto_cipher_encrypt(cipher, in test_cipher_speed() 81 g_assert(qcrypto_cipher_decrypt(cipher, in test_cipher_speed() 95 qcrypto_cipher_free(cipher); in test_cipher_speed() 175 #define ADD_TEST(mode, cipher, keysize, chunk) \ in main() argument 179 "/crypto/cipher/" #mode "-" #cipher "-" #keysize "/chunk-" #chunk, \ in main() 181 test_cipher_speed_ ## mode ## _ ## cipher ## _ ## keysize) in main()
|
| /qemu/include/crypto/ |
| A D | cipher.h | 171 void qcrypto_cipher_free(QCryptoCipher *cipher); 190 int qcrypto_cipher_encrypt(QCryptoCipher *cipher, 212 int qcrypto_cipher_decrypt(QCryptoCipher *cipher, 234 int qcrypto_cipher_setiv(QCryptoCipher *cipher,
|
| /qemu/tests/qemu-iotests/ |
| A D | 149 | 37 def __init__(self, name, cipher, keylen, mode, ivgen, argument 41 self.cipher = cipher 157 cipher = config.cipher + "-" + config.mode + "-" + config.ivgen 159 cipher = cipher + ":" + config.ivgen_hash 161 cipher = cipher + ":" + "sha256" 162 args.extend(["--cipher", cipher]) 251 "cipher-alg=%s-%d" % (config.cipher, config.keylen),
|
| A D | 082.out | 58 encrypt.cipher-alg=<str> - Name of encryption cipher algorithm 59 encrypt.cipher-mode=<str> - Name of encryption cipher mode 84 encrypt.cipher-alg=<str> - Name of encryption cipher algorithm 85 encrypt.cipher-mode=<str> - Name of encryption cipher mode 111 encrypt.cipher-mode=<str> - Name of encryption cipher mode 137 encrypt.cipher-mode=<str> - Name of encryption cipher mode 163 encrypt.cipher-mode=<str> - Name of encryption cipher mode 189 encrypt.cipher-mode=<str> - Name of encryption cipher mode 215 encrypt.cipher-mode=<str> - Name of encryption cipher mode 241 encrypt.cipher-mode=<str> - Name of encryption cipher mode [all …]
|
| A D | 210.out | 23 cipher alg: aes-256 25 cipher mode: xts 63 …ockdev-create", "arguments": {"job-id": "job0", "options": {"cipher-alg": "aes-128", "cipher-mode"… 76 cipher alg: aes-128 78 cipher mode: cbc 132 cipher alg: aes-256 134 cipher mode: xts 203 cipher alg: aes-256 205 cipher mode: xts
|
| A D | 198.out | 44 cipher alg: aes-256 47 cipher mode: xts 90 cipher alg: aes-256 93 cipher mode: xts
|
| /qemu/backends/ |
| A D | cryptodev-builtin.c | 44 QCryptoCipher *cipher; member 223 QCryptoCipher *cipher; in cryptodev_builtin_create_cipher_session() local 290 cipher = qcrypto_cipher_new(algo, mode, in cryptodev_builtin_create_cipher_session() 294 if (!cipher) { in cryptodev_builtin_create_cipher_session() 299 sess->cipher = cipher; in cryptodev_builtin_create_cipher_session() 436 if (session->cipher) { in cryptodev_builtin_close_session() 437 qcrypto_cipher_free(session->cipher); in cryptodev_builtin_close_session() 463 ret = qcrypto_cipher_setiv(sess->cipher, op_info->iv, in cryptodev_builtin_sym_operation() 471 ret = qcrypto_cipher_encrypt(sess->cipher, op_info->src, in cryptodev_builtin_sym_operation() 477 ret = qcrypto_cipher_decrypt(sess->cipher, op_info->src, in cryptodev_builtin_sym_operation()
|
| /qemu/qapi/ |
| A D | crypto.json | 205 # @cipher-alg: the cipher algorithm for data encryption Currently 208 # @cipher-mode: the cipher mode for data encryption Currently defaults 227 'data': { '*cipher-alg': 'QCryptoCipherAlgo', 228 '*cipher-mode': 'QCryptoCipherMode', 301 # @cipher-alg: the cipher algorithm for data encryption 303 # @cipher-mode: the cipher mode for data encryption 324 'data': {'cipher-alg': 'QCryptoCipherAlgo', 325 'cipher-mode': 'QCryptoCipherMode', 607 # @alg: encryption cipher algorithm
|
| A D | cryptodev.json | 30 # @cipher: Symmetric Key Cipher service 43 'data': ['cipher', 'hash', 'mac', 'aead', 'akcipher']}
|