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

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

go_library(
    name = "hpke",
    srcs = [
        "aead.go",
        "aes_gcm_aead.go",
        "chacha20poly1305_aead.go",
        "context.go",
        "decrypt.go",
        "encrypt.go",
        "hkdf_kdf.go",
        "hpke.go",
        "kdf.go",
        "kem.go",
        "primitive_factory.go",
        "x25519_kem.go",
    ],
    importpath = "github.com/google/tink/go/hybrid/internal/hpke",
    deps = [
        "//internal/aead",
        "//proto/hpke_go_proto",
        "//subtle",
        "//tink",
        "@org_golang_x_crypto//chacha20poly1305",
        "@org_golang_x_crypto//hkdf",
    ],
)

go_test(
    name = "hpke_test",
    srcs = [
        "aes_gcm_aead_test.go",
        "chacha20poly1305_aead_test.go",
        "context_test.go",
        "encrypt_decrypt_test.go",
        "hkdf_kdf_test.go",
        "hpke_test.go",
        "primitive_factory_test.go",
        "x25519_kem_test.go",
    ],
    data = ["//testdata/testvectors:hpke_boringssl"],
    embed = [":hpke"],
    deps = [
        "//proto/hpke_go_proto",
        "//subtle",
        "//subtle/random",
        "//testutil",
    ],
)

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