From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Matt Clarkson <mattyclarkson@gmail.com>
Date: Thu, 9 May 2024 09:42:53 +0100
Subject: [PATCH] build: add Gazelle generated files

---
 BUILD.bazel                                   |  9 +++-
 abe/BUILD.bazel                               |  8 +++
 abe/cpabe/BUILD.bazel                         |  8 +++
 abe/cpabe/tkn20/BUILD.bazel                   | 30 +++++++++++
 abe/cpabe/tkn20/internal/dsl/BUILD.bazel      | 28 ++++++++++
 abe/cpabe/tkn20/internal/tkn/BUILD.bazel      | 42 +++++++++++++++
 bazel-bin                                     |  1 +
 bazel-circl                                   |  1 +
 bazel-out                                     |  1 +
 bazel-testlogs                                |  1 +
 blindsign/BUILD.bazel                         |  8 +++
 blindsign/blindrsa/BUILD.bazel                | 20 +++++++
 .../blindrsa/internal/common/BUILD.bazel      | 13 +++++
 blindsign/blindrsa/internal/keys/BUILD.bazel  |  8 +++
 .../blindrsa/partiallyblindrsa/BUILD.bazel    | 20 +++++++
 cipher/BUILD.bazel                            |  8 +++
 cipher/ascon/BUILD.bazel                      | 18 +++++++
 dh/BUILD.bazel                                |  8 +++
 dh/csidh/BUILD.bazel                          | 37 +++++++++++++
 dh/curve4q/BUILD.bazel                        | 19 +++++++
 dh/sidh/BUILD.bazel                           | 33 ++++++++++++
 dh/sidh/internal/common/BUILD.bazel           | 13 +++++
 dh/sidh/internal/p434/BUILD.bazel             | 40 ++++++++++++++
 dh/sidh/internal/p503/BUILD.bazel             | 42 +++++++++++++++
 dh/sidh/internal/p751/BUILD.bazel             | 42 +++++++++++++++
 dh/x25519/BUILD.bazel                         | 41 ++++++++++++++
 dh/x448/BUILD.bazel                           | 41 ++++++++++++++
 ecc/BUILD.bazel                               |  8 +++
 ecc/bls12381/BUILD.bazel                      | 41 ++++++++++++++
 ecc/bls12381/ff/BUILD.bazel                   | 39 ++++++++++++++
 ecc/fourq/BUILD.bazel                         | 54 +++++++++++++++++++
 ecc/goldilocks/BUILD.bazel                    | 39 ++++++++++++++
 ecc/p384/BUILD.bazel                          | 43 +++++++++++++++
 expander/BUILD.bazel                          | 20 +++++++
 group/BUILD.bazel                             | 31 +++++++++++
 hpke/BUILD.bazel                              | 45 ++++++++++++++++
 internal/conv/BUILD.bazel                     |  8 +++
 internal/nist/BUILD.bazel                     |  8 +++
 internal/sha3/BUILD.bazel                     | 26 +++++++++
 internal/test/BUILD.bazel                     |  8 +++
 kem/BUILD.bazel                               |  8 +++
 kem/frodo/BUILD.bazel                         | 18 +++++++
 kem/frodo/frodo640shake/BUILD.bazel           | 17 ++++++
 kem/hybrid/BUILD.bazel                        | 22 ++++++++
 kem/kyber/BUILD.bazel                         | 18 +++++++
 kem/kyber/kyber1024/BUILD.bazel               | 13 +++++
 kem/kyber/kyber512/BUILD.bazel                | 13 +++++
 kem/kyber/kyber768/BUILD.bazel                | 13 +++++
 kem/kyber/templates/BUILD.bazel               |  8 +++
 kem/schemes/BUILD.bazel                       | 23 ++++++++
 kem/sike/BUILD.bazel                          |  8 +++
 kem/sike/sikep434/BUILD.bazel                 | 13 +++++
 kem/sike/sikep503/BUILD.bazel                 | 13 +++++
 kem/sike/sikep751/BUILD.bazel                 | 13 +++++
 kem/sike/templates/BUILD.bazel                |  8 +++
 math/BUILD.bazel                              | 21 ++++++++
 math/fp25519/BUILD.bazel                      | 33 ++++++++++++
 math/fp448/BUILD.bazel                        | 36 +++++++++++++
 math/mlsbset/BUILD.bazel                      | 22 ++++++++
 math/polynomial/BUILD.bazel                   | 19 +++++++
 oprf/BUILD.bazel                              | 32 +++++++++++
 ot/BUILD.bazel                                |  8 +++
 ot/simot/BUILD.bazel                          | 22 ++++++++
 pke/BUILD.bazel                               |  8 +++
 pke/kyber/BUILD.bazel                         |  8 +++
 pke/kyber/internal/common/BUILD.bazel         | 39 ++++++++++++++
 pke/kyber/internal/common/asm/BUILD.bazel     | 20 +++++++
 pke/kyber/internal/common/params/BUILD.bazel  |  8 +++
 pke/kyber/kyber1024/BUILD.bazel               |  9 ++++
 pke/kyber/kyber1024/internal/BUILD.bazel      | 23 ++++++++
 pke/kyber/kyber512/BUILD.bazel                |  9 ++++
 pke/kyber/kyber512/internal/BUILD.bazel       | 23 ++++++++
 pke/kyber/kyber768/BUILD.bazel                |  9 ++++
 pke/kyber/kyber768/internal/BUILD.bazel       | 23 ++++++++
 pke/kyber/templates/BUILD.bazel               |  8 +++
 pki/BUILD.bazel                               | 21 ++++++++
 secretsharing/BUILD.bazel                     | 25 +++++++++
 sign/BUILD.bazel                              |  8 +++
 sign/bls/BUILD.bazel                          | 25 +++++++++
 sign/dilithium/BUILD.bazel                    | 39 ++++++++++++++
 sign/dilithium/internal/common/BUILD.bazel    | 38 +++++++++++++
 .../dilithium/internal/common/asm/BUILD.bazel | 20 +++++++
 .../internal/common/params/BUILD.bazel        |  8 +++
 sign/dilithium/mode2/BUILD.bazel              | 12 +++++
 sign/dilithium/mode2/internal/BUILD.bazel     | 34 ++++++++++++
 sign/dilithium/mode2aes/BUILD.bazel           | 12 +++++
 sign/dilithium/mode2aes/internal/BUILD.bazel  | 34 ++++++++++++
 sign/dilithium/mode3/BUILD.bazel              | 12 +++++
 sign/dilithium/mode3/internal/BUILD.bazel     | 34 ++++++++++++
 sign/dilithium/mode3aes/BUILD.bazel           | 12 +++++
 sign/dilithium/mode3aes/internal/BUILD.bazel  | 34 ++++++++++++
 sign/dilithium/mode5/BUILD.bazel              | 12 +++++
 sign/dilithium/mode5/internal/BUILD.bazel     | 34 ++++++++++++
 sign/dilithium/mode5aes/BUILD.bazel           | 12 +++++
 sign/dilithium/mode5aes/internal/BUILD.bazel  | 34 ++++++++++++
 sign/dilithium/templates/BUILD.bazel          |  8 +++
 sign/ed25519/BUILD.bazel                      | 41 ++++++++++++++
 sign/ed448/BUILD.bazel                        | 30 +++++++++++
 sign/eddilithium2/BUILD.bazel                 | 26 +++++++++
 sign/eddilithium3/BUILD.bazel                 | 26 +++++++++
 sign/schemes/BUILD.bazel                      | 24 +++++++++
 simd/BUILD.bazel                              |  8 +++
 simd/keccakf1600/BUILD.bazel                  | 30 +++++++++++
 simd/keccakf1600/internal/asm/BUILD.bazel     | 18 +++++++
 tss/BUILD.bazel                               |  8 +++
 tss/rsa/BUILD.bazel                           | 31 +++++++++++
 tss/rsa/internal/BUILD.bazel                  |  8 +++
 tss/rsa/internal/pss/BUILD.bazel              | 11 ++++
 xof/BUILD.bazel                               | 23 ++++++++
 xof/k12/BUILD.bazel                           | 18 +++++++
 zk/BUILD.bazel                                |  8 +++
 zk/dl/BUILD.bazel                             | 18 +++++++
 zk/dleq/BUILD.bazel                           | 19 +++++++
 zk/qndleq/BUILD.bazel                         | 18 +++++++
 114 files changed, 2330 insertions(+), 1 deletion(-)
 create mode 100644 abe/BUILD.bazel
 create mode 100644 abe/cpabe/BUILD.bazel
 create mode 100644 abe/cpabe/tkn20/BUILD.bazel
 create mode 100644 abe/cpabe/tkn20/internal/dsl/BUILD.bazel
 create mode 100644 abe/cpabe/tkn20/internal/tkn/BUILD.bazel
 create mode 120000 bazel-bin
 create mode 120000 bazel-circl
 create mode 120000 bazel-out
 create mode 120000 bazel-testlogs
 create mode 100644 blindsign/BUILD.bazel
 create mode 100644 blindsign/blindrsa/BUILD.bazel
 create mode 100644 blindsign/blindrsa/internal/common/BUILD.bazel
 create mode 100644 blindsign/blindrsa/internal/keys/BUILD.bazel
 create mode 100644 blindsign/blindrsa/partiallyblindrsa/BUILD.bazel
 create mode 100644 cipher/BUILD.bazel
 create mode 100644 cipher/ascon/BUILD.bazel
 create mode 100644 dh/BUILD.bazel
 create mode 100644 dh/csidh/BUILD.bazel
 create mode 100644 dh/curve4q/BUILD.bazel
 create mode 100644 dh/sidh/BUILD.bazel
 create mode 100644 dh/sidh/internal/common/BUILD.bazel
 create mode 100644 dh/sidh/internal/p434/BUILD.bazel
 create mode 100644 dh/sidh/internal/p503/BUILD.bazel
 create mode 100644 dh/sidh/internal/p751/BUILD.bazel
 create mode 100644 dh/x25519/BUILD.bazel
 create mode 100644 dh/x448/BUILD.bazel
 create mode 100644 ecc/BUILD.bazel
 create mode 100644 ecc/bls12381/BUILD.bazel
 create mode 100644 ecc/bls12381/ff/BUILD.bazel
 create mode 100644 ecc/fourq/BUILD.bazel
 create mode 100644 ecc/goldilocks/BUILD.bazel
 create mode 100644 ecc/p384/BUILD.bazel
 create mode 100644 expander/BUILD.bazel
 create mode 100644 group/BUILD.bazel
 create mode 100644 hpke/BUILD.bazel
 create mode 100644 internal/conv/BUILD.bazel
 create mode 100644 internal/nist/BUILD.bazel
 create mode 100644 internal/sha3/BUILD.bazel
 create mode 100644 internal/test/BUILD.bazel
 create mode 100644 kem/BUILD.bazel
 create mode 100644 kem/frodo/BUILD.bazel
 create mode 100644 kem/frodo/frodo640shake/BUILD.bazel
 create mode 100644 kem/hybrid/BUILD.bazel
 create mode 100644 kem/kyber/BUILD.bazel
 create mode 100644 kem/kyber/kyber1024/BUILD.bazel
 create mode 100644 kem/kyber/kyber512/BUILD.bazel
 create mode 100644 kem/kyber/kyber768/BUILD.bazel
 create mode 100644 kem/kyber/templates/BUILD.bazel
 create mode 100644 kem/schemes/BUILD.bazel
 create mode 100644 kem/sike/BUILD.bazel
 create mode 100644 kem/sike/sikep434/BUILD.bazel
 create mode 100644 kem/sike/sikep503/BUILD.bazel
 create mode 100644 kem/sike/sikep751/BUILD.bazel
 create mode 100644 kem/sike/templates/BUILD.bazel
 create mode 100644 math/BUILD.bazel
 create mode 100644 math/fp25519/BUILD.bazel
 create mode 100644 math/fp448/BUILD.bazel
 create mode 100644 math/mlsbset/BUILD.bazel
 create mode 100644 math/polynomial/BUILD.bazel
 create mode 100644 oprf/BUILD.bazel
 create mode 100644 ot/BUILD.bazel
 create mode 100644 ot/simot/BUILD.bazel
 create mode 100644 pke/BUILD.bazel
 create mode 100644 pke/kyber/BUILD.bazel
 create mode 100644 pke/kyber/internal/common/BUILD.bazel
 create mode 100644 pke/kyber/internal/common/asm/BUILD.bazel
 create mode 100644 pke/kyber/internal/common/params/BUILD.bazel
 create mode 100644 pke/kyber/kyber1024/BUILD.bazel
 create mode 100644 pke/kyber/kyber1024/internal/BUILD.bazel
 create mode 100644 pke/kyber/kyber512/BUILD.bazel
 create mode 100644 pke/kyber/kyber512/internal/BUILD.bazel
 create mode 100644 pke/kyber/kyber768/BUILD.bazel
 create mode 100644 pke/kyber/kyber768/internal/BUILD.bazel
 create mode 100644 pke/kyber/templates/BUILD.bazel
 create mode 100644 pki/BUILD.bazel
 create mode 100644 secretsharing/BUILD.bazel
 create mode 100644 sign/BUILD.bazel
 create mode 100644 sign/bls/BUILD.bazel
 create mode 100644 sign/dilithium/BUILD.bazel
 create mode 100644 sign/dilithium/internal/common/BUILD.bazel
 create mode 100644 sign/dilithium/internal/common/asm/BUILD.bazel
 create mode 100644 sign/dilithium/internal/common/params/BUILD.bazel
 create mode 100644 sign/dilithium/mode2/BUILD.bazel
 create mode 100644 sign/dilithium/mode2/internal/BUILD.bazel
 create mode 100644 sign/dilithium/mode2aes/BUILD.bazel
 create mode 100644 sign/dilithium/mode2aes/internal/BUILD.bazel
 create mode 100644 sign/dilithium/mode3/BUILD.bazel
 create mode 100644 sign/dilithium/mode3/internal/BUILD.bazel
 create mode 100644 sign/dilithium/mode3aes/BUILD.bazel
 create mode 100644 sign/dilithium/mode3aes/internal/BUILD.bazel
 create mode 100644 sign/dilithium/mode5/BUILD.bazel
 create mode 100644 sign/dilithium/mode5/internal/BUILD.bazel
 create mode 100644 sign/dilithium/mode5aes/BUILD.bazel
 create mode 100644 sign/dilithium/mode5aes/internal/BUILD.bazel
 create mode 100644 sign/dilithium/templates/BUILD.bazel
 create mode 100644 sign/ed25519/BUILD.bazel
 create mode 100644 sign/ed448/BUILD.bazel
 create mode 100644 sign/eddilithium2/BUILD.bazel
 create mode 100644 sign/eddilithium3/BUILD.bazel
 create mode 100644 sign/schemes/BUILD.bazel
 create mode 100644 simd/BUILD.bazel
 create mode 100644 simd/keccakf1600/BUILD.bazel
 create mode 100644 simd/keccakf1600/internal/asm/BUILD.bazel
 create mode 100644 tss/BUILD.bazel
 create mode 100644 tss/rsa/BUILD.bazel
 create mode 100644 tss/rsa/internal/BUILD.bazel
 create mode 100644 tss/rsa/internal/pss/BUILD.bazel
 create mode 100644 xof/BUILD.bazel
 create mode 100644 xof/k12/BUILD.bazel
 create mode 100644 zk/BUILD.bazel
 create mode 100644 zk/dl/BUILD.bazel
 create mode 100644 zk/dleq/BUILD.bazel
 create mode 100644 zk/qndleq/BUILD.bazel

