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

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

go_library(
    name = "subtle",
    srcs = [
        "aes_ctr.go",
        "aes_gcm.go",
        "aes_gcm_siv.go",
        "chacha20poly1305.go",
        "encrypt_then_authenticate.go",
        "ind_cpa.go",
        "polyval.go",
        "subtle.go",
        "xchacha20poly1305.go",
    ],
    importpath = "github.com/google/tink/go/aead/subtle",
    deps = [
        "//internal/aead",
        "//subtle/random",
        "//tink",
        "@org_golang_x_crypto//chacha20poly1305",
    ],
)

go_test(
    name = "subtle_test",
    srcs = [
        "aes_ctr_test.go",
        "aes_gcm_siv_test.go",
        "aes_gcm_test.go",
        "chacha20poly1305_test.go",
        "chacha20poly1305_vectors_test.go",
        "encrypt_then_authenticate_test.go",
        "polyval_test.go",
        "subtle_test.go",
        "xchacha20poly1305_test.go",
        "xchacha20poly1305_vectors_test.go",
    ],
    data = ["@wycheproof//testvectors:all"],
    deps = [
        ":subtle",
        "//mac/subtle",
        "//subtle/random",
        "//testutil",
        "//tink",
        "@org_golang_x_crypto//chacha20poly1305",
    ],
)

alias(
    name = "go_default_library",
    actual = ":subtle",
    visibility = ["//:__subpackages__"],
)
