+
+RUNNER_TEST(T7000_Encrypted_initial_values)
+{
+ int temp;
+ std::string message = "16c9efbc342777c0e36d59019582d59be8385bdea5497cf092f99ce5430498e9";
+ std::string iv = "6162636465666768696a6b6c6d6e6f70";
+
+ std::string expected = "ShortTestMessage";
+
+ CKM::CryptoAlgorithm algo;
+ CKM::RawBuffer messageBin = hexToBin(message);
+ CKM::RawBuffer ivBin = hexToBin(iv);
+ CKM::RawBuffer decrypted;
+
+ algo.setParam(CKM::ParamName::ALGO_TYPE, CKM::AlgoType::AES_CBC);
+ algo.setParam(CKM::ParamName::ED_IV, ivBin);
+
+ auto mgr = CKM::Manager::create();
+ RUNNER_ASSERT_MSG(CKM_API_SUCCESS == (temp = mgr->decrypt(algo, "/System TEI_0", CKM::Password(), messageBin, decrypted)), "Failed to decrypt " << CKMErrorToString(temp));
+ RUNNER_ASSERT_MSG(std::string(decrypted.begin(), decrypted.end()) == expected, "Data does not match");
+}
+