diff --git a/BUILD.bazel b/BUILD.bazel
index 684a265..5e02e45 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1 +1,8 @@
-# Will be generated with `gazelle`
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "circl",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl",
+    visibility = ["//visibility:public"],
+)
diff --git a/abe/BUILD.bazel b/abe/BUILD.bazel
new file mode 100644
index 0000000..4ea5089
--- /dev/null
+++ b/abe/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "abe",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/abe",
+    visibility = ["//visibility:public"],
+)
diff --git a/abe/cpabe/BUILD.bazel b/abe/cpabe/BUILD.bazel
new file mode 100644
index 0000000..ed87919
--- /dev/null
+++ b/abe/cpabe/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "cpabe",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/abe/cpabe",
+    visibility = ["//visibility:public"],
+)
diff --git a/abe/cpabe/tkn20/BUILD.bazel b/abe/cpabe/tkn20/BUILD.bazel
new file mode 100644
index 0000000..5fea49d
--- /dev/null
+++ b/abe/cpabe/tkn20/BUILD.bazel
@@ -0,0 +1,30 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "tkn20",
+    srcs = ["tkn20.go"],
+    importpath = "github.com/cloudflare/circl/abe/cpabe/tkn20",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//abe/cpabe/tkn20/internal/dsl",
+        "//abe/cpabe/tkn20/internal/tkn",
+    ],
+)
+
+go_test(
+    name = "tkn20_test",
+    srcs = [
+        "bench_test.go",
+        "example_test.go",
+        "format_test.go",
+        "longpt_test.go",
+        "tkn20_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":tkn20"],
+    deps = [
+        "//internal/test",
+        "//xof",
+        "@org_golang_x_crypto//nacl/box:go_default_library",
+    ],
+)
diff --git a/abe/cpabe/tkn20/internal/dsl/BUILD.bazel b/abe/cpabe/tkn20/internal/dsl/BUILD.bazel
new file mode 100644
index 0000000..2854275
--- /dev/null
+++ b/abe/cpabe/tkn20/internal/dsl/BUILD.bazel
@@ -0,0 +1,28 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "dsl",
+    srcs = [
+        "ast.go",
+        "dsl.go",
+        "expr.go",
+        "interpreter.go",
+        "lexer.go",
+        "parser.go",
+        "tokens.go",
+        "util.go",
+    ],
+    importpath = "github.com/cloudflare/circl/abe/cpabe/tkn20/internal/dsl",
+    visibility = ["//abe/cpabe/tkn20:__subpackages__"],
+    deps = ["//abe/cpabe/tkn20/internal/tkn"],
+)
+
+go_test(
+    name = "dsl_test",
+    srcs = [
+        "dsl_test.go",
+        "lexer_test.go",
+    ],
+    embed = [":dsl"],
+    deps = ["//abe/cpabe/tkn20/internal/tkn"],
+)
diff --git a/abe/cpabe/tkn20/internal/tkn/BUILD.bazel b/abe/cpabe/tkn20/internal/tkn/BUILD.bazel
new file mode 100644
index 0000000..3ea135d
--- /dev/null
+++ b/abe/cpabe/tkn20/internal/tkn/BUILD.bazel
@@ -0,0 +1,42 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "tkn",
+    srcs = [
+        "bk.go",
+        "formula.go",
+        "matrixG1.go",
+        "matrixG2.go",
+        "matrixGT.go",
+        "matrixZp.go",
+        "pairAccum.go",
+        "policy.go",
+        "tk.go",
+        "util.go",
+    ],
+    importpath = "github.com/cloudflare/circl/abe/cpabe/tkn20/internal/tkn",
+    visibility = ["//abe/cpabe/tkn20:__subpackages__"],
+    deps = [
+        "//ecc/bls12381",
+        "@org_golang_x_crypto//blake2b:go_default_library",
+    ],
+)
+
+go_test(
+    name = "tkn_test",
+    srcs = [
+        "bk_test.go",
+        "formula_test.go",
+        "matrixG1_test.go",
+        "matrixG2_test.go",
+        "matrixGT_test.go",
+        "matrixZp_test.go",
+        "policy_test.go",
+        "tk_test.go",
+    ],
+    embed = [":tkn"],
+    deps = [
+        "//ecc/bls12381",
+        "//ecc/bls12381/ff",
+    ],
+)
diff --git a/bazel-bin b/bazel-bin
new file mode 120000
index 0000000..ad3b0ef
--- /dev/null
+++ b/bazel-bin
@@ -0,0 +1 @@
+/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/91e63453d8bf6da9d39a28550b62941f/execroot/_main/bazel-out/k8-fastbuild/bin
\ No newline at end of file
diff --git a/bazel-circl b/bazel-circl
new file mode 120000
index 0000000..c659aa8
--- /dev/null
+++ b/bazel-circl
@@ -0,0 +1 @@
+/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/91e63453d8bf6da9d39a28550b62941f/execroot/_main
\ No newline at end of file
diff --git a/bazel-out b/bazel-out
new file mode 120000
index 0000000..692ebb9
--- /dev/null
+++ b/bazel-out
@@ -0,0 +1 @@
+/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/91e63453d8bf6da9d39a28550b62941f/execroot/_main/bazel-out
\ No newline at end of file
diff --git a/bazel-testlogs b/bazel-testlogs
new file mode 120000
index 0000000..07e53ae
--- /dev/null
+++ b/bazel-testlogs
@@ -0,0 +1 @@
+/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/91e63453d8bf6da9d39a28550b62941f/execroot/_main/bazel-out/k8-fastbuild/testlogs
\ No newline at end of file
diff --git a/blindsign/BUILD.bazel b/blindsign/BUILD.bazel
new file mode 100644
index 0000000..05a2b9b
--- /dev/null
+++ b/blindsign/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "blindsign",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/blindsign",
+    visibility = ["//visibility:public"],
+)
diff --git a/blindsign/blindrsa/BUILD.bazel b/blindsign/blindrsa/BUILD.bazel
new file mode 100644
index 0000000..29dcbf5
--- /dev/null
+++ b/blindsign/blindrsa/BUILD.bazel
@@ -0,0 +1,20 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "blindrsa",
+    srcs = ["brsa.go"],
+    importpath = "github.com/cloudflare/circl/blindsign/blindrsa",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//blindsign/blindrsa/internal/common",
+        "//blindsign/blindrsa/internal/keys",
+    ],
+)
+
+go_test(
+    name = "blindrsa_test",
+    srcs = ["brsa_test.go"],
+    data = glob(["testdata/**"]),
+    embed = [":blindrsa"],
+    deps = ["//internal/test"],
+)
diff --git a/blindsign/blindrsa/internal/common/BUILD.bazel b/blindsign/blindrsa/internal/common/BUILD.bazel
new file mode 100644
index 0000000..a43e958
--- /dev/null
+++ b/blindsign/blindrsa/internal/common/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "common",
+    srcs = [
+        "common.go",
+        "pss.go",
+        "rsa.go",
+    ],
+    importpath = "github.com/cloudflare/circl/blindsign/blindrsa/internal/common",
+    visibility = ["//blindsign/blindrsa:__subpackages__"],
+    deps = ["//blindsign/blindrsa/internal/keys"],
+)
diff --git a/blindsign/blindrsa/internal/keys/BUILD.bazel b/blindsign/blindrsa/internal/keys/BUILD.bazel
new file mode 100644
index 0000000..2c36751
--- /dev/null
+++ b/blindsign/blindrsa/internal/keys/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "keys",
+    srcs = ["big_keys.go"],
+    importpath = "github.com/cloudflare/circl/blindsign/blindrsa/internal/keys",
+    visibility = ["//blindsign/blindrsa:__subpackages__"],
+)
diff --git a/blindsign/blindrsa/partiallyblindrsa/BUILD.bazel b/blindsign/blindrsa/partiallyblindrsa/BUILD.bazel
new file mode 100644
index 0000000..da53167
--- /dev/null
+++ b/blindsign/blindrsa/partiallyblindrsa/BUILD.bazel
@@ -0,0 +1,20 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "partiallyblindrsa",
+    srcs = ["pbrsa.go"],
+    importpath = "github.com/cloudflare/circl/blindsign/blindrsa/partiallyblindrsa",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//blindsign/blindrsa/internal/common",
+        "//blindsign/blindrsa/internal/keys",
+        "@org_golang_x_crypto//hkdf:go_default_library",
+    ],
+)
+
+go_test(
+    name = "partiallyblindrsa_test",
+    srcs = ["pbrsa_test.go"],
+    embed = [":partiallyblindrsa"],
+    deps = ["//blindsign/blindrsa/internal/keys"],
+)
diff --git a/cipher/BUILD.bazel b/cipher/BUILD.bazel
new file mode 100644
index 0000000..8f71a9f
--- /dev/null
+++ b/cipher/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "cipher",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/cipher",
+    visibility = ["//visibility:public"],
+)
diff --git a/cipher/ascon/BUILD.bazel b/cipher/ascon/BUILD.bazel
new file mode 100644
index 0000000..47a67ba
--- /dev/null
+++ b/cipher/ascon/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "ascon",
+    srcs = ["ascon.go"],
+    importpath = "github.com/cloudflare/circl/cipher/ascon",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "ascon_test",
+    srcs = ["ascon_test.go"],
+    data = glob(["testdata/**"]),
+    deps = [
+        ":ascon",
+        "//internal/test",
+    ],
+)
diff --git a/dh/BUILD.bazel b/dh/BUILD.bazel
new file mode 100644
index 0000000..6e8b431
--- /dev/null
+++ b/dh/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "dh",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/dh",
+    visibility = ["//visibility:public"],
+)
diff --git a/dh/csidh/BUILD.bazel b/dh/csidh/BUILD.bazel
new file mode 100644
index 0000000..a8f882d
--- /dev/null
+++ b/dh/csidh/BUILD.bazel
@@ -0,0 +1,37 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "csidh",
+    srcs = [
+        "consts.go",
+        "csidh.go",
+        "curve.go",
+        "doc.go",
+        "fp511.go",
+        "fp511_amd64.go",
+        "fp511_amd64.s",
+        "fp511_generic.go",
+        "fp511_noasm.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/csidh",
+    visibility = ["//visibility:public"],
+    deps = select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "csidh_test",
+    srcs = [
+        "csidh_test.go",
+        "curve_test.go",
+        "fp511_test.go",
+        "utils_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":csidh"],
+    deps = ["//internal/test"],
+)
diff --git a/dh/curve4q/BUILD.bazel b/dh/curve4q/BUILD.bazel
new file mode 100644
index 0000000..89ea59f
--- /dev/null
+++ b/dh/curve4q/BUILD.bazel
@@ -0,0 +1,19 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "curve4q",
+    srcs = [
+        "curve4Q.go",
+        "doc.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/curve4q",
+    visibility = ["//visibility:public"],
+    deps = ["//ecc/fourq"],
+)
+
+go_test(
+    name = "curve4q_test",
+    srcs = ["curve4Q_test.go"],
+    embed = [":curve4q"],
+    deps = ["//internal/test"],
+)
diff --git a/dh/sidh/BUILD.bazel b/dh/sidh/BUILD.bazel
new file mode 100644
index 0000000..9a8360d
--- /dev/null
+++ b/dh/sidh/BUILD.bazel
@@ -0,0 +1,33 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "sidh",
+    srcs = [
+        "doc.go",
+        "sidh.go",
+        "sike.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/sidh",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//dh/sidh/internal/common",
+        "//dh/sidh/internal/p434",
+        "//dh/sidh/internal/p503",
+        "//dh/sidh/internal/p751",
+        "//internal/sha3",
+    ],
+)
+
+go_test(
+    name = "sidh_test",
+    srcs = [
+        "sidh_test.go",
+        "sike_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":sidh"],
+    deps = [
+        "//dh/sidh/internal/common",
+        "//internal/test",
+    ],
+)
diff --git a/dh/sidh/internal/common/BUILD.bazel b/dh/sidh/internal/common/BUILD.bazel
new file mode 100644
index 0000000..0b32071
--- /dev/null
+++ b/dh/sidh/internal/common/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "common",
+    srcs = [
+        "doc.go",
+        "params.go",
+        "types.go",
+        "utils.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/sidh/internal/common",
+    visibility = ["//dh/sidh:__subpackages__"],
+)
diff --git a/dh/sidh/internal/p434/BUILD.bazel b/dh/sidh/internal/p434/BUILD.bazel
new file mode 100644
index 0000000..adce327
--- /dev/null
+++ b/dh/sidh/internal/p434/BUILD.bazel
@@ -0,0 +1,40 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "p434",
+    srcs = [
+        "arith_amd64.s",
+        "arith_decl.go",
+        "arith_generic.go",
+        "core.go",
+        "curve.go",
+        "fp2.go",
+        "params.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/sidh/internal/p434",
+    visibility = ["//dh/sidh:__subpackages__"],
+    deps = [
+        "//dh/sidh/internal/common",
+        "@org_golang_x_sys//cpu:go_default_library",
+    ],
+)
+
+go_test(
+    name = "p434_test",
+    srcs = [
+        "arith_amd64_test.go",
+        "arith_test.go",
+        "curve_test.go",
+        "fp2_test.go",
+        "params_test.go",
+    ],
+    embed = [":p434"],
+    deps = [
+        "//dh/sidh/internal/common",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff --git a/dh/sidh/internal/p503/BUILD.bazel b/dh/sidh/internal/p503/BUILD.bazel
new file mode 100644
index 0000000..ea958f1
--- /dev/null
+++ b/dh/sidh/internal/p503/BUILD.bazel
@@ -0,0 +1,42 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "p503",
+    srcs = [
+        "arith_amd64.s",
+        "arith_arm64.s",
+        "arith_decl.go",
+        "arith_generic.go",
+        "core.go",
+        "curve.go",
+        "doc.go",
+        "fp2.go",
+        "params.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/sidh/internal/p503",
+    visibility = ["//dh/sidh:__subpackages__"],
+    deps = [
+        "//dh/sidh/internal/common",
+        "@org_golang_x_sys//cpu:go_default_library",
+    ],
+)
+
+go_test(
+    name = "p503_test",
+    srcs = [
+        "arith_amd64_test.go",
+        "arith_test.go",
+        "curve_test.go",
+        "fp2_test.go",
+        "params_test.go",
+    ],
+    embed = [":p503"],
+    deps = [
+        "//dh/sidh/internal/common",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff --git a/dh/sidh/internal/p751/BUILD.bazel b/dh/sidh/internal/p751/BUILD.bazel
new file mode 100644
index 0000000..cb6e004
--- /dev/null
+++ b/dh/sidh/internal/p751/BUILD.bazel
@@ -0,0 +1,42 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "p751",
+    srcs = [
+        "arith_amd64.s",
+        "arith_arm64.s",
+        "arith_decl.go",
+        "arith_generic.go",
+        "core.go",
+        "curve.go",
+        "doc.go",
+        "fp2.go",
+        "params.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/sidh/internal/p751",
+    visibility = ["//dh/sidh:__subpackages__"],
+    deps = [
+        "//dh/sidh/internal/common",
+        "@org_golang_x_sys//cpu:go_default_library",
+    ],
+)
+
+go_test(
+    name = "p751_test",
+    srcs = [
+        "arith_amd64_test.go",
+        "arith_test.go",
+        "curve_test.go",
+        "fp2_test.go",
+        "params_test.go",
+    ],
+    embed = [":p751"],
+    deps = [
+        "//dh/sidh/internal/common",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff --git a/dh/x25519/BUILD.bazel b/dh/x25519/BUILD.bazel
new file mode 100644
index 0000000..bc34c40
--- /dev/null
+++ b/dh/x25519/BUILD.bazel
@@ -0,0 +1,41 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "x25519",
+    srcs = [
+        "curve.go",
+        "curve_amd64.go",
+        "curve_amd64.h",
+        "curve_amd64.s",
+        "curve_generic.go",
+        "curve_noasm.go",
+        "doc.go",
+        "key.go",
+        "table.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/x25519",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//math/fp25519",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "x25519_test",
+    srcs = [
+        "curve_test.go",
+        "key_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":x25519"],
+    deps = [
+        "//internal/conv",
+        "//internal/test",
+        "//math/fp25519",
+    ],
+)
diff --git a/dh/x448/BUILD.bazel b/dh/x448/BUILD.bazel
new file mode 100644
index 0000000..c9c94aa
--- /dev/null
+++ b/dh/x448/BUILD.bazel
@@ -0,0 +1,41 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "x448",
+    srcs = [
+        "curve.go",
+        "curve_amd64.go",
+        "curve_amd64.h",
+        "curve_amd64.s",
+        "curve_generic.go",
+        "curve_noasm.go",
+        "doc.go",
+        "key.go",
+        "table.go",
+    ],
+    importpath = "github.com/cloudflare/circl/dh/x448",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//math/fp448",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "x448_test",
+    srcs = [
+        "curve_test.go",
+        "key_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":x448"],
+    deps = [
+        "//internal/conv",
+        "//internal/test",
+        "//math/fp448",
+    ],
+)
diff --git a/ecc/BUILD.bazel b/ecc/BUILD.bazel
new file mode 100644
index 0000000..b17f58d
--- /dev/null
+++ b/ecc/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "ecc",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/ecc",
+    visibility = ["//visibility:public"],
+)
diff --git a/ecc/bls12381/BUILD.bazel b/ecc/bls12381/BUILD.bazel
new file mode 100644
index 0000000..77a2392
--- /dev/null
+++ b/ecc/bls12381/BUILD.bazel
@@ -0,0 +1,41 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "bls12381",
+    srcs = [
+        "constants.go",
+        "doc.go",
+        "ec2.go",
+        "g1.go",
+        "g1Isog.go",
+        "g2.go",
+        "g2Isog.go",
+        "gt.go",
+        "pair.go",
+    ],
+    importpath = "github.com/cloudflare/circl/ecc/bls12381",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//ecc/bls12381/ff",
+        "//expander",
+    ],
+)
+
+go_test(
+    name = "bls12381_test",
+    srcs = [
+        "encoding_test.go",
+        "g1_test.go",
+        "g2_test.go",
+        "gt_test.go",
+        "hash_test.go",
+        "pair_test.go",
+        "psi_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":bls12381"],
+    deps = [
+        "//ecc/bls12381/ff",
+        "//internal/test",
+    ],
+)
diff --git a/ecc/bls12381/ff/BUILD.bazel b/ecc/bls12381/ff/BUILD.bazel
new file mode 100644
index 0000000..5091d7c
--- /dev/null
+++ b/ecc/bls12381/ff/BUILD.bazel
@@ -0,0 +1,39 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "ff",
+    srcs = [
+        "common.go",
+        "cyclo6.go",
+        "doc.go",
+        "fp.go",
+        "fp12.go",
+        "fp12cubic.go",
+        "fp2.go",
+        "fp4.go",
+        "fp6.go",
+        "fpMont381.go",
+        "scMont255.go",
+        "scalar.go",
+        "uroot.go",
+    ],
+    importpath = "github.com/cloudflare/circl/ecc/bls12381/ff",
+    visibility = ["//visibility:public"],
+    deps = ["//internal/conv"],
+)
+
+go_test(
+    name = "ff_test",
+    srcs = [
+        "cyclo6_test.go",
+        "fp12_test.go",
+        "fp12cubic_test.go",
+        "fp2_test.go",
+        "fp6_test.go",
+        "fp_test.go",
+        "scalar_test.go",
+        "uroot_test.go",
+    ],
+    embed = [":ff"],
+    deps = ["//internal/test"],
+)
diff --git a/ecc/fourq/BUILD.bazel b/ecc/fourq/BUILD.bazel
new file mode 100644
index 0000000..f51b01b
--- /dev/null
+++ b/ecc/fourq/BUILD.bazel
@@ -0,0 +1,54 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "fourq",
+    srcs = [
+        "curve.go",
+        "doc.go",
+        "fp.go",
+        "fp_amd64.go",
+        "fp_amd64.h",
+        "fp_amd64.s",
+        "fp_generic.go",
+        "fp_noasm.go",
+        "fq.go",
+        "fq_amd64.go",
+        "fq_amd64.h",
+        "fq_amd64.s",
+        "fq_generic.go",
+        "fq_noasm.go",
+        "params.go",
+        "point.go",
+        "point_amd64.go",
+        "point_amd64.h",
+        "point_amd64.s",
+        "point_generic.go",
+        "point_noasm.go",
+        "tableBase.go",
+    ],
+    importpath = "github.com/cloudflare/circl/ecc/fourq",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/conv",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "fourq_test",
+    srcs = [
+        "curve_test.go",
+        "fp_test.go",
+        "fq_test.go",
+        "point_test.go",
+    ],
+    embed = [":fourq"],
+    deps = [
+        "//internal/conv",
+        "//internal/test",
+    ],
+)
diff --git a/ecc/goldilocks/BUILD.bazel b/ecc/goldilocks/BUILD.bazel
new file mode 100644
index 0000000..4c16597
--- /dev/null
+++ b/ecc/goldilocks/BUILD.bazel
@@ -0,0 +1,39 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "goldilocks",
+    srcs = [
+        "constants.go",
+        "curve.go",
+        "isogeny.go",
+        "point.go",
+        "scalar.go",
+        "twist.go",
+        "twistPoint.go",
+        "twistTables.go",
+        "twist_basemult.go",
+    ],
+    importpath = "github.com/cloudflare/circl/ecc/goldilocks",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/conv",
+        "//math",
+        "//math/fp448",
+        "//math/mlsbset",
+    ],
+)
+
+go_test(
+    name = "goldilocks_test",
+    srcs = [
+        "curve_test.go",
+        "isogeny_test.go",
+        "point_test.go",
+        "scalar_test.go",
+    ],
+    embed = [":goldilocks"],
+    deps = [
+        "//internal/conv",
+        "//internal/test",
+    ],
+)
diff --git a/ecc/p384/BUILD.bazel b/ecc/p384/BUILD.bazel
new file mode 100644
index 0000000..6bb70b1
--- /dev/null
+++ b/ecc/p384/BUILD.bazel
@@ -0,0 +1,43 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "p384",
+    srcs = [
+        "arith.go",
+        "arith_amd64.go",
+        "arith_amd64.s",
+        "arith_arm64.s",
+        "doc.go",
+        "p384.go",
+        "p384_generic.go",
+        "p384opt.go",
+        "point.go",
+        "tableBase.go",
+    ],
+    importpath = "github.com/cloudflare/circl/ecc/p384",
+    visibility = ["//visibility:public"],
+    deps = select({
+        "@rules_go//go/platform:amd64": [
+            "//internal/conv",
+            "//math",
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "@rules_go//go/platform:arm64": [
+            "//internal/conv",
+            "//math",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "p384_test",
+    srcs = [
+        "arith_test.go",
+        "opt_test.go",
+        "p384_test.go",
+        "point_test.go",
+    ],
+    embed = [":p384"],
+    deps = ["//internal/test"],
+)
diff --git a/expander/BUILD.bazel b/expander/BUILD.bazel
new file mode 100644
index 0000000..3d0049a
--- /dev/null
+++ b/expander/BUILD.bazel
@@ -0,0 +1,20 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "expander",
+    srcs = ["expander.go"],
+    importpath = "github.com/cloudflare/circl/expander",
+    visibility = ["//visibility:public"],
+    deps = ["//xof"],
+)
+
+go_test(
+    name = "expander_test",
+    srcs = ["expander_test.go"],
+    data = glob(["testdata/**"]),
+    deps = [
+        ":expander",
+        "//internal/test",
+        "//xof",
+    ],
+)
diff --git a/group/BUILD.bazel b/group/BUILD.bazel
new file mode 100644
index 0000000..ab11b11
--- /dev/null
+++ b/group/BUILD.bazel
@@ -0,0 +1,31 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "group",
+    srcs = [
+        "group.go",
+        "hash.go",
+        "ristretto255.go",
+        "short.go",
+    ],
+    importpath = "github.com/cloudflare/circl/group",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//ecc/p384",
+        "//expander",
+        "//internal/conv",
+        "@com_github_bwesterb_go_ristretto//:go_default_library",
+    ],
+)
+
+go_test(
+    name = "group_test",
+    srcs = [
+        "group_test.go",
+        "hash_test.go",
+        "ristretto255_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":group"],
+    deps = ["//internal/test"],
+)
diff --git a/hpke/BUILD.bazel b/hpke/BUILD.bazel
new file mode 100644
index 0000000..b534c17
--- /dev/null
+++ b/hpke/BUILD.bazel
@@ -0,0 +1,45 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "hpke",
+    srcs = [
+        "aead.go",
+        "algs.go",
+        "hpke.go",
+        "hybridkem.go",
+        "kembase.go",
+        "marshal.go",
+        "shortkem.go",
+        "util.go",
+        "xkem.go",
+    ],
+    importpath = "github.com/cloudflare/circl/hpke",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//dh/x25519",
+        "//dh/x448",
+        "//ecc/p384",
+        "//kem",
+        "//kem/kyber/kyber768",
+        "@org_golang_x_crypto//chacha20poly1305:go_default_library",
+        "@org_golang_x_crypto//cryptobyte:go_default_library",
+        "@org_golang_x_crypto//hkdf:go_default_library",
+    ],
+)
+
+go_test(
+    name = "hpke_test",
+    srcs = [
+        "aead_test.go",
+        "hpke_test.go",
+        "marshal_test.go",
+        "vectors_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":hpke"],
+    deps = [
+        "//internal/test",
+        "//kem",
+        "@org_golang_x_crypto//sha3:go_default_library",
+    ],
+)
diff --git a/internal/conv/BUILD.bazel b/internal/conv/BUILD.bazel
new file mode 100644
index 0000000..eeff0f5
--- /dev/null
+++ b/internal/conv/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "conv",
+    srcs = ["conv.go"],
+    importpath = "github.com/cloudflare/circl/internal/conv",
+    visibility = ["//:__subpackages__"],
+)
diff --git a/internal/nist/BUILD.bazel b/internal/nist/BUILD.bazel
new file mode 100644
index 0000000..f21eecb
--- /dev/null
+++ b/internal/nist/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "nist",
+    srcs = ["drbg.go"],
+    importpath = "github.com/cloudflare/circl/internal/nist",
+    visibility = ["//:__subpackages__"],
+)
diff --git a/internal/sha3/BUILD.bazel b/internal/sha3/BUILD.bazel
new file mode 100644
index 0000000..2b85d76
--- /dev/null
+++ b/internal/sha3/BUILD.bazel
@@ -0,0 +1,26 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "sha3",
+    srcs = [
+        "doc.go",
+        "hashes.go",
+        "keccakf.go",
+        "rc.go",
+        "sha3.go",
+        "sha3_s390x.s",
+        "shake.go",
+        "xor.go",
+        "xor_generic.go",
+        "xor_unaligned.go",
+    ],
+    importpath = "github.com/cloudflare/circl/internal/sha3",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "sha3_test",
+    srcs = ["sha3_test.go"],
+    data = glob(["testdata/**"]),
+    embed = [":sha3"],
+)
diff --git a/internal/test/BUILD.bazel b/internal/test/BUILD.bazel
new file mode 100644
index 0000000..2acfef8
--- /dev/null
+++ b/internal/test/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "test",
+    srcs = ["test.go"],
+    importpath = "github.com/cloudflare/circl/internal/test",
+    visibility = ["//:__subpackages__"],
+)
diff --git a/kem/BUILD.bazel b/kem/BUILD.bazel
new file mode 100644
index 0000000..599b960
--- /dev/null
+++ b/kem/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kem",
+    srcs = ["kem.go"],
+    importpath = "github.com/cloudflare/circl/kem",
+    visibility = ["//visibility:public"],
+)
diff --git a/kem/frodo/BUILD.bazel b/kem/frodo/BUILD.bazel
new file mode 100644
index 0000000..3bb9167
--- /dev/null
+++ b/kem/frodo/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "frodo",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/kem/frodo",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "frodo_test",
+    srcs = ["kat_test.go"],
+    embed = [":frodo"],
+    deps = [
+        "//internal/nist",
+        "//kem/schemes",
+    ],
+)
diff --git a/kem/frodo/frodo640shake/BUILD.bazel b/kem/frodo/frodo640shake/BUILD.bazel
new file mode 100644
index 0000000..8adad8f
--- /dev/null
+++ b/kem/frodo/frodo640shake/BUILD.bazel
@@ -0,0 +1,17 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "frodo640shake",
+    srcs = [
+        "frodo.go",
+        "matrix_shake.go",
+        "noise.go",
+        "util.go",
+    ],
+    importpath = "github.com/cloudflare/circl/kem/frodo/frodo640shake",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//kem",
+    ],
+)
diff --git a/kem/hybrid/BUILD.bazel b/kem/hybrid/BUILD.bazel
new file mode 100644
index 0000000..0718cdc
--- /dev/null
+++ b/kem/hybrid/BUILD.bazel
@@ -0,0 +1,22 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "hybrid",
+    srcs = [
+        "ckem.go",
+        "hybrid.go",
+        "xkem.go",
+    ],
+    importpath = "github.com/cloudflare/circl/kem/hybrid",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//dh/x25519",
+        "//dh/x448",
+        "//internal/sha3",
+        "//kem",
+        "//kem/kyber/kyber1024",
+        "//kem/kyber/kyber512",
+        "//kem/kyber/kyber768",
+        "//xof",
+    ],
+)
diff --git a/kem/kyber/BUILD.bazel b/kem/kyber/BUILD.bazel
new file mode 100644
index 0000000..742697e
--- /dev/null
+++ b/kem/kyber/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "kyber",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/kem/kyber",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "kyber_test",
+    srcs = ["kat_test.go"],
+    embed = [":kyber"],
+    deps = [
+        "//internal/nist",
+        "//kem/schemes",
+    ],
+)
diff --git a/kem/kyber/kyber1024/BUILD.bazel b/kem/kyber/kyber1024/BUILD.bazel
new file mode 100644
index 0000000..71fc1be
--- /dev/null
+++ b/kem/kyber/kyber1024/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kyber1024",
+    srcs = ["kyber.go"],
+    importpath = "github.com/cloudflare/circl/kem/kyber/kyber1024",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//kem",
+        "//pke/kyber/kyber1024",
+    ],
+)
diff --git a/kem/kyber/kyber512/BUILD.bazel b/kem/kyber/kyber512/BUILD.bazel
new file mode 100644
index 0000000..7bda0e3
--- /dev/null
+++ b/kem/kyber/kyber512/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kyber512",
+    srcs = ["kyber.go"],
+    importpath = "github.com/cloudflare/circl/kem/kyber/kyber512",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//kem",
+        "//pke/kyber/kyber512",
+    ],
+)
diff --git a/kem/kyber/kyber768/BUILD.bazel b/kem/kyber/kyber768/BUILD.bazel
new file mode 100644
index 0000000..7d2e784
--- /dev/null
+++ b/kem/kyber/kyber768/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kyber768",
+    srcs = ["kyber.go"],
+    importpath = "github.com/cloudflare/circl/kem/kyber/kyber768",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//kem",
+        "//pke/kyber/kyber768",
+    ],
+)
diff --git a/kem/kyber/templates/BUILD.bazel b/kem/kyber/templates/BUILD.bazel
new file mode 100644
index 0000000..0623b33
--- /dev/null
+++ b/kem/kyber/templates/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "templates",
+    srcs = ["pkg.templ.go"],
+    importpath = "github.com/cloudflare/circl/kem/kyber/templates",
+    visibility = ["//visibility:public"],
+)
diff --git a/kem/schemes/BUILD.bazel b/kem/schemes/BUILD.bazel
new file mode 100644
index 0000000..1c1c4fb
--- /dev/null
+++ b/kem/schemes/BUILD.bazel
@@ -0,0 +1,23 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "schemes",
+    srcs = ["schemes.go"],
+    importpath = "github.com/cloudflare/circl/kem/schemes",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//hpke",
+        "//kem",
+        "//kem/frodo/frodo640shake",
+        "//kem/hybrid",
+        "//kem/kyber/kyber1024",
+        "//kem/kyber/kyber512",
+        "//kem/kyber/kyber768",
+    ],
+)
+
+go_test(
+    name = "schemes_test",
+    srcs = ["schemes_test.go"],
+    deps = [":schemes"],
+)
diff --git a/kem/sike/BUILD.bazel b/kem/sike/BUILD.bazel
new file mode 100644
index 0000000..cda045c
--- /dev/null
+++ b/kem/sike/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "sike",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/kem/sike",
+    visibility = ["//visibility:public"],
+)
diff --git a/kem/sike/sikep434/BUILD.bazel b/kem/sike/sikep434/BUILD.bazel
new file mode 100644
index 0000000..e268670
--- /dev/null
+++ b/kem/sike/sikep434/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "sikep434",
+    srcs = ["sike.go"],
+    importpath = "github.com/cloudflare/circl/kem/sike/sikep434",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//dh/sidh",
+        "//internal/sha3",
+        "//kem",
+    ],
+)
diff --git a/kem/sike/sikep503/BUILD.bazel b/kem/sike/sikep503/BUILD.bazel
new file mode 100644
index 0000000..8d87a7c
--- /dev/null
+++ b/kem/sike/sikep503/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "sikep503",
+    srcs = ["sike.go"],
+    importpath = "github.com/cloudflare/circl/kem/sike/sikep503",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//dh/sidh",
+        "//internal/sha3",
+        "//kem",
+    ],
+)
diff --git a/kem/sike/sikep751/BUILD.bazel b/kem/sike/sikep751/BUILD.bazel
new file mode 100644
index 0000000..6bf402b
--- /dev/null
+++ b/kem/sike/sikep751/BUILD.bazel
@@ -0,0 +1,13 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "sikep751",
+    srcs = ["sike.go"],
+    importpath = "github.com/cloudflare/circl/kem/sike/sikep751",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//dh/sidh",
+        "//internal/sha3",
+        "//kem",
+    ],
+)
diff --git a/kem/sike/templates/BUILD.bazel b/kem/sike/templates/BUILD.bazel
new file mode 100644
index 0000000..fa199cd
--- /dev/null
+++ b/kem/sike/templates/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "templates",
+    srcs = ["pkg.templ.go"],
+    importpath = "github.com/cloudflare/circl/kem/sike/templates",
+    visibility = ["//visibility:public"],
+)
diff --git a/math/BUILD.bazel b/math/BUILD.bazel
new file mode 100644
index 0000000..66b9fcb
--- /dev/null
+++ b/math/BUILD.bazel
@@ -0,0 +1,21 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "math",
+    srcs = [
+        "primes.go",
+        "wnaf.go",
+    ],
+    importpath = "github.com/cloudflare/circl/math",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "math_test",
+    srcs = [
+        "primes_test.go",
+        "wnaf_test.go",
+    ],
+    embed = [":math"],
+    deps = ["//internal/test"],
+)
diff --git a/math/fp25519/BUILD.bazel b/math/fp25519/BUILD.bazel
new file mode 100644
index 0000000..454ea65
--- /dev/null
+++ b/math/fp25519/BUILD.bazel
@@ -0,0 +1,33 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "fp25519",
+    srcs = [
+        "fp.go",
+        "fp_amd64.go",
+        "fp_amd64.h",
+        "fp_amd64.s",
+        "fp_generic.go",
+        "fp_noasm.go",
+    ],
+    importpath = "github.com/cloudflare/circl/math/fp25519",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/conv",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "fp25519_test",
+    srcs = ["fp_test.go"],
+    embed = [":fp25519"],
+    deps = [
+        "//internal/conv",
+        "//internal/test",
+    ],
+)
diff --git a/math/fp448/BUILD.bazel b/math/fp448/BUILD.bazel
new file mode 100644
index 0000000..2730c6a
--- /dev/null
+++ b/math/fp448/BUILD.bazel
@@ -0,0 +1,36 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "fp448",
+    srcs = [
+        "fp.go",
+        "fp_amd64.go",
+        "fp_amd64.h",
+        "fp_amd64.s",
+        "fp_generic.go",
+        "fp_noasm.go",
+    ],
+    importpath = "github.com/cloudflare/circl/math/fp448",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/conv",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "fp448_test",
+    srcs = [
+        "edgecases_test.go",
+        "fp_test.go",
+    ],
+    embed = [":fp448"],
+    deps = [
+        "//internal/conv",
+        "//internal/test",
+    ],
+)
diff --git a/math/mlsbset/BUILD.bazel b/math/mlsbset/BUILD.bazel
new file mode 100644
index 0000000..2e1bacd
--- /dev/null
+++ b/math/mlsbset/BUILD.bazel
@@ -0,0 +1,22 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "mlsbset",
+    srcs = [
+        "mlsbset.go",
+        "power.go",
+    ],
+    importpath = "github.com/cloudflare/circl/math/mlsbset",
+    visibility = ["//visibility:public"],
+    deps = ["//internal/conv"],
+)
+
+go_test(
+    name = "mlsbset_test",
+    srcs = ["mlsbset_test.go"],
+    deps = [
+        ":mlsbset",
+        "//internal/conv",
+        "//internal/test",
+    ],
+)
diff --git a/math/polynomial/BUILD.bazel b/math/polynomial/BUILD.bazel
new file mode 100644
index 0000000..7f48e6f
--- /dev/null
+++ b/math/polynomial/BUILD.bazel
@@ -0,0 +1,19 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "polynomial",
+    srcs = ["polynomial.go"],
+    importpath = "github.com/cloudflare/circl/math/polynomial",
+    visibility = ["//visibility:public"],
+    deps = ["//group"],
+)
+
+go_test(
+    name = "polynomial_test",
+    srcs = ["polynomial_test.go"],
+    deps = [
+        ":polynomial",
+        "//group",
+        "//internal/test",
+    ],
+)
diff --git a/oprf/BUILD.bazel b/oprf/BUILD.bazel
new file mode 100644
index 0000000..bfb9146
--- /dev/null
+++ b/oprf/BUILD.bazel
@@ -0,0 +1,32 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "oprf",
+    srcs = [
+        "client.go",
+        "keys.go",
+        "oprf.go",
+        "server.go",
+    ],
+    importpath = "github.com/cloudflare/circl/oprf",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//group",
+        "//zk/dleq",
+    ],
+)
+
+go_test(
+    name = "oprf_test",
+    srcs = [
+        "oprf_test.go",
+        "vectors_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":oprf"],
+    deps = [
+        "//group",
+        "//internal/test",
+        "//zk/dleq",
+    ],
+)
diff --git a/ot/BUILD.bazel b/ot/BUILD.bazel
new file mode 100644
index 0000000..e24cbc6
--- /dev/null
+++ b/ot/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "ot",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/ot",
+    visibility = ["//visibility:public"],
+)
diff --git a/ot/simot/BUILD.bazel b/ot/simot/BUILD.bazel
new file mode 100644
index 0000000..2b68c89
--- /dev/null
+++ b/ot/simot/BUILD.bazel
@@ -0,0 +1,22 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "simot",
+    srcs = [
+        "simotlocal.go",
+        "simotparty.go",
+    ],
+    importpath = "github.com/cloudflare/circl/ot/simot",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//group",
+        "@org_golang_x_crypto//sha3:go_default_library",
+    ],
+)
+
+go_test(
+    name = "simot_test",
+    srcs = ["simot_test.go"],
+    embed = [":simot"],
+    deps = ["//group"],
+)
diff --git a/pke/BUILD.bazel b/pke/BUILD.bazel
new file mode 100644
index 0000000..c2d5bcc
--- /dev/null
+++ b/pke/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "pke",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/pke",
+    visibility = ["//visibility:public"],
+)
diff --git a/pke/kyber/BUILD.bazel b/pke/kyber/BUILD.bazel
new file mode 100644
index 0000000..1ab127f
--- /dev/null
+++ b/pke/kyber/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kyber",
+    srcs = ["kyber.go"],
+    importpath = "github.com/cloudflare/circl/pke/kyber",
+    visibility = ["//visibility:public"],
+)
diff --git a/pke/kyber/internal/common/BUILD.bazel b/pke/kyber/internal/common/BUILD.bazel
new file mode 100644
index 0000000..0623f42
--- /dev/null
+++ b/pke/kyber/internal/common/BUILD.bazel
@@ -0,0 +1,39 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "common",
+    srcs = [
+        "amd64.go",
+        "amd64.s",
+        "field.go",
+        "generic.go",
+        "ntt.go",
+        "params.go",
+        "poly.go",
+        "sample.go",
+        "stubs_amd64.go",
+    ],
+    importpath = "github.com/cloudflare/circl/pke/kyber/internal/common",
+    visibility = ["//pke/kyber:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//pke/kyber/internal/common/params",
+        "//simd/keccakf1600",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "common_test",
+    srcs = [
+        "field_test.go",
+        "ntt_test.go",
+        "poly_test.go",
+        "sample_test.go",
+    ],
+    embed = [":common"],
+)
diff --git a/pke/kyber/internal/common/asm/BUILD.bazel b/pke/kyber/internal/common/asm/BUILD.bazel
new file mode 100644
index 0000000..c8b5c71
--- /dev/null
+++ b/pke/kyber/internal/common/asm/BUILD.bazel
@@ -0,0 +1,20 @@
+load("@rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "asm_lib",
+    srcs = ["src.go"],
+    importpath = "github.com/cloudflare/circl/pke/kyber/internal/common/asm",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//pke/kyber/internal/common/params",
+        "@com_github_mmcloughlin_avo//build:go_default_library",
+        "@com_github_mmcloughlin_avo//operand:go_default_library",
+        "@com_github_mmcloughlin_avo//reg:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "asm",
+    embed = [":asm_lib"],
+    visibility = ["//pke/kyber:__subpackages__"],
+)
diff --git a/pke/kyber/internal/common/params/BUILD.bazel b/pke/kyber/internal/common/params/BUILD.bazel
new file mode 100644
index 0000000..a4a80ae
--- /dev/null
+++ b/pke/kyber/internal/common/params/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "params",
+    srcs = ["params.go"],
+    importpath = "github.com/cloudflare/circl/pke/kyber/internal/common/params",
+    visibility = ["//pke/kyber:__subpackages__"],
+)
diff --git a/pke/kyber/kyber1024/BUILD.bazel b/pke/kyber/kyber1024/BUILD.bazel
new file mode 100644
index 0000000..b8dea7f
--- /dev/null
+++ b/pke/kyber/kyber1024/BUILD.bazel
@@ -0,0 +1,9 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kyber1024",
+    srcs = ["kyber.go"],
+    importpath = "github.com/cloudflare/circl/pke/kyber/kyber1024",
+    visibility = ["//visibility:public"],
+    deps = ["//pke/kyber/kyber1024/internal"],
+)
diff --git a/pke/kyber/kyber1024/internal/BUILD.bazel b/pke/kyber/kyber1024/internal/BUILD.bazel
new file mode 100644
index 0000000..f474d9b
--- /dev/null
+++ b/pke/kyber/kyber1024/internal/BUILD.bazel
@@ -0,0 +1,23 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "cpapke.go",
+        "mat.go",
+        "params.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/pke/kyber/kyber1024/internal",
+    visibility = ["//pke/kyber/kyber1024:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//pke/kyber/internal/common",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = ["cpapke_test.go"],
+    embed = [":internal"],
+)
diff --git a/pke/kyber/kyber512/BUILD.bazel b/pke/kyber/kyber512/BUILD.bazel
new file mode 100644
index 0000000..d6254fc
--- /dev/null
+++ b/pke/kyber/kyber512/BUILD.bazel
@@ -0,0 +1,9 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kyber512",
+    srcs = ["kyber.go"],
+    importpath = "github.com/cloudflare/circl/pke/kyber/kyber512",
+    visibility = ["//visibility:public"],
+    deps = ["//pke/kyber/kyber512/internal"],
+)
diff --git a/pke/kyber/kyber512/internal/BUILD.bazel b/pke/kyber/kyber512/internal/BUILD.bazel
new file mode 100644
index 0000000..4e4a08b
--- /dev/null
+++ b/pke/kyber/kyber512/internal/BUILD.bazel
@@ -0,0 +1,23 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "cpapke.go",
+        "mat.go",
+        "params.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/pke/kyber/kyber512/internal",
+    visibility = ["//pke/kyber/kyber512:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//pke/kyber/internal/common",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = ["cpapke_test.go"],
+    embed = [":internal"],
+)
diff --git a/pke/kyber/kyber768/BUILD.bazel b/pke/kyber/kyber768/BUILD.bazel
new file mode 100644
index 0000000..a555b7a
--- /dev/null
+++ b/pke/kyber/kyber768/BUILD.bazel
@@ -0,0 +1,9 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "kyber768",
+    srcs = ["kyber.go"],
+    importpath = "github.com/cloudflare/circl/pke/kyber/kyber768",
+    visibility = ["//visibility:public"],
+    deps = ["//pke/kyber/kyber768/internal"],
+)
diff --git a/pke/kyber/kyber768/internal/BUILD.bazel b/pke/kyber/kyber768/internal/BUILD.bazel
new file mode 100644
index 0000000..b1c20f2
--- /dev/null
+++ b/pke/kyber/kyber768/internal/BUILD.bazel
@@ -0,0 +1,23 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "cpapke.go",
+        "mat.go",
+        "params.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/pke/kyber/kyber768/internal",
+    visibility = ["//pke/kyber/kyber768:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//pke/kyber/internal/common",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = ["cpapke_test.go"],
+    embed = [":internal"],
+)
diff --git a/pke/kyber/templates/BUILD.bazel b/pke/kyber/templates/BUILD.bazel
new file mode 100644
index 0000000..bcf7cd2
--- /dev/null
+++ b/pke/kyber/templates/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "templates",
+    srcs = ["pkg.templ.go"],
+    importpath = "github.com/cloudflare/circl/pke/kyber/templates",
+    visibility = ["//visibility:public"],
+)
diff --git a/pki/BUILD.bazel b/pki/BUILD.bazel
new file mode 100644
index 0000000..341224a
--- /dev/null
+++ b/pki/BUILD.bazel
@@ -0,0 +1,21 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "pki",
+    srcs = ["pki.go"],
+    importpath = "github.com/cloudflare/circl/pki",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign",
+        "//sign/schemes",
+    ],
+)
+
+go_test(
+    name = "pki_test",
+    srcs = ["pki_test.go"],
+    deps = [
+        ":pki",
+        "//sign/schemes",
+    ],
+)
diff --git a/secretsharing/BUILD.bazel b/secretsharing/BUILD.bazel
new file mode 100644
index 0000000..30c6ffe
--- /dev/null
+++ b/secretsharing/BUILD.bazel
@@ -0,0 +1,25 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "secretsharing",
+    srcs = ["ss.go"],
+    importpath = "github.com/cloudflare/circl/secretsharing",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//group",
+        "//math/polynomial",
+    ],
+)
+
+go_test(
+    name = "secretsharing_test",
+    srcs = [
+        "example_test.go",
+        "ss_test.go",
+    ],
+    deps = [
+        ":secretsharing",
+        "//group",
+        "//internal/test",
+    ],
+)
diff --git a/sign/BUILD.bazel b/sign/BUILD.bazel
new file mode 100644
index 0000000..c00bfd3
--- /dev/null
+++ b/sign/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "sign",
+    srcs = ["sign.go"],
+    importpath = "github.com/cloudflare/circl/sign",
+    visibility = ["//visibility:public"],
+)
diff --git a/sign/bls/BUILD.bazel b/sign/bls/BUILD.bazel
new file mode 100644
index 0000000..ad82dfb
--- /dev/null
+++ b/sign/bls/BUILD.bazel
@@ -0,0 +1,25 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "bls",
+    srcs = ["bls.go"],
+    importpath = "github.com/cloudflare/circl/sign/bls",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//ecc/bls12381",
+        "@org_golang_x_crypto//hkdf:go_default_library",
+    ],
+)
+
+go_test(
+    name = "bls_test",
+    srcs = [
+        "bls_test.go",
+        "vectors_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    deps = [
+        ":bls",
+        "//internal/test",
+    ],
+)
diff --git a/sign/dilithium/BUILD.bazel b/sign/dilithium/BUILD.bazel
new file mode 100644
index 0000000..fff1004
--- /dev/null
+++ b/sign/dilithium/BUILD.bazel
@@ -0,0 +1,39 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "dilithium",
+    srcs = [
+        "dilithium.go",
+        "mode2.go",
+        "mode2aes.go",
+        "mode3.go",
+        "mode3aes.go",
+        "mode5.go",
+        "mode5aes.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign/dilithium/internal/common",
+        "//sign/dilithium/mode2",
+        "//sign/dilithium/mode2aes",
+        "//sign/dilithium/mode3",
+        "//sign/dilithium/mode3aes",
+        "//sign/dilithium/mode5",
+        "//sign/dilithium/mode5aes",
+    ],
+)
+
+go_test(
+    name = "dilithium_test",
+    srcs = [
+        "dilithium_test.go",
+        "example_test.go",
+        "kat_test.go",
+    ],
+    embed = [":dilithium"],
+    deps = [
+        "//internal/nist",
+        "//internal/sha3",
+    ],
+)
diff --git a/sign/dilithium/internal/common/BUILD.bazel b/sign/dilithium/internal/common/BUILD.bazel
new file mode 100644
index 0000000..832e5f0
--- /dev/null
+++ b/sign/dilithium/internal/common/BUILD.bazel
@@ -0,0 +1,38 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "common",
+    srcs = [
+        "aes.go",
+        "amd64.go",
+        "amd64.s",
+        "field.go",
+        "generic.go",
+        "ntt.go",
+        "pack.go",
+        "params.go",
+        "poly.go",
+        "stubs_amd64.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/internal/common",
+    visibility = ["//sign/dilithium:__subpackages__"],
+    deps = [
+        "//sign/dilithium/internal/common/params",
+    ] + select({
+        "@rules_go//go/platform:amd64": [
+            "@org_golang_x_sys//cpu:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_test(
+    name = "common_test",
+    srcs = [
+        "field_test.go",
+        "ntt_test.go",
+        "pack_test.go",
+        "poly_test.go",
+    ],
+    embed = [":common"],
+)
diff --git a/sign/dilithium/internal/common/asm/BUILD.bazel b/sign/dilithium/internal/common/asm/BUILD.bazel
new file mode 100644
index 0000000..ed88cfa
--- /dev/null
+++ b/sign/dilithium/internal/common/asm/BUILD.bazel
@@ -0,0 +1,20 @@
+load("@rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "asm_lib",
+    srcs = ["src.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/internal/common/asm",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//sign/dilithium/internal/common/params",
+        "@com_github_mmcloughlin_avo//build:go_default_library",
+        "@com_github_mmcloughlin_avo//operand:go_default_library",
+        "@com_github_mmcloughlin_avo//reg:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "asm",
+    embed = [":asm_lib"],
+    visibility = ["//sign/dilithium:__subpackages__"],
+)
diff --git a/sign/dilithium/internal/common/params/BUILD.bazel b/sign/dilithium/internal/common/params/BUILD.bazel
new file mode 100644
index 0000000..981b6ba
--- /dev/null
+++ b/sign/dilithium/internal/common/params/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "params",
+    srcs = ["params.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/internal/common/params",
+    visibility = ["//sign/dilithium:__subpackages__"],
+)
diff --git a/sign/dilithium/mode2/BUILD.bazel b/sign/dilithium/mode2/BUILD.bazel
new file mode 100644
index 0000000..9b2db90
--- /dev/null
+++ b/sign/dilithium/mode2/BUILD.bazel
@@ -0,0 +1,12 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "mode2",
+    srcs = ["dilithium.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode2",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign/dilithium/internal/common",
+        "//sign/dilithium/mode2/internal",
+    ],
+)
diff --git a/sign/dilithium/mode2/internal/BUILD.bazel b/sign/dilithium/mode2/internal/BUILD.bazel
new file mode 100644
index 0000000..ac0e632
--- /dev/null
+++ b/sign/dilithium/mode2/internal/BUILD.bazel
@@ -0,0 +1,34 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "dilithium.go",
+        "mat.go",
+        "pack.go",
+        "params.go",
+        "rounding.go",
+        "sample.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode2/internal",
+    visibility = ["//sign/dilithium/mode2:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//sign/dilithium/internal/common",
+        "//simd/keccakf1600",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = [
+        "dilithium_test.go",
+        "pack_test.go",
+        "params_test.go",
+        "rounding_test.go",
+        "sample_test.go",
+    ],
+    embed = [":internal"],
+    deps = ["//sign/dilithium/internal/common"],
+)
diff --git a/sign/dilithium/mode2aes/BUILD.bazel b/sign/dilithium/mode2aes/BUILD.bazel
new file mode 100644
index 0000000..591f9d2
--- /dev/null
+++ b/sign/dilithium/mode2aes/BUILD.bazel
@@ -0,0 +1,12 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "mode2aes",
+    srcs = ["dilithium.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode2aes",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign/dilithium/internal/common",
+        "//sign/dilithium/mode2aes/internal",
+    ],
+)
diff --git a/sign/dilithium/mode2aes/internal/BUILD.bazel b/sign/dilithium/mode2aes/internal/BUILD.bazel
new file mode 100644
index 0000000..73c41b8
--- /dev/null
+++ b/sign/dilithium/mode2aes/internal/BUILD.bazel
@@ -0,0 +1,34 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "dilithium.go",
+        "mat.go",
+        "pack.go",
+        "params.go",
+        "rounding.go",
+        "sample.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode2aes/internal",
+    visibility = ["//sign/dilithium/mode2aes:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//sign/dilithium/internal/common",
+        "//simd/keccakf1600",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = [
+        "dilithium_test.go",
+        "pack_test.go",
+        "params_test.go",
+        "rounding_test.go",
+        "sample_test.go",
+    ],
+    embed = [":internal"],
+    deps = ["//sign/dilithium/internal/common"],
+)
diff --git a/sign/dilithium/mode3/BUILD.bazel b/sign/dilithium/mode3/BUILD.bazel
new file mode 100644
index 0000000..fc332b5
--- /dev/null
+++ b/sign/dilithium/mode3/BUILD.bazel
@@ -0,0 +1,12 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "mode3",
+    srcs = ["dilithium.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode3",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign/dilithium/internal/common",
+        "//sign/dilithium/mode3/internal",
+    ],
+)
diff --git a/sign/dilithium/mode3/internal/BUILD.bazel b/sign/dilithium/mode3/internal/BUILD.bazel
new file mode 100644
index 0000000..c79c39d
--- /dev/null
+++ b/sign/dilithium/mode3/internal/BUILD.bazel
@@ -0,0 +1,34 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "dilithium.go",
+        "mat.go",
+        "pack.go",
+        "params.go",
+        "rounding.go",
+        "sample.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode3/internal",
+    visibility = ["//sign/dilithium/mode3:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//sign/dilithium/internal/common",
+        "//simd/keccakf1600",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = [
+        "dilithium_test.go",
+        "pack_test.go",
+        "params_test.go",
+        "rounding_test.go",
+        "sample_test.go",
+    ],
+    embed = [":internal"],
+    deps = ["//sign/dilithium/internal/common"],
+)
diff --git a/sign/dilithium/mode3aes/BUILD.bazel b/sign/dilithium/mode3aes/BUILD.bazel
new file mode 100644
index 0000000..6eced28
--- /dev/null
+++ b/sign/dilithium/mode3aes/BUILD.bazel
@@ -0,0 +1,12 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "mode3aes",
+    srcs = ["dilithium.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode3aes",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign/dilithium/internal/common",
+        "//sign/dilithium/mode3aes/internal",
+    ],
+)
diff --git a/sign/dilithium/mode3aes/internal/BUILD.bazel b/sign/dilithium/mode3aes/internal/BUILD.bazel
new file mode 100644
index 0000000..99975ed
--- /dev/null
+++ b/sign/dilithium/mode3aes/internal/BUILD.bazel
@@ -0,0 +1,34 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "dilithium.go",
+        "mat.go",
+        "pack.go",
+        "params.go",
+        "rounding.go",
+        "sample.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode3aes/internal",
+    visibility = ["//sign/dilithium/mode3aes:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//sign/dilithium/internal/common",
+        "//simd/keccakf1600",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = [
+        "dilithium_test.go",
+        "pack_test.go",
+        "params_test.go",
+        "rounding_test.go",
+        "sample_test.go",
+    ],
+    embed = [":internal"],
+    deps = ["//sign/dilithium/internal/common"],
+)
diff --git a/sign/dilithium/mode5/BUILD.bazel b/sign/dilithium/mode5/BUILD.bazel
new file mode 100644
index 0000000..d4f106c
--- /dev/null
+++ b/sign/dilithium/mode5/BUILD.bazel
@@ -0,0 +1,12 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "mode5",
+    srcs = ["dilithium.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode5",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign/dilithium/internal/common",
+        "//sign/dilithium/mode5/internal",
+    ],
+)
diff --git a/sign/dilithium/mode5/internal/BUILD.bazel b/sign/dilithium/mode5/internal/BUILD.bazel
new file mode 100644
index 0000000..ec6eff5
--- /dev/null
+++ b/sign/dilithium/mode5/internal/BUILD.bazel
@@ -0,0 +1,34 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "dilithium.go",
+        "mat.go",
+        "pack.go",
+        "params.go",
+        "rounding.go",
+        "sample.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode5/internal",
+    visibility = ["//sign/dilithium/mode5:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//sign/dilithium/internal/common",
+        "//simd/keccakf1600",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = [
+        "dilithium_test.go",
+        "pack_test.go",
+        "params_test.go",
+        "rounding_test.go",
+        "sample_test.go",
+    ],
+    embed = [":internal"],
+    deps = ["//sign/dilithium/internal/common"],
+)
diff --git a/sign/dilithium/mode5aes/BUILD.bazel b/sign/dilithium/mode5aes/BUILD.bazel
new file mode 100644
index 0000000..8f40a73
--- /dev/null
+++ b/sign/dilithium/mode5aes/BUILD.bazel
@@ -0,0 +1,12 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "mode5aes",
+    srcs = ["dilithium.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode5aes",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign/dilithium/internal/common",
+        "//sign/dilithium/mode5aes/internal",
+    ],
+)
diff --git a/sign/dilithium/mode5aes/internal/BUILD.bazel b/sign/dilithium/mode5aes/internal/BUILD.bazel
new file mode 100644
index 0000000..85555fd
--- /dev/null
+++ b/sign/dilithium/mode5aes/internal/BUILD.bazel
@@ -0,0 +1,34 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "internal",
+    srcs = [
+        "dilithium.go",
+        "mat.go",
+        "pack.go",
+        "params.go",
+        "rounding.go",
+        "sample.go",
+        "vec.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/mode5aes/internal",
+    visibility = ["//sign/dilithium/mode5aes:__subpackages__"],
+    deps = [
+        "//internal/sha3",
+        "//sign/dilithium/internal/common",
+        "//simd/keccakf1600",
+    ],
+)
+
+go_test(
+    name = "internal_test",
+    srcs = [
+        "dilithium_test.go",
+        "pack_test.go",
+        "params_test.go",
+        "rounding_test.go",
+        "sample_test.go",
+    ],
+    embed = [":internal"],
+    deps = ["//sign/dilithium/internal/common"],
+)
diff --git a/sign/dilithium/templates/BUILD.bazel b/sign/dilithium/templates/BUILD.bazel
new file mode 100644
index 0000000..0964106
--- /dev/null
+++ b/sign/dilithium/templates/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "templates",
+    srcs = ["modePkg.templ.go"],
+    importpath = "github.com/cloudflare/circl/sign/dilithium/templates",
+    visibility = ["//visibility:public"],
+)
diff --git a/sign/ed25519/BUILD.bazel b/sign/ed25519/BUILD.bazel
new file mode 100644
index 0000000..d8b8797
--- /dev/null
+++ b/sign/ed25519/BUILD.bazel
@@ -0,0 +1,41 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "ed25519",
+    srcs = [
+        "ed25519.go",
+        "modular.go",
+        "mult.go",
+        "point.go",
+        "pubkey.go",
+        "pubkey112.go",
+        "signapi.go",
+        "tables.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/ed25519",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/conv",
+        "//math",
+        "//math/fp25519",
+        "//sign",
+    ],
+)
+
+go_test(
+    name = "ed25519_test",
+    srcs = [
+        "ed25519_test.go",
+        "extra_test.go",
+        "modular_test.go",
+        "point_test.go",
+        "rfc8032_test.go",
+        "wycheproof_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":ed25519"],
+    deps = [
+        "//internal/conv",
+        "//internal/test",
+    ],
+)
diff --git a/sign/ed448/BUILD.bazel b/sign/ed448/BUILD.bazel
new file mode 100644
index 0000000..3fc4358
--- /dev/null
+++ b/sign/ed448/BUILD.bazel
@@ -0,0 +1,30 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "ed448",
+    srcs = [
+        "ed448.go",
+        "signapi.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/ed448",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//ecc/goldilocks",
+        "//internal/sha3",
+        "//sign",
+    ],
+)
+
+go_test(
+    name = "ed448_test",
+    srcs = [
+        "ed448_test.go",
+        "rfc8032_test.go",
+        "wycheproof_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    deps = [
+        ":ed448",
+        "//internal/test",
+    ],
+)
diff --git a/sign/eddilithium2/BUILD.bazel b/sign/eddilithium2/BUILD.bazel
new file mode 100644
index 0000000..ff8dd9c
--- /dev/null
+++ b/sign/eddilithium2/BUILD.bazel
@@ -0,0 +1,26 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "eddilithium2",
+    srcs = [
+        "eddilithium.go",
+        "signapi.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/eddilithium2",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//sign",
+        "//sign/dilithium/mode2",
+        "//sign/ed25519",
+    ],
+)
+
+go_test(
+    name = "eddilithium2_test",
+    srcs = [
+        "eddilithium_test.go",
+        "example_test.go",
+    ],
+    deps = [":eddilithium2"],
+)
diff --git a/sign/eddilithium3/BUILD.bazel b/sign/eddilithium3/BUILD.bazel
new file mode 100644
index 0000000..72754c8
--- /dev/null
+++ b/sign/eddilithium3/BUILD.bazel
@@ -0,0 +1,26 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "eddilithium3",
+    srcs = [
+        "eddilithium.go",
+        "signapi.go",
+    ],
+    importpath = "github.com/cloudflare/circl/sign/eddilithium3",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//sign",
+        "//sign/dilithium/mode3",
+        "//sign/ed448",
+    ],
+)
+
+go_test(
+    name = "eddilithium3_test",
+    srcs = [
+        "eddilithium_test.go",
+        "example_test.go",
+    ],
+    deps = [":eddilithium3"],
+)
diff --git a/sign/schemes/BUILD.bazel b/sign/schemes/BUILD.bazel
new file mode 100644
index 0000000..5677740
--- /dev/null
+++ b/sign/schemes/BUILD.bazel
@@ -0,0 +1,24 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "schemes",
+    srcs = ["schemes.go"],
+    importpath = "github.com/cloudflare/circl/sign/schemes",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//sign",
+        "//sign/ed25519",
+        "//sign/ed448",
+        "//sign/eddilithium2",
+        "//sign/eddilithium3",
+    ],
+)
+
+go_test(
+    name = "schemes_test",
+    srcs = ["schemes_test.go"],
+    deps = [
+        ":schemes",
+        "//sign",
+    ],
+)
diff --git a/simd/BUILD.bazel b/simd/BUILD.bazel
new file mode 100644
index 0000000..6b6c4ae
--- /dev/null
+++ b/simd/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "simd",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/simd",
+    visibility = ["//visibility:public"],
+)
diff --git a/simd/keccakf1600/BUILD.bazel b/simd/keccakf1600/BUILD.bazel
new file mode 100644
index 0000000..240814f
--- /dev/null
+++ b/simd/keccakf1600/BUILD.bazel
@@ -0,0 +1,30 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "keccakf1600",
+    srcs = [
+        "f1600x.go",
+        "f1600x2_arm64.go",
+        "f1600x2_arm64.s",
+        "f1600x4_amd64.go",
+        "f1600x4_amd64.s",
+        "f1600x4stubs_amd64.go",
+        "fallback.go",
+    ],
+    importpath = "github.com/cloudflare/circl/simd/keccakf1600",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "@org_golang_x_sys//cpu:go_default_library",
+    ],
+)
+
+go_test(
+    name = "keccakf1600_test",
+    srcs = [
+        "example_test.go",
+        "f1600x_test.go",
+    ],
+    embed = [":keccakf1600"],
+    deps = ["//internal/sha3"],
+)
diff --git a/simd/keccakf1600/internal/asm/BUILD.bazel b/simd/keccakf1600/internal/asm/BUILD.bazel
new file mode 100644
index 0000000..2473d69
--- /dev/null
+++ b/simd/keccakf1600/internal/asm/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "asm_lib",
+    srcs = ["src.go"],
+    importpath = "github.com/cloudflare/circl/simd/keccakf1600/internal/asm",
+    visibility = ["//visibility:private"],
+    deps = [
+        "@com_github_mmcloughlin_avo//build:go_default_library",
+        "@com_github_mmcloughlin_avo//operand:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "asm",
+    embed = [":asm_lib"],
+    visibility = ["//simd/keccakf1600:__subpackages__"],
+)
diff --git a/tss/BUILD.bazel b/tss/BUILD.bazel
new file mode 100644
index 0000000..5c4d7ea
--- /dev/null
+++ b/tss/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "tss",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/tss",
+    visibility = ["//visibility:public"],
+)
diff --git a/tss/rsa/BUILD.bazel b/tss/rsa/BUILD.bazel
new file mode 100644
index 0000000..f8c2f87
--- /dev/null
+++ b/tss/rsa/BUILD.bazel
@@ -0,0 +1,31 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "rsa",
+    srcs = [
+        "keyshare.go",
+        "padding.go",
+        "rsa_threshold.go",
+        "signShare.go",
+        "util.go",
+    ],
+    importpath = "github.com/cloudflare/circl/tss/rsa",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//math",
+        "//tss/rsa/internal",
+        "//tss/rsa/internal/pss",
+    ],
+)
+
+go_test(
+    name = "rsa_test",
+    srcs = [
+        "keyshare_test.go",
+        "rsa_threshold_test.go",
+        "signShare_test.go",
+        "util_test.go",
+    ],
+    embed = [":rsa"],
+    deps = ["//internal/test"],
+)
diff --git a/tss/rsa/internal/BUILD.bazel b/tss/rsa/internal/BUILD.bazel
new file mode 100644
index 0000000..323596b
--- /dev/null
+++ b/tss/rsa/internal/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "internal",
+    srcs = ["pkcs1v15.go"],
+    importpath = "github.com/cloudflare/circl/tss/rsa/internal",
+    visibility = ["//tss/rsa:__subpackages__"],
+)
diff --git a/tss/rsa/internal/pss/BUILD.bazel b/tss/rsa/internal/pss/BUILD.bazel
new file mode 100644
index 0000000..bb8c40d
--- /dev/null
+++ b/tss/rsa/internal/pss/BUILD.bazel
@@ -0,0 +1,11 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "pss",
+    srcs = [
+        "pss.go",
+        "rsa.go",
+    ],
+    importpath = "github.com/cloudflare/circl/tss/rsa/internal/pss",
+    visibility = ["//tss/rsa:__subpackages__"],
+)
diff --git a/xof/BUILD.bazel b/xof/BUILD.bazel
new file mode 100644
index 0000000..6eba1ad
--- /dev/null
+++ b/xof/BUILD.bazel
@@ -0,0 +1,23 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "xof",
+    srcs = ["xof.go"],
+    importpath = "github.com/cloudflare/circl/xof",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//xof/k12",
+        "@org_golang_x_crypto//blake2b:go_default_library",
+        "@org_golang_x_crypto//blake2s:go_default_library",
+    ],
+)
+
+go_test(
+    name = "xof_test",
+    srcs = ["xof_test.go"],
+    deps = [
+        ":xof",
+        "//internal/test",
+    ],
+)
diff --git a/xof/k12/BUILD.bazel b/xof/k12/BUILD.bazel
new file mode 100644
index 0000000..2a90a79
--- /dev/null
+++ b/xof/k12/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "k12",
+    srcs = ["k12.go"],
+    importpath = "github.com/cloudflare/circl/xof/k12",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//internal/sha3",
+        "//simd/keccakf1600",
+    ],
+)
+
+go_test(
+    name = "k12_test",
+    srcs = ["k12_test.go"],
+    embed = [":k12"],
+)
diff --git a/zk/BUILD.bazel b/zk/BUILD.bazel
new file mode 100644
index 0000000..f9f30a1
--- /dev/null
+++ b/zk/BUILD.bazel
@@ -0,0 +1,8 @@
+load("@rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "zk",
+    srcs = ["doc.go"],
+    importpath = "github.com/cloudflare/circl/zk",
+    visibility = ["//visibility:public"],
+)
diff --git a/zk/dl/BUILD.bazel b/zk/dl/BUILD.bazel
new file mode 100644
index 0000000..27709a4
--- /dev/null
+++ b/zk/dl/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "dl",
+    srcs = ["dl.go"],
+    importpath = "github.com/cloudflare/circl/zk/dl",
+    visibility = ["//visibility:public"],
+    deps = ["//group"],
+)
+
+go_test(
+    name = "dl_test",
+    srcs = ["dl_test.go"],
+    deps = [
+        ":dl",
+        "//group",
+    ],
+)
diff --git a/zk/dleq/BUILD.bazel b/zk/dleq/BUILD.bazel
new file mode 100644
index 0000000..fa614d8
--- /dev/null
+++ b/zk/dleq/BUILD.bazel
@@ -0,0 +1,19 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "dleq",
+    srcs = ["dleq.go"],
+    importpath = "github.com/cloudflare/circl/zk/dleq",
+    visibility = ["//visibility:public"],
+    deps = ["//group"],
+)
+
+go_test(
+    name = "dleq_test",
+    srcs = ["dleq_test.go"],
+    deps = [
+        ":dleq",
+        "//group",
+        "//internal/test",
+    ],
+)
diff --git a/zk/qndleq/BUILD.bazel b/zk/qndleq/BUILD.bazel
new file mode 100644
index 0000000..5aa4c5a
--- /dev/null
+++ b/zk/qndleq/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "qndleq",
+    srcs = ["qndleq.go"],
+    importpath = "github.com/cloudflare/circl/zk/qndleq",
+    visibility = ["//visibility:public"],
+    deps = ["//internal/sha3"],
+)
+
+go_test(
+    name = "qndleq_test",
+    srcs = ["qndleq_test.go"],
+    deps = [
+        ":qndleq",
+        "//internal/test",
+    ],
+)
