diff --git a/cc/signature/ed25519_sign_key_manager.cc b/cc/signature/ed25519_sign_key_manager.cc index 8950bef5d5e18acccaec703579742d8f79518236..9b9d27b650b35e20288ba5cbb59dbe3daac5eb79 100644 --- a/cc/signature/ed25519_sign_key_manager.cc +++ b/cc/signature/ed25519_sign_key_manager.cc @@ -31,7 +31,6 @@ #include "tink/util/statusor.h" #include "tink/util/validation.h" #include "proto/ed25519.pb.h" -#include "proto/empty.pb.h" #include "proto/tink.pb.h" namespace crypto { @@ -40,12 +39,12 @@ namespace tink { using crypto::tink::util::Status; using crypto::tink::util::StatusOr; using google::crypto::tink::Ed25519PrivateKey; -using google::crypto::tink::Empty; +using google::crypto::tink::Ed25519KeyFormat; using google::crypto::tink::KeyData; class Ed25519PrivateKeyFactory : public PrivateKeyFactory, - public KeyFactoryBase<Ed25519PrivateKey, Empty> { + public KeyFactoryBase<Ed25519PrivateKey, Ed25519KeyFormat> { public: Ed25519PrivateKeyFactory() {} @@ -61,11 +60,12 @@ class Ed25519PrivateKeyFactory protected: StatusOr<std::unique_ptr<Ed25519PrivateKey>> NewKeyFromFormat( - const Empty& unused) const override; + const Ed25519KeyFormat& unused) const override; }; StatusOr<std::unique_ptr<Ed25519PrivateKey>> -Ed25519PrivateKeyFactory::NewKeyFromFormat(const Empty& unused) const { +Ed25519PrivateKeyFactory::NewKeyFromFormat( + const Ed25519KeyFormat& unused) const { auto key = subtle::SubtleUtilBoringSSL::GetNewEd25519Key(); // Build Ed25519PrivateKey. diff --git a/cc/signature/ed25519_sign_key_manager_test.cc b/cc/signature/ed25519_sign_key_manager_test.cc index 5c1ccf6c1b2ecd10e1080cc29024a0d37e538a97..36c4da86fb612e25a145f8af03bcaec3c2f8261b 100644 --- a/cc/signature/ed25519_sign_key_manager_test.cc +++ b/cc/signature/ed25519_sign_key_manager_test.cc @@ -30,15 +30,14 @@ #include "proto/aes_eax.pb.h" #include "proto/common.pb.h" #include "proto/ed25519.pb.h" -#include "proto/empty.pb.h" #include "proto/tink.pb.h" namespace crypto { namespace tink { using google::crypto::tink::AesEaxKey; +using google::crypto::tink::Ed25519KeyFormat; using google::crypto::tink::Ed25519PrivateKey; -using google::crypto::tink::Empty; using google::crypto::tink::KeyData; namespace { @@ -178,7 +177,7 @@ TEST_F(Ed25519SignKeyManagerTest, testPublicKeyExtractionErrors) { TEST_F(Ed25519SignKeyManagerTest, testNewKey) { Ed25519SignKeyManager key_manager; const KeyFactory& key_factory = key_manager.get_key_factory(); - Empty key_format; + Ed25519KeyFormat key_format; auto result = key_factory.NewKey(key_format); EXPECT_TRUE(result.ok()); } diff --git a/cc/signature/ed25519_verify_key_manager_test.cc b/cc/signature/ed25519_verify_key_manager_test.cc index 77ffdb2b4dd3dde75c28c063b1648bc25f4ab075..1629be08293d0389dd5c855636c511cd9159d0f8 100644 --- a/cc/signature/ed25519_verify_key_manager_test.cc +++ b/cc/signature/ed25519_verify_key_manager_test.cc @@ -27,16 +27,15 @@ #include "proto/aes_eax.pb.h" #include "proto/common.pb.h" #include "proto/ed25519.pb.h" -#include "proto/empty.pb.h" #include "proto/tink.pb.h" namespace crypto { namespace tink { using google::crypto::tink::AesEaxKey; +using google::crypto::tink::Ed25519KeyFormat; using google::crypto::tink::Ed25519PrivateKey; using google::crypto::tink::Ed25519PublicKey; -using google::crypto::tink::Empty; using google::crypto::tink::KeyData; namespace { @@ -146,7 +145,7 @@ TEST_F(Ed25519VerifyKeyManagerTest, testPrimitives) { TEST_F(Ed25519VerifyKeyManagerTest, testNewKey) { Ed25519VerifyKeyManager key_manager; const KeyFactory& key_factory = key_manager.get_key_factory(); - Empty key_format; + Ed25519KeyFormat key_format; auto result = key_factory.NewKey(key_format); EXPECT_FALSE(result.ok()); EXPECT_PRED_FORMAT2(testing::IsSubstring, diff --git a/cc/signature/signature_key_templates_test.cc b/cc/signature/signature_key_templates_test.cc index 448935dd3396071c2f9ef639ff8e1432da125c51..7499dfa9e45f162a14a81d28bd043d4f127d1132 100644 --- a/cc/signature/signature_key_templates_test.cc +++ b/cc/signature/signature_key_templates_test.cc @@ -29,7 +29,6 @@ #include "tink/subtle/subtle_util_boringssl.h" #include "proto/common.pb.h" #include "proto/ecdsa.pb.h" -#include "proto/empty.pb.h" #include "proto/rsa_ssa_pkcs1.pb.h" #include "proto/rsa_ssa_pss.pb.h" #include "proto/tink.pb.h" @@ -41,7 +40,7 @@ namespace { using google::crypto::tink::EcdsaKeyFormat; using google::crypto::tink::EcdsaSignatureEncoding; using google::crypto::tink::EllipticCurveType; -using google::crypto::tink::Empty; +using google::crypto::tink::Ed25519KeyFormat; using google::crypto::tink::HashType; using google::crypto::tink::KeyTemplate; using google::crypto::tink::OutputPrefixType; @@ -354,8 +353,8 @@ TEST(SignatureKeyTemplatesTest, KeyTemplatesWithEd25519) { // Check that the key manager works with the template. Ed25519SignKeyManager key_manager; EXPECT_EQ(key_manager.get_key_type(), key_template.type_url()); - Empty empty; - auto new_key_result = key_manager.get_key_factory().NewKey(empty); + Ed25519KeyFormat key_format; + auto new_key_result = key_manager.get_key_factory().NewKey(key_format); EXPECT_TRUE(new_key_result.ok()) << new_key_result.status(); } diff --git a/proto/ed25519.proto b/proto/ed25519.proto index 52a7b9ffa25c0e7cbdcb216ba40d786c75bc3ead..19b8789d0b80111bb27f6dbc6aefc159188d2fe3 100644 --- a/proto/ed25519.proto +++ b/proto/ed25519.proto @@ -26,6 +26,8 @@ option java_multiple_files = true; option objc_class_prefix = "TINKPB"; option go_package = "github.com/google/tink/proto/ed25519_go_proto"; +message Ed25519KeyFormat {} + // key_type: type.googleapis.com/google.crypto.tink.Ed25519PublicKey message Ed25519PublicKey { // Required.