load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

package(default_visibility = ["//:__subpackages__"])  # keep

licenses(["notice"])  # keep

go_library(
    name = "aead",
    srcs = [
        "aead.go",
        "aead_factory.go",
        "aead_key_templates.go",
        "aes_ctr_hmac_aead_key_manager.go",
        "aes_gcm_key_manager.go",
        "aes_gcm_siv_key_manager.go",
        "chacha20poly1305_key_manager.go",
        "kms_envelope_aead.go",
        "kms_envelope_aead_key_manager.go",
        "xchacha20poly1305_key_manager.go",
    ],
    importpath = "github.com/google/tink/go/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//aead/subtle",
        "//core/cryptofmt",
        "//core/primitiveset",
        "//core/registry",
        "//internal/internalregistry",
        "//internal/monitoringutil",
        "//keyset",
        "//mac/subtle",
        "//monitoring",
        "//proto/aes_ctr_go_proto",
        "//proto/aes_ctr_hmac_aead_go_proto",
        "//proto/aes_gcm_go_proto",
        "//proto/aes_gcm_siv_go_proto",
        "//proto/chacha20_poly1305_go_proto",
        "//proto/common_go_proto",
        "//proto/hmac_go_proto",
        "//proto/kms_envelope_go_proto",
        "//proto/tink_go_proto",
        "//proto/xchacha20_poly1305_go_proto",
        "//subtle/random",
        "//tink",
        "@org_golang_google_protobuf//proto",
        "@org_golang_x_crypto//chacha20poly1305",
    ],
)

go_test(
    name = "aead_test",
    srcs = [
        "aead_factory_test.go",
        "aead_key_templates_test.go",
        "aead_test.go",
        "aes_ctr_hmac_aead_key_manager_test.go",
        "aes_gcm_key_manager_test.go",
        "aes_gcm_siv_key_manager_test.go",
        "chacha20poly1305_key_manager_test.go",
        "kms_envelope_aead_test.go",
        "xchacha20poly1305_key_manager_test.go",
    ],
    deps = [
        ":aead",
        "//aead/subtle",
        "//core/cryptofmt",
        "//core/registry",
        "//internal/internalregistry",
        "//keyset",
        "//monitoring",
        "//proto/aes_ctr_hmac_aead_go_proto",
        "//proto/aes_gcm_go_proto",
        "//proto/aes_gcm_siv_go_proto",
        "//proto/chacha20_poly1305_go_proto",
        "//proto/tink_go_proto",
        "//proto/xchacha20_poly1305_go_proto",
        "//signature",
        "//subtle/random",
        "//testing/fakekms",
        "//testing/fakemonitoring",
        "//testkeyset",
        "//testutil",
        "//tink",
        "@com_github_google_go_cmp//cmp",
        "@com_github_google_go_cmp//cmp/cmpopts",
        "@org_golang_google_protobuf//proto",
        "@org_golang_x_crypto//chacha20poly1305",
    ],
)

alias(
    name = "go_default_library",
    actual = ":aead",
    visibility = ["//visibility:public"],
)
