Skip to content

Commit

Permalink
Remove all remaining dependencies on rapidjson.
Browse files Browse the repository at this point in the history
This requires us to remove the subtle::WycheproofUtil, because it uses rapidjson in its interface. I think it is unlikely that there are any external users of these functions. If there are, they should just copy WycheproofUtil into their code.

PiperOrigin-RevId: 705390211
Change-Id: Ia82e44e7b00b2ab39b686627b9f2838fa7df4450
  • Loading branch information
juergw authored and copybara-github committed Dec 12, 2024
1 parent 4416be5 commit 39ea800
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 317 deletions.
4 changes: 0 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ bazel_dep(
name = "boringssl",
version = "0.20240930.0",
)
bazel_dep(
name = "rapidjson",
version = "1.1.0",
)
bazel_dep(
name = "abseil-cpp",
version = "20240722.0",
Expand Down
13 changes: 0 additions & 13 deletions cmake/TinkWorkspace.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,6 @@ else()
message(STATUS "crypto Include Dir: ${crypto_INCLUDE_DIR}")
endif()

set(RAPIDJSON_BUILD_DOC OFF CACHE BOOL "Tink dependency override" FORCE)
set(RAPIDJSON_BUILD_EXAMPLES OFF CACHE BOOL "Tink dependency override" FORCE)
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "Tink dependency override" FORCE)

http_archive(
NAME rapidjson
URL https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz
SHA256 bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
)
# Rapidjson is a header-only library with no explicit target. Here we create one.
add_library(rapidjson INTERFACE)
target_include_directories(rapidjson INTERFACE "${rapidjson_SOURCE_DIR}")

if (NOT TINK_USE_INSTALLED_PROTOBUF)
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Tink dependency override" FORCE)
set(protobuf_BUILD_EXAMPLES OFF CACHE BOOL "Tink dependency override" FORCE)
Expand Down
44 changes: 0 additions & 44 deletions third_party/rapidjson.BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion tink/aead/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ cc_test(
"//tink:aead",
"//tink/aead:cord_aead",
"//tink/subtle:aes_gcm_boringssl",
"//tink/subtle:wycheproof_util",
"//tink/util:secret_data",
"//tink/util:statusor",
"//tink/util:test_matchers",
Expand Down
1 change: 0 additions & 1 deletion tink/aead/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ tink_cc_test(
tink::core::aead
tink::aead::cord_aead
tink::subtle::aes_gcm_boringssl
tink::subtle::wycheproof_util
tink::util::secret_data
tink::util::statusor
tink::util::test_matchers
Expand Down
18 changes: 0 additions & 18 deletions tink/subtle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -731,24 +731,6 @@ cc_library(
],
)

cc_library(
name = "wycheproof_util",
testonly = 1,
srcs = ["wycheproof_util.cc"],
hdrs = ["wycheproof_util.h"],
include_prefix = "tink/subtle",
deps = [
":common_enums",
"//tink/internal:test_file_util",
"//tink/util:status",
"//tink/util:statusor",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@rapidjson",
],
)

cc_library(
name = "stream_segment_decrypter",
hdrs = ["stream_segment_decrypter.h"],
Expand Down
17 changes: 0 additions & 17 deletions tink/subtle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -693,23 +693,6 @@ tink_cc_library(
tink::util::statusor
)

tink_cc_library(
NAME wycheproof_util
SRCS
wycheproof_util.cc
wycheproof_util.h
DEPS
tink::subtle::common_enums
absl::log
absl::status
absl::strings
rapidjson
tink::internal::test_file_util
tink::util::status
tink::util::statusor
TESTONLY
)

tink_cc_library(
NAME stream_segment_decrypter
SRCS
Expand Down
142 changes: 0 additions & 142 deletions tink/subtle/wycheproof_util.cc

This file was deleted.

64 changes: 0 additions & 64 deletions tink/subtle/wycheproof_util.h

This file was deleted.

13 changes: 0 additions & 13 deletions tink_cc_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,6 @@ def tink_cc_deps():
url = "https://github.com/bazelbuild/rules_license/releases/download/1.0.0/rules_license-1.0.0.tar.gz",
)

# -------------------------------------------------------------------------
# Rapidjson.
# -------------------------------------------------------------------------
# Release from 2016-08-25 (still the latest release as of 2022-05-05).
maybe(
http_archive,
build_file = "@tink_cc//:third_party/rapidjson.BUILD.bazel",
name = "rapidjson",
sha256 = "bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e",
strip_prefix = "rapidjson-1.1.0",
url = "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz",
)

def tink_cc_testonly_deps():
"""Test only dependencies for tink-cc."""

Expand Down

0 comments on commit 39ea800

Please sign in to comment.