mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Refactor crypto/ directory into crypto_cros/ and crypto/
PiperOrigin-RevId: 549467911
This commit is contained in:
committed by
Copybara-Service
parent
e5fdddec6d
commit
0e44ed626d
+12
-11
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "internal/crypto/random.h"
|
||||
#include "internal/crypto_cros/random.h"
|
||||
#include "internal/interop/device.h"
|
||||
#include "internal/platform/connection_info.h"
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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",
|
||||
],
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+5
-60
@@ -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",
|
||||
|
||||
@@ -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 <openssl/base.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/statusor.h"
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
#include <openssl/base.h>
|
||||
#include <openssl/digest.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
@@ -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",
|
||||
],
|
||||
)
|
||||
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -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 <openssl/aes.h>
|
||||
#include <openssl/evp.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;
|
||||
|
||||
@@ -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 <optional>
|
||||
#include <string>
|
||||
@@ -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 <openssl/bn.h>
|
||||
#include <openssl/bytestring.h>
|
||||
#include <openssl/ec.h>
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/span.h"
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
#include <openssl/base.h>
|
||||
|
||||
namespace crypto {
|
||||
+1
-1
@@ -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 <stdint.h>
|
||||
|
||||
+2
-2
@@ -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 <memory>
|
||||
|
||||
#include "internal/crypto/ec_signature_creator_impl.h"
|
||||
#include "internal/crypto_cros/ec_signature_creator_impl.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/span.h"
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
+3
-3
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#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 <openssl/bn.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/ecdsa.h>
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/span.h"
|
||||
#include "internal/crypto/ec_signature_creator.h"
|
||||
#include "internal/crypto_cros/ec_signature_creator.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
+4
-4
@@ -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 <stdint.h>
|
||||
|
||||
@@ -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.
|
||||
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -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 <openssl/aes.h>
|
||||
#include <openssl/evp.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 {
|
||||
|
||||
@@ -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 <stddef.h>
|
||||
|
||||
@@ -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<crypto::SymmetricKey> key(
|
||||
@@ -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 <openssl/digest.h>
|
||||
|
||||
namespace crypto {
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -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 <cstddef>
|
||||
#include <limits>
|
||||
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
@@ -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 <stddef.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/types/span.h"
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
@@ -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 <stddef.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#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.
|
||||
@@ -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 <stdint.h>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include "absl/types/span.h"
|
||||
#include "internal/crypto/openssl_util.h"
|
||||
#include "internal/crypto_cros/openssl_util.h"
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/bytestring.h>
|
||||
#include <openssl/evp.h>
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/span.h"
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
#include <openssl/base.h>
|
||||
|
||||
namespace crypto {
|
||||
+1
-1
@@ -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 <stdint.h>
|
||||
|
||||
@@ -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 <stddef.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "internal/crypto/openssl_util.h"
|
||||
#include "internal/crypto_cros/openssl_util.h"
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
+2
-2
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <string>
|
||||
|
||||
#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.
|
||||
@@ -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 <openssl/mem.h>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
@@ -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 <stddef.h>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "internal/crypto/secure_hash.h"
|
||||
#include "internal/crypto_cros/secure_hash.h"
|
||||
#include <openssl/sha.h>
|
||||
|
||||
namespace crypto {
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -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 <memory>
|
||||
|
||||
@@ -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 <openssl/bytestring.h>
|
||||
#include <openssl/digest.h>
|
||||
#include <openssl/evp.h>
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/span.h"
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
+1
-1
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -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 <openssl/evp.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "internal/crypto/crypto_export.h"
|
||||
#include "internal/crypto_cros/crypto_export.h"
|
||||
|
||||
namespace crypto {
|
||||
|
||||
+2
-2
@@ -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 <memory>
|
||||
#include <string>
|
||||
|
||||
#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<crypto::SymmetricKey> key(
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user