aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwconner <wconner@google.com>2023-07-25 08:29:35 -0700
committerCopybara-Service <copybara-worker@google.com>2023-07-25 08:35:38 -0700
commit9e430be535b0c833287966d74c7bcd0981acbfcb (patch)
tree5c7fe84be965036001564df04a9bcd57b05ee177
parentd502bc7488388f8a37d69faa1ee7fb70f4f9d457 (diff)
downloadtink-9e430be535b0c833287966d74c7bcd0981acbfcb.tar.gz
Update output prefix comments for C++ key types.
PiperOrigin-RevId: 550894598
-rw-r--r--cc/aead/aead_key.h7
-rw-r--r--cc/daead/deterministic_aead_key.h7
-rw-r--r--cc/mac/mac_key.h7
3 files changed, 6 insertions, 15 deletions
diff --git a/cc/aead/aead_key.h b/cc/aead/aead_key.h
index 869ddc83c..8645e289c 100644
--- a/cc/aead/aead_key.h
+++ b/cc/aead/aead_key.h
@@ -34,11 +34,8 @@ class AeadKey : public Key {
// have an associated ciphertext output prefix. When decrypting a ciphertext,
// only keys with a matching prefix have to be tried.
//
- // Note that a priori, the output prefix may not be unique in a keyset
- // (i.e., different keys in a keyset may have the same prefix or one prefix
- // may be a prefix of another). To avoid this, built-in Tink keys use the
- // convention that the prefix is either '0x00<big endian key id>' or
- // '0x01<big endian key id>'.
+ // See https://developers.google.com/tink/wire-format#tink_output_prefix for
+ // more background information on Tink output prefixes.
virtual absl::string_view GetOutputPrefix() const = 0;
const AeadParameters& GetParameters() const override = 0;
diff --git a/cc/daead/deterministic_aead_key.h b/cc/daead/deterministic_aead_key.h
index 15347541a..9aaa89698 100644
--- a/cc/daead/deterministic_aead_key.h
+++ b/cc/daead/deterministic_aead_key.h
@@ -34,11 +34,8 @@ class DeterministicAeadKey : public Key {
// Deterministic AEAD key to have an associated ciphertext output prefix. When
// decrypting a ciphertext, only keys with a matching prefix have to be tried.
//
- // Note that a priori, the output prefix may not be unique in a keyset
- // (i.e., different keys in a keyset may have the same prefix or one prefix
- // may be a prefix of another). To avoid this, built-in Tink keys use the
- // convention that the prefix is either '0x00<big endian key id>' or
- // '0x01<big endian key id>'.
+ // See https://developers.google.com/tink/wire-format#tink_output_prefix for
+ // more background information on Tink output prefixes.
virtual absl::string_view GetOutputPrefix() const = 0;
const DeterministicAeadParameters& GetParameters() const override = 0;
diff --git a/cc/mac/mac_key.h b/cc/mac/mac_key.h
index d02933cf6..65f8ddb50 100644
--- a/cc/mac/mac_key.h
+++ b/cc/mac/mac_key.h
@@ -35,11 +35,8 @@ class MacKey : public Key {
// have an associated tag output prefix. When verifying a tag, only keys with
// a matching prefix have to be tried.
//
- // Note that a priori, the output prefix may not be unique in a keyset
- // (i.e., different keys in a keyset may have the same prefix or one prefix
- // may be a prefix of another). To avoid this, built-in Tink keys use the
- // convention that the prefix is either '0x00<big endian key id>' or
- // '0x01<big endian key id>'.
+ // See https://developers.google.com/tink/wire-format#tink_output_prefix for
+ // more background information on Tink output prefixes.
virtual absl::string_view GetOutputPrefix() const = 0;
const MacParameters& GetParameters() const override = 0;