/openbmc/qemu/include/crypto/ |
H A D | cipher.h | 2 * QEMU Crypto cipher algorithms 48 * QCryptoCipher *cipher; 54 * error_report(errp, "Feature <blah> requires AES cipher support"); 58 * cipher = qcrypto_cipher_new(QCRYPTO_CIPHER_ALGO_AES_128, 62 * if (!cipher) { 66 * if (qcrypto_cipher_set_iv(cipher, iv, keylen, errp) < 0) { 70 * if (qcrypto_cipher_encrypt(cipher, rawdata, encdata, datalen, errp) < 0) { 74 * qcrypto_cipher_free(cipher); 88 * @alg: the cipher algorithm 89 * @mode: the cipher mode [all …]
|
H A D | xts.h | 2 * QEMU Crypto XTS cipher mode 39 * @datactx: the cipher context for data decryption 40 * @tweakctx: the cipher context for tweak decryption 41 * @encfunc: the cipher function for encryption 42 * @decfunc: the cipher function for decryption 61 * @datactx: the cipher context for data encryption 62 * @tweakctx: the cipher context for tweak encryption 63 * @encfunc: the cipher function for encryption 64 * @decfunc: the cipher function for decryption
|
H A D | ivgen.h | 24 #include "crypto/cipher.h" 29 * vectors for block encryption schemes using chained cipher modes 55 * QCryptoCipher *cipher = qcrypto_cipher_new(QCRYPTO_CIPHER_ALGO_AES_128, 58 * if (!cipher) { 71 * if (qcrypto_cipher_setiv(cipher, iv, niv, errp) < 0) { 74 * if (qcrypto_cipher_encrypt(cipher, 86 * qcrypto_cipher_free(cipher); 92 * qcrypto_cipher_free(cipher); 106 * @cipheralg: the cipher algorithm or 0 177 * Get the cipher algorithm used by this IV generator (if [all …]
|
/openbmc/qemu/crypto/ |
H A D | cipher.c | 2 * QEMU Crypto cipher algorithms 24 #include "crypto/cipher.h" 110 error_setg(errp, "Cipher algorithm %d out of range", in qcrypto_cipher_validate_key_length() 122 error_setg(errp, "XTS cipher key length should be a multiple of 2"); in qcrypto_cipher_validate_key_length() 127 error_setg(errp, "Cipher key length %zu should be %zu", in qcrypto_cipher_validate_key_length() 133 error_setg(errp, "Cipher key length %zu should be %zu", in qcrypto_cipher_validate_key_length() 142 #include "cipher-gcrypt.c.inc" 144 #include "cipher-nettle.c.inc" 146 #include "cipher-gnutls.c.inc" 148 #include "cipher-stub.c.inc" [all …]
|
H A D | block.c | 238 /* Usually there is a free cipher available */ in qcrypto_block_pop_cipher() 246 /* Otherwise allocate a new cipher */ in qcrypto_block_pop_cipher() 253 QCryptoCipher *cipher) in qcrypto_block_push_cipher() argument 264 block->free_ciphers[block->n_free_ciphers] = cipher; in qcrypto_block_push_cipher() 275 QCryptoCipher *cipher; in qcrypto_block_init_cipher() local 280 /* Stash away cipher parameters for qcrypto_block_pop_cipher() */ in qcrypto_block_init_cipher() 287 * Create a new cipher to validate the parameters now. This reduces the in qcrypto_block_init_cipher() 288 * chance of cipher creation failing at I/O time. in qcrypto_block_init_cipher() 290 cipher = qcrypto_block_pop_cipher(block, errp); in qcrypto_block_init_cipher() 291 if (!cipher) { in qcrypto_block_init_cipher() [all …]
|
H 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, 152 QCryptoCipherGcrypt *ctx = container_of(cipher, QCryptoCipherGcrypt, base); 171 static int qcrypto_gcrypt_setiv(QCryptoCipher *cipher, 175 QCryptoCipherGcrypt *ctx = container_of(cipher, QCryptoCipherGcrypt, base); 194 static int qcrypto_gcrypt_ctr_setiv(QCryptoCipher *cipher, [all …]
|
H A D | ivgen-essiv.c | 27 QCryptoCipher *cipher; member 40 nsalt = qcrypto_cipher_get_key_len(ivgen->cipher); in qcrypto_ivgen_essiv_init() 54 /* Now potentially truncate salt to match cipher key len */ 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()
|
H A D | cipher-afalg.c | 2 * QEMU Crypto af_alg-backend cipher support 16 #include "crypto/cipher.h" 50 error_setg(errp, "Unsupported cipher algorithm %d", alg); in qcrypto_afalg_cipher_format_name() 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() [all …]
|
H A D | cipherpriv.h | 2 * QEMU Crypto cipher driver supports 21 int (*cipher_encrypt)(QCryptoCipher *cipher, 27 int (*cipher_decrypt)(QCryptoCipher *cipher, 33 int (*cipher_setiv)(QCryptoCipher *cipher, 37 void (*cipher_free)(QCryptoCipher *cipher);
|
H A D | tls-cipher-suites.c | 2 * QEMU TLS Cipher Suites 15 #include "crypto/tls-cipher-suites.h" 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()
|
H 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, 153 QCryptoCipherGnutls *ctx = container_of(cipher, QCryptoCipherGnutls, base); 179 error_setg(errp, "Cannot initialize cipher: %s", 207 qcrypto_gnutls_cipher_setiv(QCryptoCipher *cipher, [all …]
|
H 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, \ 113 TYPE *ctx = container_of(cipher, TYPE, base); \ [all …]
|
/openbmc/openbmc-test-automation/ipmi/ |
H A D | test_ipmi_cipher.robot | 13 Suite Setup IPMI Cipher Suite Setup 30 FOR ${cipher} IN @{valid_ciphers} 31 Run External IPMI Standard Command power status C=${cipher} 38 FOR ${cipher} IN @{unsupported_ciphers} 40 ... Run External IPMI Standard Command power status C=${cipher} 49 # Example 'RMCP+ Cipher Suites' entry: 3,17 50 ${ciphers}= Split String ${lan_print['RMCP+ Cipher Suites']} , 55 Verify Supported Cipher Via Getciphers 75 # Example cipher entry: 3 17 82 Verify Cipher Suit [all...] |
/openbmc/qemu/tests/unit/ |
H A D | test-crypto-cipher.c | 2 * QEMU Crypto cipher algorithms 24 #include "crypto/cipher.h" 45 .path = "/crypto/cipher/aes-ecb-128", 62 .path = "/crypto/cipher/aes-ecb-192", 79 .path = "/crypto/cipher/aes-ecb-256", 98 .path = "/crypto/cipher/aes-cbc-128", 116 .path = "/crypto/cipher/aes-cbc-192", 134 .path = "/crypto/cipher/aes-cbc-256", 158 .path = "/crypto/cipher/des-ecb-56-one-block", 167 .path = "/crypto/cipher/des-cbc-56-one-block", [all …]
|
H 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() 402 return "LUKS header cipher name is not NUL terminated"; in luks_bad_null_term_cipher_name() 411 return "LUKS header cipher mode is not NUL terminated"; in luks_bad_null_term_cipher_mode() 441 return "XTS cipher key length should be a multiple of 2"; in luks_bad_cipher_xts_size() 456 return "Unexpected cipher mode string format ''"; in luks_bad_cipher_mode_empty() 463 return "Unexpected cipher mode string format 'xfs'"; in luks_bad_cipher_mode_unknown() [all …]
|
/openbmc/phosphor-host-ipmid/app/ |
H A D | channel.cpp | 30 namespace cipher namespace 33 /** @brief Get the supported Cipher records 35 * The cipher records are read from the JSON file and converted into 36 * 1. cipher suite record format mentioned in the IPMI specification. The 37 * records can be either OEM or standard cipher. Each json entry is parsed and 38 * converted into the cipher record format and pushed into the vector. 41 * @return pair of vector containing 1. all the cipher suite records. 2. 55 lg2::error("Channel Cipher suites file not found"); in getCipherRecords() 62 lg2::error("Parsing channel cipher suites JSON failed"); in getCipherRecords() 70 // OEM cipher suite - 0xC1 in getCipherRecords() [all …]
|
H A D | channel.hpp | 16 * - rspRecords - cipher suite records. 19 std::vector<uint8_t> // Cipher Records 26 namespace cipher namespace 33 static constexpr auto cipher = "cipher"; variable 43 } // namespace cipher
|
/openbmc/phosphor-host-ipmid/user_channel/ |
H A D | cipher_mgmt.hpp | 39 * @brief Class to provide cipher suite functionalities 49 /** @brief function to get cipher suite privileges from config file 51 * @param[in] chNum - channel number for which we want to get cipher suite 54 * @param[in] csPrivilegeLevels - gets filled by cipher suite privilege 62 /** @brief function to set/update cipher suite privileges in config file 64 * @param[in] chNum - channel number for which we want to update cipher 67 * @param[in] csPrivilegeLevels - cipher suite privilege levels to update 95 /** @brief convert to cipher suite privilege from string to value 99 * @return cipher suite privilege index 125 * @param[in] csFileName - user setting cipher suite privilege file name [all …]
|
/openbmc/qemu/tests/bench/ |
H A D | benchmark-crypto-cipher.c | 2 * QEMU Crypto cipher speed benchmark 16 #include "crypto/cipher.h" 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 [all …]
|
/openbmc/phosphor-net-ipmid/command/ |
H A D | channel_auth.cpp | 92 static constexpr const char* cipher = "cipher"; variable 102 /** @brief Get the supported Cipher records 104 * The cipher records are read from the JSON file and converted into 105 * 1. cipher suite record format mentioned in the IPMI specification. The 106 * records can be either OEM or standard cipher. Each json entry is parsed and 107 * converted into the cipher record format and pushed into the vector. 110 * @return pair of vector containing 1. all the cipher suite records. 2. 124 lg2::error("Channel Cipher suites file not found: {ERROR}", "ERROR", in getCipherRecords() 132 lg2::error("Parsing channel cipher suites JSON failed: {ERROR}", in getCipherRecords() 141 // OEM cipher suite - 0xC1 in getCipherRecords() [all …]
|
H A D | open_session.cpp | 33 if (!cipher::rakp_auth::Interface::isAlgorithmSupported( in openSession() 34 static_cast<cipher::rakp_auth::Algorithms>(request->authAlgo))) in openSession() 42 if (!cipher::integrity::Interface::isAlgorithmSupported( in openSession() 43 static_cast<cipher::integrity::Algorithms>(request->intAlgo))) in openSession() 67 if (!cipher::crypt::Interface::isAlgorithmSupported( in openSession() 68 static_cast<cipher::crypt::Algorithms>(request->confAlgo))) in openSession() 81 static_cast<cipher::rakp_auth::Algorithms>(request->authAlgo), in openSession() 82 static_cast<cipher::integrity::Algorithms>(request->intAlgo), in openSession() 83 static_cast<cipher::crypt::Algorithms>(request->confAlgo)); in openSession()
|
H A D | rakp34.cpp | 25 case cipher::integrity::Algorithms::HMAC_SHA1_96: in applyIntegrityAlgo() 28 std::make_unique<cipher::integrity::AlgoSHA1>( in applyIntegrityAlgo() 32 case cipher::integrity::Algorithms::HMAC_SHA256_128: in applyIntegrityAlgo() 35 std::make_unique<cipher::integrity::AlgoSHA256>( in applyIntegrityAlgo() 52 case cipher::crypt::Algorithms::AES_CBC_128: in applyCryptAlgo() 58 std::make_unique<cipher::crypt::AlgoAES128>(k2)); in applyCryptAlgo() 129 input.resize(cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN + in RAKP34() 138 std::advance(iter, cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN); in RAKP34() 188 input.resize(cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN + in RAKP34() 189 cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN + in RAKP34() [all …]
|
/openbmc/qemu/tests/qemu-iotests/ |
H 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 110 encrypt.cipher-alg=<str> - Name of encryption cipher algorithm 111 encrypt.cipher-mode=<str> - Name of encryption cipher mode 136 encrypt.cipher-alg=<str> - Name of encryption cipher algorithm 137 encrypt.cipher-mode=<str> - Name of encryption cipher mode 162 encrypt.cipher-alg=<str> - Name of encryption cipher algorithm 163 encrypt.cipher-mode=<str> - Name of encryption cipher mode [all …]
|
/openbmc/phosphor-net-ipmid/test/ |
H A D | cipher.cpp | 27 auto algoPtr = std::make_unique<cipher::integrity::AlgoSHA1>(sik); in TEST() 35 cipher::integrity::AlgoSHA1::SHA1_96_AUTHCODE_LENGTH)); in TEST() 65 output.resize(cipher::integrity::AlgoSHA1::SHA1_96_AUTHCODE_LENGTH); in TEST() 113 output.resize(cipher::integrity::AlgoSHA1::SHA1_96_AUTHCODE_LENGTH); in TEST() 129 auto algoPtr = std::make_unique<cipher::integrity::AlgoSHA1>(sik); in TEST() 164 auto algoPtr = std::make_unique<cipher::integrity::AlgoSHA1>(sik); in TEST() 189 auto algoPtr = std::make_unique<cipher::integrity::AlgoSHA256>(sik); in TEST() 198 cipher::integrity::AlgoSHA256::SHA256_128_AUTHCODE_LENGTH)); in TEST() 228 output.resize(cipher::integrity::AlgoSHA256::SHA256_128_AUTHCODE_LENGTH); in TEST() 277 output.resize(cipher::integrity::AlgoSHA256::SHA256_128_AUTHCODE_LENGTH); in TEST() [all …]
|
/openbmc/qemu/backends/ |
H A D | cryptodev-builtin.c | 2 * QEMU Cryptodev backend for QEMU cipher APIs 29 #include "crypto/cipher.h" 36 * name of backend that uses QEMU cipher API 44 QCryptoCipher *cipher; member 46 uint8_t type; /* cipher? hash? aead? */ 223 QCryptoCipher *cipher; in cryptodev_builtin_create_cipher_session() local 285 error_setg(errp, "Unsupported cipher alg :%u", in cryptodev_builtin_create_cipher_session() 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() [all …]
|