Lines Matching defs:ciphertext

1832     string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_PKCS7);
1833 string plaintext = DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_PKCS7);
1886 string ciphertext = EncryptMessage(message, KM_PAD_NONE);
1887 EXPECT_EQ(256U / 8, ciphertext.size());
1890 string plaintext = DecryptMessage(ciphertext, KM_PAD_NONE);
2007 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2008 EXPECT_EQ(key_size / 8, ciphertext.size());
2010 string plaintext = DecryptMessage(ciphertext, KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2024 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_224, KM_PAD_RSA_OAEP);
2025 EXPECT_EQ(key_size / 8, ciphertext.size());
2027 string plaintext = DecryptMessage(ciphertext, KM_DIGEST_SHA_2_224, KM_PAD_RSA_OAEP);
2084 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2092 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &result, &input_consumed));
2128 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2129 EXPECT_EQ(key_size / 8, ciphertext.size());
2131 // Corrupt the ciphertext
2132 ciphertext[key_size / 8 / 2]++;
2140 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &result, &input_consumed));
2169 string ciphertext = EncryptMessage(message, KM_PAD_RSA_PKCS1_1_5_ENCRYPT);
2170 EXPECT_EQ(512U / 8, ciphertext.size());
2172 string plaintext = DecryptMessage(ciphertext, KM_PAD_RSA_PKCS1_1_5_ENCRYPT);
2207 string ciphertext = EncryptMessage(message, digest, padding);
2208 EXPECT_EQ(key_size / 8, ciphertext.size());
2210 string plaintext = DecryptMessage(ciphertext, digest, padding);
2240 string ciphertext = EncryptMessage(string(message), KM_PAD_RSA_PKCS1_1_5_ENCRYPT);
2241 EXPECT_EQ(512U / 8, ciphertext.size());
2243 // Corrupt the ciphertext
2244 ciphertext[512 / 8 / 2]++;
2251 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &result, &input_consumed));
2342 string ciphertext;
2343 EXPECT_EQ(KM_ERROR_INVALID_INPUT_LENGTH, FinishOperation(message, "", &ciphertext));
2357 string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_PKCS7);
2358 EXPECT_EQ(i + 16 - (i % 16), ciphertext.size());
2359 string plaintext = DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_PKCS7);
2391 string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_PKCS7);
2392 EXPECT_EQ(16U, ciphertext.size());
2393 EXPECT_NE(ciphertext, message);
2394 ++ciphertext[ciphertext.size() / 2];
2402 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &plaintext, &input_consumed));
2403 EXPECT_EQ(ciphertext.size(), input_consumed);
2449 string ciphertext;
2453 UpdateOperation(message.substr(i, increment), &ciphertext, &input_consumed));
2454 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2455 EXPECT_EQ(message.size(), ciphertext.size());
2466 for (size_t i = 0; i < ciphertext.size(); i += increment)
2468 UpdateOperation(ciphertext.substr(i, increment), &plaintext, &input_consumed));
2470 EXPECT_EQ(ciphertext.size(), plaintext.size());
2480 const char* ciphertext;
2519 const string ciphertext = hex2str(test.ciphertext);
2520 CheckAesCtrTestVector(key, nonce, plaintext, ciphertext);
2667 string ciphertext;
2671 UpdateOperation(message.substr(i, increment), &ciphertext, &input_consumed));
2672 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2673 EXPECT_EQ(message.size(), ciphertext.size());
2684 for (size_t i = 0; i < ciphertext.size(); i += increment)
2686 UpdateOperation(ciphertext.substr(i, increment), &plaintext, &input_consumed));
2688 EXPECT_EQ(ciphertext.size(), plaintext.size());
2704 string ciphertext = EncryptMessage(message, KM_MODE_CBC, KM_PAD_PKCS7, &iv);
2705 EXPECT_EQ(i + 16 - (i % 16), ciphertext.size());
2706 string plaintext = DecryptMessage(ciphertext, KM_MODE_CBC, KM_PAD_PKCS7, iv);
2732 string ciphertext;
2735 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
2738 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2747 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
2749 EXPECT_EQ(ciphertext.size(), input_consumed);
2798 string ciphertext;
2801 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
2804 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2824 uint8_t ciphertext[] = {
2831 string ciphertext_str(reinterpret_cast<char*>(ciphertext), sizeof(ciphertext));
2897 string ciphertext;
2901 &ciphertext, &input_consumed));
2903 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2912 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
2914 EXPECT_EQ(ciphertext.size(), input_consumed);
2938 string ciphertext;
2944 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, "", &update_out_params, &ciphertext,
2947 EXPECT_EQ(0U, ciphertext.size());
2953 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(empty_params, "a", &update_out_params, &ciphertext,
2957 EXPECT_EQ(1000U, ciphertext.size());
2960 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2961 EXPECT_EQ(1016U, ciphertext.size());
2980 for (size_t i = 0; i < ciphertext.length(); ++i) {
2981 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(empty_params, string(ciphertext.data() + i, 1),
3010 string ciphertext;
3014 &ciphertext, &input_consumed));
3018 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3021 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3033 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3035 EXPECT_EQ(ciphertext.size(), input_consumed);
3064 string ciphertext;
3066 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3069 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3081 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3083 EXPECT_EQ(ciphertext.size(), input_consumed);
3108 string ciphertext;
3110 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3113 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3120 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3122 EXPECT_EQ(ciphertext.size(), input_consumed);
3150 string ciphertext;
3152 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3155 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3158 (*ciphertext.rbegin())++;
3167 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3169 EXPECT_EQ(ciphertext.size(), input_consumed);
3593 string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_NONE);
3594 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_NONE));
3617 ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_NONE);
3618 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_NONE));
3639 string ciphertext = EncryptMessage(message, KM_PAD_NONE);
3640 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_PAD_NONE));
3662 ciphertext = EncryptMessage(message, KM_PAD_NONE);
3663 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_PAD_NONE));