blob: 77f5534e657f60df7bf7e16861018deb1f47ed5d [file] [log] [blame]
package(default_visibility = ["//:__subpackages__"])
licenses(["notice"])
cc_library(
name = "mac_wrapper",
srcs = ["mac_wrapper.cc"],
hdrs = ["mac_wrapper.h"],
include_prefix = "tink/mac",
deps = [
"//:crypto_format",
"//:mac",
"//:primitive_set",
"//:primitive_wrapper",
"//internal:monitoring_util",
"//internal:registry_impl",
"//internal:util",
"//monitoring",
"//proto:tink_cc_proto",
"//util:status",
"//util:statusor",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "mac_config",
srcs = ["mac_config.cc"],
hdrs = ["mac_config.h"],
include_prefix = "tink/mac",
visibility = ["//visibility:public"],
deps = [
":aes_cmac_key_manager",
":aes_cmac_proto_serialization",
":hmac_key_manager",
":hmac_proto_serialization",
":mac_wrapper",
"//:registry",
"//config:config_util",
"//config:tink_fips",
"//mac/internal:chunked_mac_wrapper",
"//proto:config_cc_proto",
"//util:status",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/memory",
],
)
cc_library(
name = "mac_factory",
srcs = ["mac_factory.cc"],
hdrs = ["mac_factory.h"],
include_prefix = "tink/mac",
deps = [
":mac_wrapper",
"//:key_manager",
"//:keyset_handle",
"//:mac",
"//:registry",
"//util:status",
"//util:statusor",
"@com_google_absl//absl/base:core_headers",
],
)
cc_library(
name = "mac_key_templates",
srcs = ["mac_key_templates.cc"],
hdrs = ["mac_key_templates.h"],
include_prefix = "tink/mac",
visibility = ["//visibility:public"],
deps = [
"//proto:aes_cmac_cc_proto",
"//proto:common_cc_proto",
"//proto:hmac_cc_proto",
"//proto:tink_cc_proto",
],
)
cc_library(
name = "aes_cmac_key_manager",
hdrs = ["aes_cmac_key_manager.h"],
include_prefix = "tink/mac",
deps = [
"//:chunked_mac",
"//:core/key_type_manager",
"//:key_manager",
"//:mac",
"//mac/internal:chunked_mac_impl",
"//proto:aes_cmac_cc_proto",
"//proto:tink_cc_proto",
"//subtle:aes_cmac_boringssl",
"//subtle:random",
"//util:constants",
"//util:errors",
"//util:protobuf_helper",
"//util:secret_data",
"//util:status",
"//util:statusor",
"//util:validation",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "hmac_key_manager",
srcs = ["hmac_key_manager.cc"],
hdrs = ["hmac_key_manager.h"],
include_prefix = "tink/mac",
deps = [
"//:chunked_mac",
"//:core/key_type_manager",
"//:mac",
"//mac/internal:chunked_mac_impl",
"//proto:common_cc_proto",
"//proto:hmac_cc_proto",
"//proto:tink_cc_proto",
"//subtle:hmac_boringssl",
"//subtle:random",
"//util:constants",
"//util:enums",
"//util:errors",
"//util:input_stream_util",
"//util:protobuf_helper",
"//util:secret_data",
"//util:status",
"//util:statusor",
"//util:validation",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "mac_parameters",
hdrs = ["mac_parameters.h"],
include_prefix = "tink/mac",
deps = ["//:parameters"],
)
cc_library(
name = "mac_key",
hdrs = ["mac_key.h"],
include_prefix = "tink/mac",
deps = [
":mac_parameters",
"//:key",
"//util:statusor",
],
)
cc_library(
name = "failing_mac",
testonly = 1,
srcs = ["failing_mac.cc"],
hdrs = ["failing_mac.h"],
include_prefix = "tink/mac",
visibility = ["//visibility:public"],
deps = [
"//:mac",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "aes_cmac_parameters",
srcs = ["aes_cmac_parameters.cc"],
hdrs = ["aes_cmac_parameters.h"],
include_prefix = "tink/mac",
deps = [
":mac_parameters",
"//:crypto_format",
"//internal:util",
"//util:status",
"//util:statusor",
"@com_google_absl//absl/log",
],
)
cc_library(
name = "aes_cmac_key",
srcs = ["aes_cmac_key.cc"],
hdrs = ["aes_cmac_key.h"],
include_prefix = "tink/mac",
deps = [
":aes_cmac_parameters",
":mac_key",
"//:partial_key_access_token",
"//:restricted_data",
"//subtle:subtle_util",
"//util:status",
"//util:statusor",
"@boringssl//:crypto",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:optional",
],
)
cc_library(
name = "aes_cmac_proto_serialization",
srcs = ["aes_cmac_proto_serialization.cc"],
hdrs = ["aes_cmac_proto_serialization.h"],
include_prefix = "tink/mac",
deps = [
":aes_cmac_key",
":aes_cmac_parameters",
"//:partial_key_access",
"//:restricted_data",
"//:secret_key_access_token",
"//internal:key_parser",
"//internal:key_serializer",
"//internal:mutable_serialization_registry",
"//internal:parameters_parser",
"//internal:parameters_serializer",
"//internal:proto_key_serialization",
"//internal:proto_parameters_serialization",
"//proto:aes_cmac_cc_proto",
"//proto:tink_cc_proto",
"//util:status",
"//util:statusor",
"@com_google_absl//absl/status",
"@com_google_absl//absl/types:optional",
],
)
cc_library(
name = "hmac_parameters",
srcs = ["hmac_parameters.cc"],
hdrs = ["hmac_parameters.h"],
include_prefix = "tink/mac",
deps = [
":mac_parameters",
"//:crypto_format",
"//internal:util",
"//util:status",
"//util:statusor",
"@com_google_absl//absl/log",
],
)
cc_library(
name = "hmac_key",
srcs = ["hmac_key.cc"],
hdrs = ["hmac_key.h"],
include_prefix = "tink/mac",
deps = [
":hmac_parameters",
":mac_key",
"//:partial_key_access_token",
"//:restricted_data",
"//subtle:subtle_util",
"//util:status",
"//util:statusor",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:optional",
],
)
cc_library(
name = "hmac_proto_serialization",
srcs = ["hmac_proto_serialization.cc"],
hdrs = ["hmac_proto_serialization.h"],
include_prefix = "tink/mac",
deps = [
":hmac_key",
":hmac_parameters",
"//:partial_key_access",
"//:restricted_data",
"//:secret_key_access_token",
"//internal:key_parser",
"//internal:key_serializer",
"//internal:mutable_serialization_registry",
"//internal:parameters_parser",
"//internal:parameters_serializer",
"//internal:proto_key_serialization",
"//internal:proto_parameters_serialization",
"//proto:common_cc_proto",
"//proto:hmac_cc_proto",
"//proto:tink_cc_proto",
"//util:status",
"//util:statusor",
"@com_google_absl//absl/status",
"@com_google_absl//absl/types:optional",
],
)
# tests
cc_test(
name = "mac_wrapper_test",
size = "small",
srcs = ["mac_wrapper_test.cc"],
deps = [
":failing_mac",
":mac_wrapper",
"//:crypto_format",
"//:mac",
"//:primitive_set",
"//internal:registry_impl",
"//monitoring",
"//monitoring:monitoring_client_mocks",
"//proto:tink_cc_proto",
"//util:status",
"//util:test_matchers",
"//util:test_util",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "mac_config_test",
size = "small",
srcs = ["mac_config_test.cc"],
tags = ["fips"],
deps = [
":aes_cmac_key",
":aes_cmac_key_manager",
":aes_cmac_parameters",
":hmac_key",
":hmac_key_manager",
":hmac_parameters",
":mac_config",
":mac_key_templates",
"//:chunked_mac",
"//:insecure_secret_key_access",
"//:keyset_handle",
"//:mac",
"//:partial_key_access",
"//:registry",
"//internal:fips_utils",
"//internal:mutable_serialization_registry",
"//internal:proto_key_serialization",
"//internal:proto_parameters_serialization",
"//proto:common_cc_proto",
"//proto:tink_cc_proto",
"//util:status",
"//util:test_matchers",
"//util:test_util",
"@boringssl//:crypto",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "mac_factory_test",
size = "small",
srcs = ["mac_factory_test.cc"],
deps = [
":hmac_key_manager",
":mac_config",
":mac_factory",
"//:crypto_format",
"//:keyset_handle",
"//:mac",
"//internal:key_info",
"//proto:common_cc_proto",
"//proto:hmac_cc_proto",
"//proto:tink_cc_proto",
"//util:status",
"//util:test_keyset_handle",
"//util:test_util",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "mac_key_templates_test",
size = "small",
srcs = ["mac_key_templates_test.cc"],
deps = [
":aes_cmac_key_manager",
":hmac_key_manager",
":mac_key_templates",
"//:core/key_manager_impl",
"//proto:aes_cmac_cc_proto",
"//proto:common_cc_proto",
"//proto:hmac_cc_proto",
"//proto:tink_cc_proto",
"//util:test_matchers",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "aes_cmac_key_manager_test",
size = "small",
srcs = ["aes_cmac_key_manager_test.cc"],
deps = [
":aes_cmac_key_manager",
"//:chunked_mac",
"//:mac",
"//proto:aes_cmac_cc_proto",
"//util:status",
"//util:statusor",
"//util:test_matchers",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "hmac_key_manager_test",
size = "small",
srcs = ["hmac_key_manager_test.cc"],
deps = [
":hmac_key_manager",
"//:chunked_mac",
"//:core/key_manager_impl",
"//:mac",
"//proto:hmac_cc_proto",
"//util:istream_input_stream",
"//util:secret_data",
"//util:status",
"//util:statusor",
"//util:test_matchers",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "failing_mac_test",
srcs = ["failing_mac_test.cc"],
deps = [
":failing_mac",
"//util:test_matchers",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "aes_cmac_parameters_test",
size = "small",
srcs = ["aes_cmac_parameters_test.cc"],
deps = [
":aes_cmac_parameters",
"//util:statusor",
"//util:test_matchers",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "aes_cmac_key_test",
size = "small",
srcs = ["aes_cmac_key_test.cc"],
deps = [
":aes_cmac_key",
":aes_cmac_parameters",
"//:partial_key_access",
"//:restricted_data",
"//util:statusor",
"//util:test_matchers",
"@com_google_absl//absl/types:optional",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "aes_cmac_proto_serialization_test",
size = "small",
srcs = ["aes_cmac_proto_serialization_test.cc"],
deps = [
":aes_cmac_key",
":aes_cmac_parameters",
":aes_cmac_proto_serialization",
"//:insecure_secret_key_access",
"//:partial_key_access",
"//:restricted_data",
"//internal:mutable_serialization_registry",
"//internal:proto_key_serialization",
"//internal:proto_parameters_serialization",
"//proto:aes_cmac_cc_proto",
"//proto:tink_cc_proto",
"//subtle:random",
"//util:test_matchers",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "hmac_parameters_test",
size = "small",
srcs = ["hmac_parameters_test.cc"],
deps = [
":hmac_parameters",
"//util:statusor",
"//util:test_matchers",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "hmac_key_test",
srcs = ["hmac_key_test.cc"],
deps = [
":hmac_key",
":hmac_parameters",
"//:partial_key_access",
"//:restricted_data",
"//util:statusor",
"//util:test_matchers",
"@com_google_absl//absl/types:optional",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "hmac_proto_serialization_test",
srcs = ["hmac_proto_serialization_test.cc"],
deps = [
":hmac_key",
":hmac_parameters",
":hmac_proto_serialization",
"//:insecure_secret_key_access",
"//:partial_key_access",
"//:restricted_data",
"//internal:mutable_serialization_registry",
"//internal:proto_key_serialization",
"//internal:proto_parameters_serialization",
"//proto:common_cc_proto",
"//proto:hmac_cc_proto",
"//proto:tink_cc_proto",
"//subtle:random",
"//util:test_matchers",
"@com_google_googletest//:gtest_main",
],
)