1# Copyright 2021 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_facade", 18 "pw_cc_library", 19 "pw_cc_test", 20) 21 22package(default_visibility = ["//visibility:public"]) 23 24licenses(["notice"]) 25 26pw_cc_facade( 27 name = "sha256_facade", 28 hdrs = [ 29 "public/pw_crypto/sha256.h", 30 ], 31 includes = ["public"], 32 deps = [ 33 "//pw_assert", 34 "//pw_bytes", 35 "//pw_status", 36 ], 37) 38 39pw_cc_library( 40 name = "sha256_mbedtls", 41 srcs = ["sha256_mbedtls.cc"], 42 hdrs = [ 43 "public/pw_crypto/sha256_mbedtls.h", 44 "public_overrides/mbedtls/pw_crypto/sha256_backend.h", 45 ], 46 includes = ["public_overrides"], 47 deps = [":sha256_facade"], 48) 49 50pw_cc_library( 51 name = "sha256_boringssl", 52 srcs = ["sha256_boringssl.cc"], 53 hdrs = [ 54 "public/pw_crypto/sha256_boringssl.h", 55 "public_overrides/boringssl/pw_crypto/sha256_backend.h", 56 ], 57 includes = ["public_overrides"], 58 deps = [":sha256_facade"], 59) 60 61pw_cc_test( 62 name = "sha256_test", 63 srcs = ["sha256_test.cc"], 64 deps = [ 65 ":sha256_facade", 66 "//pw_unit_test", 67 ], 68) 69 70pw_cc_library( 71 name = "sha256_mock", 72 srcs = ["sha256_mock.cc"], 73 hdrs = [ 74 "public/pw_crypto/sha256_mock.h", 75 "public_overrides/mock/pw_crypto/sha256_backend.h", 76 ], 77 includes = ["public_overrides"], 78 deps = [":sha256_facade"], 79) 80 81pw_cc_test( 82 name = "sha256_mock_test", 83 srcs = ["sha256_mock_test.cc"], 84 deps = [ 85 ":sha256_facade", 86 ":sha256_mock", 87 "//pw_unit_test", 88 ], 89) 90 91pw_cc_facade( 92 name = "ecdsa_facade", 93 hdrs = [ 94 "public/pw_crypto/ecdsa.h", 95 ], 96 includes = ["public"], 97 deps = [ 98 "//pw_bytes", 99 "//pw_status", 100 ], 101) 102 103pw_cc_library( 104 name = "ecdsa_mbedtls", 105 srcs = ["ecdsa_mbedtls.cc"], 106 deps = [":ecdsa_facade"], 107) 108 109pw_cc_library( 110 name = "ecdsa_boringssl", 111 srcs = ["ecdsa_boringssl.cc"], 112 deps = [":ecdsa_facade"], 113) 114 115pw_cc_library( 116 name = "ecdsa_uecc", 117 srcs = [ 118 "ecdsa_uecc.cc", 119 "micro-ecc/uEDD.c", 120 ], 121 deps = [":ecdsa_facade"], 122) 123 124pw_cc_test( 125 name = "ecdsa_test", 126 srcs = ["ecdsa_test.cc"], 127 deps = [ 128 ":ecdsa_facade", 129 "//pw_unit_test", 130 ], 131) 132