From 0e44ed626d5819224f67d194fcdf8882565a4046 Mon Sep 17 00:00:00 2001 From: Crisrael Lucero Date: Wed, 19 Jul 2023 17:11:33 -0700 Subject: [PATCH] Refactor crypto/ directory into crypto_cros/ and crypto/ PiperOrigin-RevId: 549467911 --- Package.swift | 23 ++-- connections/v3/BUILD | 2 +- connections/v3/connections_device.h | 2 +- fastpair/common/BUILD | 2 +- fastpair/common/account_key.h | 2 +- fastpair/common/account_key_filter.cc | 2 +- fastpair/repository/BUILD | 2 +- fastpair/repository/fast_pair_repository.cc | 2 +- internal/crypto/BUILD | 65 +--------- internal/crypto/ed25519.cc | 2 +- internal/crypto/ed25519.h | 2 +- internal/crypto_cros/BUILD | 117 ++++++++++++++++++ internal/{crypto => crypto_cros}/aead.cc | 6 +- internal/{crypto => crypto_cros}/aead.h | 2 +- .../{crypto => crypto_cros}/aead_unittest.cc | 2 +- .../{crypto => crypto_cros}/crypto_export.h | 0 .../{crypto => crypto_cros}/ec_private_key.cc | 4 +- .../{crypto => crypto_cros}/ec_private_key.h | 2 +- .../ec_private_key_unittest.cc | 2 +- .../ec_signature_creator.cc | 4 +- .../ec_signature_creator.h | 2 +- .../ec_signature_creator_impl.cc | 6 +- .../ec_signature_creator_impl.h | 2 +- .../ec_signature_creator_unittest.cc | 8 +- internal/{crypto => crypto_cros}/encryptor.cc | 8 +- internal/{crypto => crypto_cros}/encryptor.h | 2 +- .../encryptor_unittest.cc | 6 +- internal/{crypto => crypto_cros}/hkdf.cc | 4 +- internal/{crypto => crypto_cros}/hkdf.h | 2 +- internal/{crypto => crypto_cros}/hmac.cc | 10 +- internal/{crypto => crypto_cros}/hmac.h | 4 +- .../{crypto => crypto_cros}/hmac_unittest.cc | 2 +- .../{crypto => crypto_cros}/nearby_base.cc | 2 +- .../{crypto => crypto_cros}/nearby_base.h | 0 .../{crypto => crypto_cros}/openssl_util.cc | 2 +- .../{crypto => crypto_cros}/openssl_util.h | 2 +- internal/{crypto => crypto_cros}/random.cc | 2 +- internal/{crypto => crypto_cros}/random.h | 2 +- .../random_unittest.cc | 4 +- .../rsa_private_key.cc | 4 +- .../{crypto => crypto_cros}/rsa_private_key.h | 2 +- .../rsa_private_key_unittest.cc | 2 +- .../{crypto => crypto_cros}/secure_hash.cc | 4 +- .../{crypto => crypto_cros}/secure_hash.h | 2 +- .../secure_hash_unittest.cc | 4 +- .../{crypto => crypto_cros}/secure_util.cc | 2 +- .../{crypto => crypto_cros}/secure_util.h | 2 +- internal/{crypto => crypto_cros}/sha2.cc | 4 +- internal/{crypto => crypto_cros}/sha2.h | 2 +- .../{crypto => crypto_cros}/sha2_unittest.cc | 2 +- .../signature_verifier.cc | 4 +- .../signature_verifier.h | 2 +- .../signature_verifier_unittest.cc | 2 +- .../{crypto => crypto_cros}/symmetric_key.cc | 6 +- .../{crypto => crypto_cros}/symmetric_key.h | 2 +- .../symmetric_key_unittest.cc | 4 +- internal/platform/BUILD | 2 +- internal/platform/implementation/BUILD | 4 +- internal/platform/implementation/crypto.h | 2 +- presence/implementation/BUILD | 2 + .../connection_authenticator.cc | 4 +- .../implementation/credential_manager_impl.cc | 8 +- 62 files changed, 226 insertions(+), 161 deletions(-) create mode 100644 internal/crypto_cros/BUILD rename internal/{crypto => crypto_cros}/aead.cc (97%) rename internal/{crypto => crypto_cros}/aead.h (98%) rename internal/{crypto => crypto_cros}/aead_unittest.cc (98%) rename internal/{crypto => crypto_cros}/crypto_export.h (100%) rename internal/{crypto => crypto_cros}/ec_private_key.cc (98%) rename internal/{crypto => crypto_cros}/ec_private_key.h (98%) rename internal/{crypto => crypto_cros}/ec_private_key_unittest.cc (99%) rename internal/{crypto => crypto_cros}/ec_signature_creator.cc (87%) rename internal/{crypto => crypto_cros}/ec_signature_creator.h (97%) rename internal/{crypto => crypto_cros}/ec_signature_creator_impl.cc (94%) rename internal/{crypto => crypto_cros}/ec_signature_creator_impl.h (96%) rename internal/{crypto => crypto_cros}/ec_signature_creator_unittest.cc (90%) rename internal/{crypto => crypto_cros}/encryptor.cc (97%) rename internal/{crypto => crypto_cros}/encryptor.h (98%) rename internal/{crypto => crypto_cros}/encryptor_unittest.cc (99%) rename internal/{crypto => crypto_cros}/hkdf.cc (96%) rename internal/{crypto => crypto_cros}/hkdf.h (96%) rename internal/{crypto => crypto_cros}/hmac.cc (94%) rename internal/{crypto => crypto_cros}/hmac.h (98%) rename internal/{crypto => crypto_cros}/hmac_unittest.cc (99%) rename internal/{crypto => crypto_cros}/nearby_base.cc (97%) rename internal/{crypto => crypto_cros}/nearby_base.h (100%) rename internal/{crypto => crypto_cros}/openssl_util.cc (96%) rename internal/{crypto => crypto_cros}/openssl_util.h (98%) rename internal/{crypto => crypto_cros}/random.cc (95%) rename internal/{crypto => crypto_cros}/random.h (96%) rename internal/{crypto => crypto_cros}/random_unittest.cc (95%) rename internal/{crypto => crypto_cros}/rsa_private_key.cc (97%) rename internal/{crypto => crypto_cros}/rsa_private_key.h (98%) rename internal/{crypto => crypto_cros}/rsa_private_key_unittest.cc (99%) rename internal/{crypto => crypto_cros}/secure_hash.cc (95%) rename internal/{crypto => crypto_cros}/secure_hash.h (97%) rename internal/{crypto => crypto_cros}/secure_hash_unittest.cc (98%) rename internal/{crypto => crypto_cros}/secure_util.cc (94%) rename internal/{crypto => crypto_cros}/secure_util.h (96%) rename internal/{crypto => crypto_cros}/sha2.cc (94%) rename internal/{crypto => crypto_cros}/sha2.h (97%) rename internal/{crypto => crypto_cros}/sha2_unittest.cc (99%) rename internal/{crypto => crypto_cros}/signature_verifier.cc (97%) rename internal/{crypto => crypto_cros}/signature_verifier.h (98%) rename internal/{crypto => crypto_cros}/signature_verifier_unittest.cc (99%) rename internal/{crypto => crypto_cros}/symmetric_key.cc (97%) rename internal/{crypto => crypto_cros}/symmetric_key.h (98%) rename internal/{crypto => crypto_cros}/symmetric_key_unittest.cc (98%) diff --git a/Package.swift b/Package.swift index 53c1b090..e9ceacdc 100644 --- a/Package.swift +++ b/Package.swift @@ -396,6 +396,7 @@ let package = Package( "connections/BUILD", "internal/crypto/BUILD", "internal/crypto/BUILD.gn", + "internal/crypto_cros/BUILD", "internal/interop/BUILD", "internal/weave/BUILD", "internal/weave/sockets/BUILD", @@ -466,18 +467,18 @@ let package = Package( "connections/status_test.cc", "connections/payload_test.cc", "internal/base/bluetooth_address_test.cc", - "internal/crypto/aead_unittest.cc", - "internal/crypto/ec_private_key_unittest.cc", - "internal/crypto/ec_signature_creator_unittest.cc", "internal/crypto/ed25519_unittest.cc", - "internal/crypto/encryptor_unittest.cc", - "internal/crypto/hmac_unittest.cc", - "internal/crypto/random_unittest.cc", - "internal/crypto/rsa_private_key_unittest.cc", - "internal/crypto/secure_hash_unittest.cc", - "internal/crypto/sha2_unittest.cc", - "internal/crypto/signature_verifier_unittest.cc", - "internal/crypto/symmetric_key_unittest.cc", + "internal/crypto_cros/aead_unittest.cc", + "internal/crypto_cros/ec_private_key_unittest.cc", + "internal/crypto_cros/ec_signature_creator_unittest.cc", + "internal/crypto_cros/encryptor_unittest.cc", + "internal/crypto_cros/hmac_unittest.cc", + "internal/crypto_cros/random_unittest.cc", + "internal/crypto_cros/rsa_private_key_unittest.cc", + "internal/crypto_cros/secure_hash_unittest.cc", + "internal/crypto_cros/sha2_unittest.cc", + "internal/crypto_cros/signature_verifier_unittest.cc", + "internal/crypto_cros/symmetric_key_unittest.cc", "internal/data/leveldb_data_set_test.cc", "internal/data/memory_data_set_test.cc", "internal/flags/nearby_flags_test.cc", diff --git a/connections/v3/BUILD b/connections/v3/BUILD index 7aa7a7b2..00b143d9 100644 --- a/connections/v3/BUILD +++ b/connections/v3/BUILD @@ -19,7 +19,7 @@ cc_library( deps = [ "//connections:core_types", "//connections/implementation/proto:offline_wire_formats_cc_proto", - "//internal/crypto", + "//internal/crypto_cros", "//internal/interop:device", "//internal/platform:connection_info", "//proto:connections_enums_cc_proto", diff --git a/connections/v3/connections_device.h b/connections/v3/connections_device.h index 1c6158ac..49d2bddb 100644 --- a/connections/v3/connections_device.h +++ b/connections/v3/connections_device.h @@ -18,7 +18,7 @@ #include #include -#include "internal/crypto/random.h" +#include "internal/crypto_cros/random.h" #include "internal/interop/device.h" #include "internal/platform/connection_info.h" diff --git a/fastpair/common/BUILD b/fastpair/common/BUILD index 83236bab..c657c1c4 100644 --- a/fastpair/common/BUILD +++ b/fastpair/common/BUILD @@ -32,7 +32,7 @@ cc_library( ], deps = [ "//fastpair/proto:fastpair_cc_proto", - "//internal/crypto", + "//internal/crypto_cros", "//internal/platform:logging", "//internal/preferences", "@com_google_absl//absl/base:core_headers", diff --git a/fastpair/common/account_key.h b/fastpair/common/account_key.h index 1dacd5e0..ec8d9a4a 100644 --- a/fastpair/common/account_key.h +++ b/fastpair/common/account_key.h @@ -22,7 +22,7 @@ #include "absl/strings/escaping.h" #include "absl/strings/string_view.h" #include "fastpair/common/constant.h" -#include "internal/crypto/random.h" +#include "internal/crypto_cros/random.h" namespace nearby { namespace fastpair { diff --git a/fastpair/common/account_key_filter.cc b/fastpair/common/account_key_filter.cc index 9397192a..b3a23757 100644 --- a/fastpair/common/account_key_filter.cc +++ b/fastpair/common/account_key_filter.cc @@ -22,7 +22,7 @@ #include "absl/strings/string_view.h" #include "fastpair/common/battery_notification.h" #include "fastpair/common/non_discoverable_advertisement.h" -#include "internal/crypto/sha2.h" +#include "internal/crypto_cros/sha2.h" #include "internal/platform/logging.h" namespace nearby { diff --git a/fastpair/repository/BUILD b/fastpair/repository/BUILD index cfa6aaa1..37bf567a 100644 --- a/fastpair/repository/BUILD +++ b/fastpair/repository/BUILD @@ -16,7 +16,7 @@ cc_library( "//fastpair/common", "//fastpair/proto:fastpair_cc_proto", "//internal/base:bluetooth_address", - "//internal/crypto", + "//internal/crypto_cros", "@com_google_absl//absl/functional:any_invocable", "@com_google_absl//absl/strings", ], diff --git a/fastpair/repository/fast_pair_repository.cc b/fastpair/repository/fast_pair_repository.cc index 25becf6e..183bd6e0 100644 --- a/fastpair/repository/fast_pair_repository.cc +++ b/fastpair/repository/fast_pair_repository.cc @@ -20,7 +20,7 @@ #include "absl/strings/string_view.h" #include "internal/base/bluetooth_address.h" -#include "internal/crypto/sha2.h" +#include "internal/crypto_cros/sha2.h" namespace nearby { namespace fastpair { diff --git a/internal/crypto/BUILD b/internal/crypto/BUILD index c28971fb..d301d989 100644 --- a/internal/crypto/BUILD +++ b/internal/crypto/BUILD @@ -22,57 +22,16 @@ licenses(["notice"]) cc_library( name = "crypto", - srcs = [ - "aead.cc", - "ec_private_key.cc", - "ec_signature_creator.cc", - "ec_signature_creator_impl.cc", - "ed25519.cc", - "encryptor.cc", - "hkdf.cc", - "hmac.cc", - "nearby_base.cc", - "openssl_util.cc", - "random.cc", - "rsa_private_key.cc", - "secure_hash.cc", - "secure_util.cc", - "sha2.cc", - "signature_verifier.cc", - "symmetric_key.cc", - ], - hdrs = [ - "aead.h", - "crypto_export.h", - "ec_private_key.h", - "ec_signature_creator.h", - "ec_signature_creator_impl.h", - "ed25519.h", - "encryptor.h", - "hkdf.h", - "hmac.h", - "nearby_base.h", - "openssl_util.h", - "random.h", - "rsa_private_key.h", - "secure_hash.h", - "secure_util.h", - "sha2.h", - "signature_verifier.h", - "symmetric_key.h", - ], + srcs = ["ed25519.cc"], + hdrs = ["ed25519.h"], copts = [ - "-DCRYPTO_IMPLEMENTATION", "-Ithird_party", ], deps = [ + "//internal/crypto_cros", "@boringssl//:crypto", - "@com_google_absl//absl/base:core_headers", - "@com_google_absl//absl/log", - "@com_google_absl//absl/log:check", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", @@ -81,21 +40,8 @@ cc_library( cc_test( name = "crypto_unittests", - size = "large", - srcs = [ - "aead_unittest.cc", - "ec_private_key_unittest.cc", - "ec_signature_creator_unittest.cc", - "ed25519_unittest.cc", - "encryptor_unittest.cc", - "hmac_unittest.cc", - "random_unittest.cc", - "rsa_private_key_unittest.cc", - "secure_hash_unittest.cc", - "sha2_unittest.cc", - "signature_verifier_unittest.cc", - "symmetric_key_unittest.cc", - ], + size = "small", + srcs = ["ed25519_unittest.cc"], copts = [ "-DUNIT_TEST", "-Wno-inconsistent-missing-override", @@ -104,7 +50,6 @@ cc_test( ], deps = [ ":crypto", - "//internal/platform/implementation:types", "@com_github_protobuf_matchers//protobuf-matchers", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", diff --git a/internal/crypto/ed25519.cc b/internal/crypto/ed25519.cc index 38d24c52..88d8b79b 100644 --- a/internal/crypto/ed25519.cc +++ b/internal/crypto/ed25519.cc @@ -21,7 +21,7 @@ #include "absl/status/status.h" #include "absl/strings/str_format.h" -#include "internal/crypto/random.h" +#include "internal/crypto_cros/random.h" #include #include diff --git a/internal/crypto/ed25519.h b/internal/crypto/ed25519.h index 82184152..9fee90e9 100644 --- a/internal/crypto/ed25519.h +++ b/internal/crypto/ed25519.h @@ -20,7 +20,7 @@ #include #include "absl/status/statusor.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" #include #include #include diff --git a/internal/crypto_cros/BUILD b/internal/crypto_cros/BUILD new file mode 100644 index 00000000..7083f705 --- /dev/null +++ b/internal/crypto_cros/BUILD @@ -0,0 +1,117 @@ +licenses(["notice"]) + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +package(default_visibility = [ + "//:__subpackages__", + "//location/nearby/cpp/sharing/implementation:__subpackages__", +]) + +licenses(["notice"]) + +# /********************************** +# * WARNING -- DO NOT MODIFY * +# **********************************/ +# Only add things to this directory that keep it in sync with Chromium's crypto library found at +# https://source.chromium.org/chromium/chromium/src/+/main:crypto/ +# New classes that don't originate from there should be added to +# google3/third_party/nearby/internal/crypto instead. +cc_library( + name = "crypto_cros", + srcs = [ + "aead.cc", + "ec_private_key.cc", + "ec_signature_creator.cc", + "ec_signature_creator_impl.cc", + "encryptor.cc", + "hkdf.cc", + "hmac.cc", + "nearby_base.cc", + "openssl_util.cc", + "random.cc", + "rsa_private_key.cc", + "secure_hash.cc", + "secure_util.cc", + "sha2.cc", + "signature_verifier.cc", + "symmetric_key.cc", + ], + hdrs = [ + "aead.h", + "crypto_export.h", + "ec_private_key.h", + "ec_signature_creator.h", + "ec_signature_creator_impl.h", + "encryptor.h", + "hkdf.h", + "hmac.h", + "nearby_base.h", + "openssl_util.h", + "random.h", + "rsa_private_key.h", + "secure_hash.h", + "secure_util.h", + "sha2.h", + "signature_verifier.h", + "symmetric_key.h", + ], + copts = [ + "-DCRYPTO_IMPLEMENTATION", + "-Ithird_party", + ], + deps = [ + "@boringssl//:crypto", + "@com_google_absl//absl/base:core_headers", + "@com_google_absl//absl/log", + "@com_google_absl//absl/log:check", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:str_format", + "@com_google_absl//absl/types:optional", + "@com_google_absl//absl/types:span", + ], +) + +cc_test( + name = "crypto_cros_unittests", + size = "large", + srcs = [ + "aead_unittest.cc", + "ec_private_key_unittest.cc", + "ec_signature_creator_unittest.cc", + "encryptor_unittest.cc", + "hmac_unittest.cc", + "random_unittest.cc", + "rsa_private_key_unittest.cc", + "secure_hash_unittest.cc", + "sha2_unittest.cc", + "signature_verifier_unittest.cc", + "symmetric_key_unittest.cc", + ], + copts = [ + "-DUNIT_TEST", + "-Wno-inconsistent-missing-override", + "-Wno-non-virtual-dtor", + "-Ithird_party", + ], + deps = [ + ":crypto_cros", + "//internal/platform/implementation:types", + "@com_github_protobuf_matchers//protobuf-matchers", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:span", + "@com_google_googletest//:gtest_main", + ], +) diff --git a/internal/crypto/aead.cc b/internal/crypto_cros/aead.cc similarity index 97% rename from internal/crypto/aead.cc rename to internal/crypto_cros/aead.cc index bbba65ce..7e0868f9 100644 --- a/internal/crypto/aead.cc +++ b/internal/crypto_cros/aead.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/aead.h" +#include "internal/crypto_cros/aead.h" #include #include @@ -30,8 +30,8 @@ #endif #include "absl/types/span.h" -#include "internal/crypto/nearby_base.h" -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/nearby_base.h" +#include "internal/crypto_cros/openssl_util.h" #include #include diff --git a/internal/crypto/aead.h b/internal/crypto_cros/aead.h similarity index 98% rename from internal/crypto/aead.h rename to internal/crypto_cros/aead.h index 053f3085..fca3ac91 100644 --- a/internal/crypto/aead.h +++ b/internal/crypto_cros/aead.h @@ -25,7 +25,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" struct evp_aead_st; diff --git a/internal/crypto/aead_unittest.cc b/internal/crypto_cros/aead_unittest.cc similarity index 98% rename from internal/crypto/aead_unittest.cc rename to internal/crypto_cros/aead_unittest.cc index 8f920818..9474eb33 100644 --- a/internal/crypto/aead_unittest.cc +++ b/internal/crypto_cros/aead_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/aead.h" +#include "internal/crypto_cros/aead.h" #include #include diff --git a/internal/crypto/crypto_export.h b/internal/crypto_cros/crypto_export.h similarity index 100% rename from internal/crypto/crypto_export.h rename to internal/crypto_cros/crypto_export.h diff --git a/internal/crypto/ec_private_key.cc b/internal/crypto_cros/ec_private_key.cc similarity index 98% rename from internal/crypto/ec_private_key.cc rename to internal/crypto_cros/ec_private_key.cc index 63471e02..3e937c2a 100644 --- a/internal/crypto/ec_private_key.cc +++ b/internal/crypto_cros/ec_private_key.cc @@ -1,4 +1,4 @@ -#include "internal/crypto/ec_private_key.h" +#include "internal/crypto_cros/ec_private_key.h" // Copyright 2020 Google LLC // @@ -31,7 +31,7 @@ #include "absl/log/check.h" // nogncheck #endif -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/openssl_util.h" #include #include #include diff --git a/internal/crypto/ec_private_key.h b/internal/crypto_cros/ec_private_key.h similarity index 98% rename from internal/crypto/ec_private_key.h rename to internal/crypto_cros/ec_private_key.h index 56f512b9..9b1dd1b9 100644 --- a/internal/crypto/ec_private_key.h +++ b/internal/crypto_cros/ec_private_key.h @@ -23,7 +23,7 @@ #include #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" #include namespace crypto { diff --git a/internal/crypto/ec_private_key_unittest.cc b/internal/crypto_cros/ec_private_key_unittest.cc similarity index 99% rename from internal/crypto/ec_private_key_unittest.cc rename to internal/crypto_cros/ec_private_key_unittest.cc index 6f488725..43c6dcbb 100644 --- a/internal/crypto/ec_private_key_unittest.cc +++ b/internal/crypto_cros/ec_private_key_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/ec_private_key.h" +#include "internal/crypto_cros/ec_private_key.h" #include diff --git a/internal/crypto/ec_signature_creator.cc b/internal/crypto_cros/ec_signature_creator.cc similarity index 87% rename from internal/crypto/ec_signature_creator.cc rename to internal/crypto_cros/ec_signature_creator.cc index 8b6e50ee..dcf41083 100644 --- a/internal/crypto/ec_signature_creator.cc +++ b/internal/crypto_cros/ec_signature_creator.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/ec_signature_creator.h" +#include "internal/crypto_cros/ec_signature_creator.h" #include -#include "internal/crypto/ec_signature_creator_impl.h" +#include "internal/crypto_cros/ec_signature_creator_impl.h" namespace crypto { diff --git a/internal/crypto/ec_signature_creator.h b/internal/crypto_cros/ec_signature_creator.h similarity index 97% rename from internal/crypto/ec_signature_creator.h rename to internal/crypto_cros/ec_signature_creator.h index a87fa9b9..f0dfd790 100644 --- a/internal/crypto/ec_signature_creator.h +++ b/internal/crypto_cros/ec_signature_creator.h @@ -22,7 +22,7 @@ #include #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/ec_signature_creator_impl.cc b/internal/crypto_cros/ec_signature_creator_impl.cc similarity index 94% rename from internal/crypto/ec_signature_creator_impl.cc rename to internal/crypto_cros/ec_signature_creator_impl.cc index e302c1bc..a7b20a88 100644 --- a/internal/crypto/ec_signature_creator_impl.cc +++ b/internal/crypto_cros/ec_signature_creator_impl.cc @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/ec_signature_creator_impl.h" +#include "internal/crypto_cros/ec_signature_creator_impl.h" #include #include #include -#include "internal/crypto/ec_private_key.h" -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/ec_private_key.h" +#include "internal/crypto_cros/openssl_util.h" #include #include #include diff --git a/internal/crypto/ec_signature_creator_impl.h b/internal/crypto_cros/ec_signature_creator_impl.h similarity index 96% rename from internal/crypto/ec_signature_creator_impl.h rename to internal/crypto_cros/ec_signature_creator_impl.h index 74599886..8024bbc8 100644 --- a/internal/crypto/ec_signature_creator_impl.h +++ b/internal/crypto_cros/ec_signature_creator_impl.h @@ -20,7 +20,7 @@ #include #include "absl/types/span.h" -#include "internal/crypto/ec_signature_creator.h" +#include "internal/crypto_cros/ec_signature_creator.h" namespace crypto { diff --git a/internal/crypto/ec_signature_creator_unittest.cc b/internal/crypto_cros/ec_signature_creator_unittest.cc similarity index 90% rename from internal/crypto/ec_signature_creator_unittest.cc rename to internal/crypto_cros/ec_signature_creator_unittest.cc index e4eab224..753f4e73 100644 --- a/internal/crypto/ec_signature_creator_unittest.cc +++ b/internal/crypto_cros/ec_signature_creator_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/ec_signature_creator.h" +#include "internal/crypto_cros/ec_signature_creator.h" #include @@ -22,9 +22,9 @@ #include "gtest/gtest.h" #include "absl/types/span.h" -#include "internal/crypto/ec_private_key.h" -#include "internal/crypto/nearby_base.h" -#include "internal/crypto/signature_verifier.h" +#include "internal/crypto_cros/ec_private_key.h" +#include "internal/crypto_cros/nearby_base.h" +#include "internal/crypto_cros/signature_verifier.h" TEST(ECSignatureCreatorTest, BasicTest) { // Do a verify round trip. diff --git a/internal/crypto/encryptor.cc b/internal/crypto_cros/encryptor.cc similarity index 97% rename from internal/crypto/encryptor.cc rename to internal/crypto_cros/encryptor.cc index bc078ab2..b901ea96 100644 --- a/internal/crypto/encryptor.cc +++ b/internal/crypto_cros/encryptor.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/encryptor.h" +#include "internal/crypto_cros/encryptor.h" #include #include @@ -35,9 +35,9 @@ #endif #include "absl/strings/string_view.h" #include "absl/types/span.h" -#include "internal/crypto/nearby_base.h" -#include "internal/crypto/openssl_util.h" -#include "internal/crypto/symmetric_key.h" +#include "internal/crypto_cros/nearby_base.h" +#include "internal/crypto_cros/openssl_util.h" +#include "internal/crypto_cros/symmetric_key.h" #include #include diff --git a/internal/crypto/encryptor.h b/internal/crypto_cros/encryptor.h similarity index 98% rename from internal/crypto/encryptor.h rename to internal/crypto_cros/encryptor.h index 19df38ce..ce100d5c 100644 --- a/internal/crypto/encryptor.h +++ b/internal/crypto_cros/encryptor.h @@ -26,7 +26,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/encryptor_unittest.cc b/internal/crypto_cros/encryptor_unittest.cc similarity index 99% rename from internal/crypto/encryptor_unittest.cc rename to internal/crypto_cros/encryptor_unittest.cc index 351ae995..207911c0 100644 --- a/internal/crypto/encryptor_unittest.cc +++ b/internal/crypto_cros/encryptor_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/encryptor.h" +#include "internal/crypto_cros/encryptor.h" #include @@ -24,8 +24,8 @@ #include "gtest/gtest.h" #include "absl/types/span.h" -#include "internal/crypto/nearby_base.h" -#include "internal/crypto/symmetric_key.h" +#include "internal/crypto_cros/nearby_base.h" +#include "internal/crypto_cros/symmetric_key.h" TEST(EncryptorTest, EncryptDecrypt) { std::unique_ptr key( diff --git a/internal/crypto/hkdf.cc b/internal/crypto_cros/hkdf.cc similarity index 96% rename from internal/crypto/hkdf.cc rename to internal/crypto_cros/hkdf.cc index bcea70df..1e50ea6d 100644 --- a/internal/crypto/hkdf.cc +++ b/internal/crypto_cros/hkdf.cc @@ -30,8 +30,8 @@ #endif #include "absl/strings/string_view.h" -#include "internal/crypto/hkdf.h" -#include "internal/crypto/hmac.h" +#include "internal/crypto_cros/hkdf.h" +#include "internal/crypto_cros/hmac.h" #include namespace crypto { diff --git a/internal/crypto/hkdf.h b/internal/crypto_cros/hkdf.h similarity index 96% rename from internal/crypto/hkdf.h rename to internal/crypto_cros/hkdf.h index 81803270..31740218 100644 --- a/internal/crypto/hkdf.h +++ b/internal/crypto_cros/hkdf.h @@ -22,7 +22,7 @@ #include "absl/strings/string_view.h" #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/hmac.cc b/internal/crypto_cros/hmac.cc similarity index 94% rename from internal/crypto/hmac.cc rename to internal/crypto_cros/hmac.cc index d9dfd8c6..78d6f998 100644 --- a/internal/crypto/hmac.cc +++ b/internal/crypto_cros/hmac.cc @@ -27,11 +27,11 @@ #include "absl/log/check.h" // nogncheck #endif -#include "internal/crypto/hmac.h" -#include "internal/crypto/nearby_base.h" -#include "internal/crypto/openssl_util.h" -#include "internal/crypto/secure_util.h" -#include "internal/crypto/symmetric_key.h" +#include "internal/crypto_cros/hmac.h" +#include "internal/crypto_cros/nearby_base.h" +#include "internal/crypto_cros/openssl_util.h" +#include "internal/crypto_cros/secure_util.h" +#include "internal/crypto_cros/symmetric_key.h" namespace crypto { diff --git a/internal/crypto/hmac.h b/internal/crypto_cros/hmac.h similarity index 98% rename from internal/crypto/hmac.h rename to internal/crypto_cros/hmac.h index c56d7c7b..12c806ba 100644 --- a/internal/crypto/hmac.h +++ b/internal/crypto_cros/hmac.h @@ -28,8 +28,8 @@ #include "absl/base/attributes.h" #include "absl/strings/string_view.h" #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" -#include "internal/crypto/nearby_base.h" +#include "internal/crypto_cros/crypto_export.h" +#include "internal/crypto_cros/nearby_base.h" namespace crypto { diff --git a/internal/crypto/hmac_unittest.cc b/internal/crypto_cros/hmac_unittest.cc similarity index 99% rename from internal/crypto/hmac_unittest.cc rename to internal/crypto_cros/hmac_unittest.cc index 99677752..5676f3be 100644 --- a/internal/crypto/hmac_unittest.cc +++ b/internal/crypto_cros/hmac_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/hmac.h" +#include "internal/crypto_cros/hmac.h" #include #include diff --git a/internal/crypto/nearby_base.cc b/internal/crypto_cros/nearby_base.cc similarity index 97% rename from internal/crypto/nearby_base.cc rename to internal/crypto_cros/nearby_base.cc index 1547ebaa..8f1d5bc1 100644 --- a/internal/crypto/nearby_base.cc +++ b/internal/crypto_cros/nearby_base.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/nearby_base.h" +#include "internal/crypto_cros/nearby_base.h" #include #include diff --git a/internal/crypto/nearby_base.h b/internal/crypto_cros/nearby_base.h similarity index 100% rename from internal/crypto/nearby_base.h rename to internal/crypto_cros/nearby_base.h diff --git a/internal/crypto/openssl_util.cc b/internal/crypto_cros/openssl_util.cc similarity index 96% rename from internal/crypto/openssl_util.cc rename to internal/crypto_cros/openssl_util.cc index acac591d..ac7b62e1 100644 --- a/internal/crypto/openssl_util.cc +++ b/internal/crypto_cros/openssl_util.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/openssl_util.h" #include #include diff --git a/internal/crypto/openssl_util.h b/internal/crypto_cros/openssl_util.h similarity index 98% rename from internal/crypto/openssl_util.h rename to internal/crypto_cros/openssl_util.h index f1af2ec9..07bbe8dc 100644 --- a/internal/crypto/openssl_util.h +++ b/internal/crypto_cros/openssl_util.h @@ -18,7 +18,7 @@ #include #include -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/random.cc b/internal/crypto_cros/random.cc similarity index 95% rename from internal/crypto/random.cc rename to internal/crypto_cros/random.cc index ee0ddf72..6889182a 100644 --- a/internal/crypto/random.cc +++ b/internal/crypto_cros/random.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/random.h" +#include "internal/crypto_cros/random.h" #include diff --git a/internal/crypto/random.h b/internal/crypto_cros/random.h similarity index 96% rename from internal/crypto/random.h rename to internal/crypto_cros/random.h index 1daacb71..86f247a3 100644 --- a/internal/crypto/random.h +++ b/internal/crypto_cros/random.h @@ -25,7 +25,7 @@ #include #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/random_unittest.cc b/internal/crypto_cros/random_unittest.cc similarity index 95% rename from internal/crypto/random_unittest.cc rename to internal/crypto_cros/random_unittest.cc index 4cf33ffa..201518f5 100644 --- a/internal/crypto/random_unittest.cc +++ b/internal/crypto_cros/random_unittest.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/random.h" +#include "internal/crypto_cros/random.h" #include #include #include "gtest/gtest.h" -#include "internal/crypto/nearby_base.h" +#include "internal/crypto_cros/nearby_base.h" #include "internal/platform/implementation/crypto.h" // Basic functionality tests. Does NOT test the security of the random data. diff --git a/internal/crypto/rsa_private_key.cc b/internal/crypto_cros/rsa_private_key.cc similarity index 97% rename from internal/crypto/rsa_private_key.cc rename to internal/crypto_cros/rsa_private_key.cc index 1924d99f..b275954e 100644 --- a/internal/crypto/rsa_private_key.cc +++ b/internal/crypto_cros/rsa_private_key.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/rsa_private_key.h" +#include "internal/crypto_cros/rsa_private_key.h" #include @@ -29,7 +29,7 @@ #endif #include "absl/types/span.h" -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/openssl_util.h" #include #include #include diff --git a/internal/crypto/rsa_private_key.h b/internal/crypto_cros/rsa_private_key.h similarity index 98% rename from internal/crypto/rsa_private_key.h rename to internal/crypto_cros/rsa_private_key.h index 58a8e986..5aaeb59b 100644 --- a/internal/crypto/rsa_private_key.h +++ b/internal/crypto_cros/rsa_private_key.h @@ -22,7 +22,7 @@ #include #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" #include namespace crypto { diff --git a/internal/crypto/rsa_private_key_unittest.cc b/internal/crypto_cros/rsa_private_key_unittest.cc similarity index 99% rename from internal/crypto/rsa_private_key_unittest.cc rename to internal/crypto_cros/rsa_private_key_unittest.cc index bfe25b49..e5202b03 100644 --- a/internal/crypto/rsa_private_key_unittest.cc +++ b/internal/crypto_cros/rsa_private_key_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/rsa_private_key.h" +#include "internal/crypto_cros/rsa_private_key.h" #include diff --git a/internal/crypto/secure_hash.cc b/internal/crypto_cros/secure_hash.cc similarity index 95% rename from internal/crypto/secure_hash.cc rename to internal/crypto_cros/secure_hash.cc index e950de1d..bf19c338 100644 --- a/internal/crypto/secure_hash.cc +++ b/internal/crypto_cros/secure_hash.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/secure_hash.h" +#include "internal/crypto_cros/secure_hash.h" #include #include -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/openssl_util.h" #include #include diff --git a/internal/crypto/secure_hash.h b/internal/crypto_cros/secure_hash.h similarity index 97% rename from internal/crypto/secure_hash.h rename to internal/crypto_cros/secure_hash.h index 32a30809..1f5ec9e1 100644 --- a/internal/crypto/secure_hash.h +++ b/internal/crypto_cros/secure_hash.h @@ -19,7 +19,7 @@ #include -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/secure_hash_unittest.cc b/internal/crypto_cros/secure_hash_unittest.cc similarity index 98% rename from internal/crypto/secure_hash_unittest.cc rename to internal/crypto_cros/secure_hash_unittest.cc index 94950328..ea6a55b5 100644 --- a/internal/crypto/secure_hash_unittest.cc +++ b/internal/crypto_cros/secure_hash_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/secure_hash.h" +#include "internal/crypto_cros/secure_hash.h" #include #include @@ -21,7 +21,7 @@ #include #include "gtest/gtest.h" -#include "internal/crypto/sha2.h" +#include "internal/crypto_cros/sha2.h" TEST(SecureHashTest, TestUpdate) { // Example B.3 from FIPS 180-2: long message. diff --git a/internal/crypto/secure_util.cc b/internal/crypto_cros/secure_util.cc similarity index 94% rename from internal/crypto/secure_util.cc rename to internal/crypto_cros/secure_util.cc index 9cc13b23..a026810e 100644 --- a/internal/crypto/secure_util.cc +++ b/internal/crypto_cros/secure_util.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/secure_util.h" +#include "internal/crypto_cros/secure_util.h" #include diff --git a/internal/crypto/secure_util.h b/internal/crypto_cros/secure_util.h similarity index 96% rename from internal/crypto/secure_util.h rename to internal/crypto_cros/secure_util.h index 4db08bbe..64322eca 100644 --- a/internal/crypto/secure_util.h +++ b/internal/crypto_cros/secure_util.h @@ -17,7 +17,7 @@ #include -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/sha2.cc b/internal/crypto_cros/sha2.cc similarity index 94% rename from internal/crypto/sha2.cc rename to internal/crypto_cros/sha2.cc index 32f06b89..77407f2b 100644 --- a/internal/crypto/sha2.cc +++ b/internal/crypto_cros/sha2.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/sha2.h" +#include "internal/crypto_cros/sha2.h" #include @@ -21,7 +21,7 @@ #include #include "absl/strings/string_view.h" -#include "internal/crypto/secure_hash.h" +#include "internal/crypto_cros/secure_hash.h" #include namespace crypto { diff --git a/internal/crypto/sha2.h b/internal/crypto_cros/sha2.h similarity index 97% rename from internal/crypto/sha2.h rename to internal/crypto_cros/sha2.h index bcf2bd61..ca9e7fb8 100644 --- a/internal/crypto/sha2.h +++ b/internal/crypto_cros/sha2.h @@ -23,7 +23,7 @@ #include "absl/strings/string_view.h" #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/sha2_unittest.cc b/internal/crypto_cros/sha2_unittest.cc similarity index 99% rename from internal/crypto/sha2_unittest.cc rename to internal/crypto_cros/sha2_unittest.cc index 69e66025..65c869ae 100644 --- a/internal/crypto/sha2_unittest.cc +++ b/internal/crypto_cros/sha2_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/sha2.h" +#include "internal/crypto_cros/sha2.h" #include #include diff --git a/internal/crypto/signature_verifier.cc b/internal/crypto_cros/signature_verifier.cc similarity index 97% rename from internal/crypto/signature_verifier.cc rename to internal/crypto_cros/signature_verifier.cc index 8157a384..01cbe278 100644 --- a/internal/crypto/signature_verifier.cc +++ b/internal/crypto_cros/signature_verifier.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/signature_verifier.h" +#include "internal/crypto_cros/signature_verifier.h" #include @@ -24,7 +24,7 @@ #include "absl/log/check.h" // nogncheck #endif -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/openssl_util.h" #include #include #include diff --git a/internal/crypto/signature_verifier.h b/internal/crypto_cros/signature_verifier.h similarity index 98% rename from internal/crypto/signature_verifier.h rename to internal/crypto_cros/signature_verifier.h index 18a00202..6ce8af2f 100644 --- a/internal/crypto/signature_verifier.h +++ b/internal/crypto_cros/signature_verifier.h @@ -21,7 +21,7 @@ #include #include "absl/types/span.h" -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/signature_verifier_unittest.cc b/internal/crypto_cros/signature_verifier_unittest.cc similarity index 99% rename from internal/crypto/signature_verifier_unittest.cc rename to internal/crypto_cros/signature_verifier_unittest.cc index 70e9ea44..c6f7bd82 100644 --- a/internal/crypto/signature_verifier_unittest.cc +++ b/internal/crypto_cros/signature_verifier_unittest.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/signature_verifier.h" +#include "internal/crypto_cros/signature_verifier.h" #include #include diff --git a/internal/crypto/symmetric_key.cc b/internal/crypto_cros/symmetric_key.cc similarity index 97% rename from internal/crypto/symmetric_key.cc rename to internal/crypto_cros/symmetric_key.cc index a3beddfd..06178d1e 100644 --- a/internal/crypto/symmetric_key.cc +++ b/internal/crypto_cros/symmetric_key.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/symmetric_key.h" +#include "internal/crypto_cros/symmetric_key.h" #include #include @@ -30,8 +30,8 @@ #include "absl/log/check.h" // nogncheck #endif -#include "internal/crypto/nearby_base.h" -#include "internal/crypto/openssl_util.h" +#include "internal/crypto_cros/nearby_base.h" +#include "internal/crypto_cros/openssl_util.h" #include #include diff --git a/internal/crypto/symmetric_key.h b/internal/crypto_cros/symmetric_key.h similarity index 98% rename from internal/crypto/symmetric_key.h rename to internal/crypto_cros/symmetric_key.h index 054a8ad1..cdcc2d8a 100644 --- a/internal/crypto/symmetric_key.h +++ b/internal/crypto_cros/symmetric_key.h @@ -20,7 +20,7 @@ #include #include -#include "internal/crypto/crypto_export.h" +#include "internal/crypto_cros/crypto_export.h" namespace crypto { diff --git a/internal/crypto/symmetric_key_unittest.cc b/internal/crypto_cros/symmetric_key_unittest.cc similarity index 98% rename from internal/crypto/symmetric_key_unittest.cc rename to internal/crypto_cros/symmetric_key_unittest.cc index 4fe70b41..ad3e684d 100644 --- a/internal/crypto/symmetric_key_unittest.cc +++ b/internal/crypto_cros/symmetric_key_unittest.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "internal/crypto/symmetric_key.h" +#include "internal/crypto_cros/symmetric_key.h" #include #include #include "gtest/gtest.h" #include "absl/strings/ascii.h" -#include "internal/crypto/nearby_base.h" +#include "internal/crypto_cros/nearby_base.h" TEST(SymmetricKeyTest, GenerateRandomKey) { std::unique_ptr key( diff --git a/internal/platform/BUILD b/internal/platform/BUILD index c6daaee4..28dbd748 100644 --- a/internal/platform/BUILD +++ b/internal/platform/BUILD @@ -373,7 +373,7 @@ cc_library( ":base", ":logging", ":util", - "//internal/crypto", + "//internal/crypto_cros", "//internal/platform/implementation:platform", "//internal/platform/implementation:types", "@com_google_absl//absl/base:core_headers", diff --git a/internal/platform/implementation/BUILD b/internal/platform/implementation/BUILD index 4d061537..a9203745 100644 --- a/internal/platform/implementation/BUILD +++ b/internal/platform/implementation/BUILD @@ -41,7 +41,7 @@ cc_library( visibility = [ "//connections/implementation/analytics:__subpackages__", "//fastpair:__subpackages__", - "//internal/crypto:__pkg__", + "//internal/crypto_cros:__pkg__", "//internal/platform:__pkg__", "//internal/platform/implementation:__subpackages__", "//internal/preferences:__subpackages__", @@ -53,7 +53,7 @@ cc_library( "//third_party/nearby/sharing:__subpackages__", ], deps = [ - "//internal/crypto", + "//internal/crypto_cros", "//internal/platform:base", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/functional:any_invocable", diff --git a/internal/platform/implementation/crypto.h b/internal/platform/implementation/crypto.h index ef53ff53..6bd16e52 100644 --- a/internal/platform/implementation/crypto.h +++ b/internal/platform/implementation/crypto.h @@ -19,7 +19,7 @@ #ifdef NEARBY_CHROMIUM #include "crypto/random.h" #else -#include "internal/crypto/random.h" +#include "internal/crypto_cros/random.h" #endif #include "internal/platform/byte_array.h" diff --git a/presence/implementation/BUILD b/presence/implementation/BUILD index d62eb726..97fc31b2 100644 --- a/presence/implementation/BUILD +++ b/presence/implementation/BUILD @@ -84,6 +84,7 @@ cc_library( ], deps = [ "//internal/crypto", + "//internal/crypto_cros", "//internal/platform:base", "//internal/platform:comm", "//internal/platform:logging", @@ -285,6 +286,7 @@ cc_test( deps = [ ":internal", "//internal/crypto", + "//internal/crypto_cros", "//internal/proto:credential_cc_proto", "//internal/proto:local_credential_cc_proto", "//presence/proto:presence_frame_cc_proto", diff --git a/presence/implementation/connection_authenticator.cc b/presence/implementation/connection_authenticator.cc index 44781602..4ee90609 100644 --- a/presence/implementation/connection_authenticator.cc +++ b/presence/implementation/connection_authenticator.cc @@ -24,8 +24,8 @@ #include "absl/strings/string_view.h" #include "absl/types/variant.h" #include "internal/crypto/ed25519.h" -#include "internal/crypto/hkdf.h" -#include "internal/crypto/secure_util.h" +#include "internal/crypto_cros/hkdf.h" +#include "internal/crypto_cros/secure_util.h" #include "internal/proto/credential.pb.h" #include "internal/proto/local_credential.pb.h" diff --git a/presence/implementation/credential_manager_impl.cc b/presence/implementation/credential_manager_impl.cc index 88ce0190..7696ce0b 100644 --- a/presence/implementation/credential_manager_impl.cc +++ b/presence/implementation/credential_manager_impl.cc @@ -34,10 +34,10 @@ #include "crypto/hkdf.h" #include "crypto/random.h" #else -#include "internal/crypto/aead.h" -#include "internal/crypto/ec_private_key.h" -#include "internal/crypto/hkdf.h" -#include "internal/crypto/random.h" +#include "internal/crypto_cros/aead.h" +#include "internal/crypto_cros/ec_private_key.h" +#include "internal/crypto_cros/hkdf.h" +#include "internal/crypto_cros/random.h" #endif #include "internal/platform/base64_utils.h" #include "internal/platform/future.h"