Lines Matching defs:ciphertext

1916     string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_PKCS7);
1917 string plaintext = DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_PKCS7);
1970 string ciphertext = EncryptMessage(message, KM_PAD_NONE);
1971 EXPECT_EQ(256U / 8, ciphertext.size());
1974 string plaintext = DecryptMessage(ciphertext, KM_PAD_NONE);
2092 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2093 EXPECT_EQ(key_size / 8, ciphertext.size());
2095 string plaintext = DecryptMessage(ciphertext, KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2109 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_224, KM_PAD_RSA_OAEP);
2110 EXPECT_EQ(key_size / 8, ciphertext.size());
2112 string plaintext = DecryptMessage(ciphertext, KM_DIGEST_SHA_2_224, KM_PAD_RSA_OAEP);
2169 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2177 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &result, &input_consumed));
2213 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP);
2214 EXPECT_EQ(key_size / 8, ciphertext.size());
2216 // Corrupt the ciphertext
2217 ciphertext[key_size / 8 / 2]++;
2225 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &result, &input_consumed));
2254 string ciphertext = EncryptMessage(message, KM_PAD_RSA_PKCS1_1_5_ENCRYPT);
2255 EXPECT_EQ(512U / 8, ciphertext.size());
2257 string plaintext = DecryptMessage(ciphertext, KM_PAD_RSA_PKCS1_1_5_ENCRYPT);
2292 string ciphertext = EncryptMessage(message, digest, padding);
2293 EXPECT_EQ(key_size / 8, ciphertext.size());
2295 string plaintext = DecryptMessage(ciphertext, digest, padding);
2325 string ciphertext = EncryptMessage(string(message), KM_PAD_RSA_PKCS1_1_5_ENCRYPT);
2326 EXPECT_EQ(512U / 8, ciphertext.size());
2328 // Corrupt the ciphertext
2329 ciphertext[512 / 8 / 2]++;
2336 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &result, &input_consumed));
2427 string ciphertext;
2429 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(message, &ciphertext, &input_consumed));
2431 EXPECT_EQ(KM_ERROR_INVALID_INPUT_LENGTH, FinishOperation(&ciphertext));
2445 string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_PKCS7);
2446 EXPECT_EQ(i + 16 - (i % 16), ciphertext.size());
2447 string plaintext = DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_PKCS7);
2479 string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_PKCS7);
2480 EXPECT_EQ(16U, ciphertext.size());
2481 EXPECT_NE(ciphertext, message);
2482 ++ciphertext[ciphertext.size() / 2];
2490 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(ciphertext, &plaintext, &input_consumed));
2491 EXPECT_EQ(ciphertext.size(), input_consumed);
2537 string ciphertext;
2541 UpdateOperation(message.substr(i, increment), &ciphertext, &input_consumed));
2542 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2543 EXPECT_EQ(message.size(), ciphertext.size());
2554 for (size_t i = 0; i < ciphertext.size(); i += increment)
2556 UpdateOperation(ciphertext.substr(i, increment), &plaintext, &input_consumed));
2558 EXPECT_EQ(ciphertext.size(), plaintext.size());
2568 const char* ciphertext;
2607 const string ciphertext = hex2str(test.ciphertext);
2608 CheckAesCtrTestVector(key, nonce, plaintext, ciphertext);
2755 string ciphertext;
2759 UpdateOperation(message.substr(i, increment), &ciphertext, &input_consumed));
2760 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2761 EXPECT_EQ(message.size(), ciphertext.size());
2772 for (size_t i = 0; i < ciphertext.size(); i += increment)
2774 UpdateOperation(ciphertext.substr(i, increment), &plaintext, &input_consumed));
2776 EXPECT_EQ(ciphertext.size(), plaintext.size());
2792 string ciphertext = EncryptMessage(message, KM_MODE_CBC, KM_PAD_PKCS7, &iv);
2793 EXPECT_EQ(i + 16 - (i % 16), ciphertext.size());
2794 string plaintext = DecryptMessage(ciphertext, KM_MODE_CBC, KM_PAD_PKCS7, iv);
2820 string ciphertext;
2823 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
2826 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2835 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
2837 EXPECT_EQ(ciphertext.size(), input_consumed);
2886 string ciphertext;
2889 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
2892 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
2912 uint8_t ciphertext[] = {
2919 string ciphertext_str(reinterpret_cast<char*>(ciphertext), sizeof(ciphertext));
2985 string ciphertext;
2989 &ciphertext, &input_consumed));
2991 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3000 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3002 EXPECT_EQ(ciphertext.size(), input_consumed);
3026 string ciphertext;
3032 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, "", &update_out_params, &ciphertext,
3035 EXPECT_EQ(0U, ciphertext.size());
3041 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(empty_params, "a", &update_out_params, &ciphertext,
3045 EXPECT_EQ(1000U, ciphertext.size());
3048 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3049 EXPECT_EQ(1016U, ciphertext.size());
3068 for (size_t i = 0; i < ciphertext.length(); ++i) {
3069 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(empty_params, string(ciphertext.data() + i, 1),
3098 string ciphertext;
3102 &ciphertext, &input_consumed));
3106 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3109 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3121 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3123 EXPECT_EQ(ciphertext.size(), input_consumed);
3152 string ciphertext;
3154 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3157 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3169 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3171 EXPECT_EQ(ciphertext.size(), input_consumed);
3196 string ciphertext;
3198 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3201 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3208 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3210 EXPECT_EQ(ciphertext.size(), input_consumed);
3238 string ciphertext;
3240 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, message, &update_out_params, &ciphertext,
3243 EXPECT_EQ(KM_ERROR_OK, FinishOperation(&ciphertext));
3246 (*ciphertext.rbegin())++;
3255 EXPECT_EQ(KM_ERROR_OK, UpdateOperation(update_params, ciphertext, &update_out_params,
3257 EXPECT_EQ(ciphertext.size(), input_consumed);
3678 string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_NONE);
3679 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_NONE));
3702 ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_NONE);
3703 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_NONE));
3724 string ciphertext = EncryptMessage(message, KM_PAD_NONE);
3725 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_PAD_NONE));
3747 ciphertext = EncryptMessage(message, KM_PAD_NONE);
3748 EXPECT_EQ(message, DecryptMessage(ciphertext, KM_PAD_NONE));