Skip to content
Snippets Groups Projects
Commit 467d83a9 authored by przydatek's avatar przydatek Committed by Tink Team
Browse files

Changing OutputPrefixType of C++ StreamingAead templates to RAW.

PiperOrigin-RevId: 239573037
GitOrigin-RevId: f078ed23b8ddd590975f342426f59cf4233d0f96
parent 932147ec
No related branches found
Tags rel_0_2_3
No related merge requests found
......@@ -34,7 +34,7 @@ KeyTemplate* NewAesGcmHkdfStreamingKeyTemplate(int ikm_size_in_bytes) {
KeyTemplate* key_template = new KeyTemplate;
key_template->set_type_url(
"type.googleapis.com/google.crypto.tink.AesGcmHkdfStreamingKey");
key_template->set_output_prefix_type(OutputPrefixType::TINK);
key_template->set_output_prefix_type(OutputPrefixType::RAW);
AesGcmHkdfStreamingKeyFormat key_format;
key_format.set_key_size(ikm_size_in_bytes);
auto params = key_format.mutable_params();
......
......@@ -41,7 +41,7 @@ class StreamingAeadKeyTemplates {
// - HKDF algorithm: HMAC-SHA256
// - size of derived AES-GCM keys: 16 bytes
// - ciphertext segment size: 4096 bytes
// - OutputPrefixType: TINK
// - OutputPrefixType: RAW
static const google::crypto::tink::KeyTemplate& Aes128GcmHkdf4KB();
// Returns a KeyTemplate that generates new instances of
......@@ -50,7 +50,7 @@ class StreamingAeadKeyTemplates {
// - HKDF algorithm: HMAC-SHA256
// - size of derived AES-GCM keys: 32 bytes
// - ciphertext segment size: 4096 bytes
// - OutputPrefixType: TINK
// - OutputPrefixType: RAW
static const google::crypto::tink::KeyTemplate& Aes256GcmHkdf4KB();
};
......
......@@ -41,7 +41,7 @@ TEST(StreamingAeadKeyTemplatesTest, testAesGcmHkdfStreamingKeyTemplates) {
const KeyTemplate& key_template =
StreamingAeadKeyTemplates::Aes128GcmHkdf4KB();
EXPECT_EQ(type_url, key_template.type_url());
EXPECT_EQ(OutputPrefixType::TINK, key_template.output_prefix_type());
EXPECT_EQ(OutputPrefixType::RAW, key_template.output_prefix_type());
AesGcmHkdfStreamingKeyFormat key_format;
EXPECT_TRUE(key_format.ParseFromString(key_template.value()));
EXPECT_EQ(16, key_format.key_size());
......@@ -67,7 +67,7 @@ TEST(StreamingAeadKeyTemplatesTest, testAesGcmHkdfStreamingKeyTemplates) {
const KeyTemplate& key_template =
StreamingAeadKeyTemplates::Aes256GcmHkdf4KB();
EXPECT_EQ(type_url, key_template.type_url());
EXPECT_EQ(OutputPrefixType::TINK, key_template.output_prefix_type());
EXPECT_EQ(OutputPrefixType::RAW, key_template.output_prefix_type());
AesGcmHkdfStreamingKeyFormat key_format;
EXPECT_TRUE(key_format.ParseFromString(key_template.value()));
EXPECT_EQ(32, key_format.key_size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment