aboutsummaryrefslogtreecommitdiff
path: root/cc/daead
diff options
context:
space:
mode:
authortholenst <tholenst@google.com>2020-10-12 01:16:19 -0700
committerCopybara-Service <copybara-worker@google.com>2020-10-12 01:17:02 -0700
commitce0e625d336e6db9f3d5ba3a0cce582f0fbec3e4 (patch)
tree9823ea5088478273fcceacb17a20a7beb82b4085 /cc/daead
parent33de788ae3a500fa4d857799e2b14e7a67497dd4 (diff)
downloadtink-ce0e625d336e6db9f3d5ba3a0cce582f0fbec3e4.tar.gz
Migrate GetOutputPrefix to use as input a KeyInfo instead of two elements from KeyInfo.
PiperOrigin-RevId: 336613763
Diffstat (limited to 'cc/daead')
-rw-r--r--cc/daead/BUILD.bazel1
-rw-r--r--cc/daead/CMakeLists.txt1
-rw-r--r--cc/daead/deterministic_aead_factory_test.cc5
3 files changed, 4 insertions, 3 deletions
diff --git a/cc/daead/BUILD.bazel b/cc/daead/BUILD.bazel
index 98ee83e94..5153ba999 100644
--- a/cc/daead/BUILD.bazel
+++ b/cc/daead/BUILD.bazel
@@ -165,6 +165,7 @@ cc_test(
"//:crypto_format",
"//:deterministic_aead",
"//:keyset_handle",
+ "//internal:key_info",
"//proto:aes_siv_cc_proto",
"//proto:tink_cc_proto",
"//util:status",
diff --git a/cc/daead/CMakeLists.txt b/cc/daead/CMakeLists.txt
index cb7ae4d58..74587e1e2 100644
--- a/cc/daead/CMakeLists.txt
+++ b/cc/daead/CMakeLists.txt
@@ -143,6 +143,7 @@ tink_cc_test(
tink::core::crypto_format
tink::core::deterministic_aead
tink::core::keyset_handle
+ tink::internal::key_info
tink::util::test_keyset_handle
tink::util::status
tink::util::test_util
diff --git a/cc/daead/deterministic_aead_factory_test.cc b/cc/daead/deterministic_aead_factory_test.cc
index bebe5bcdb..36619f4c0 100644
--- a/cc/daead/deterministic_aead_factory_test.cc
+++ b/cc/daead/deterministic_aead_factory_test.cc
@@ -21,6 +21,7 @@
#include "tink/daead/aes_siv_key_manager.h"
#include "tink/daead/deterministic_aead_config.h"
#include "tink/deterministic_aead.h"
+#include "tink/internal/key_info.h"
#include "tink/keyset_handle.h"
#include "tink/util/test_keyset_handle.h"
#include "tink/util/status.h"
@@ -99,9 +100,7 @@ TEST_F(DeterministicAeadFactoryTest, testPrimitive) {
EXPECT_TRUE(encrypt_result.ok()) << encrypt_result.status();
std::string ciphertext = encrypt_result.ValueOrDie();
std::string prefix =
- CryptoFormat::GetOutputPrefix(keyset.key(2).key_id(),
- keyset.key(2).output_prefix_type())
- .ValueOrDie();
+ CryptoFormat::GetOutputPrefix(KeyInfoFromKey(keyset.key(2))).ValueOrDie();
EXPECT_PRED_FORMAT2(testing::IsSubstring, prefix, ciphertext);
auto decrypt_result = daead->DecryptDeterministically(ciphertext, aad);