• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2025 The Android Open-Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://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,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19cc_library {
20    name: "hwcryptohallib",
21    enabled: false,
22    shared_libs: [
23        "libbase",
24        "liblog",
25        "libbinder",
26        "libbinder_ndk",
27        "libbinder_trusty",
28        "libtrusty",
29        "libutils",
30
31        // AIDL interface deps versions, please refer to below link
32        // https://source.android.com/docs/core/architecture/aidl/stable-aidl#module-naming-rules
33        "android.hardware.security.see.hwcrypto-V1-ndk",
34        "android.hardware.security.see.hwcrypto-V1-cpp",
35    ],
36    cflags: [
37        "-Wall",
38        "-Werror",
39    ],
40    srcs: ["hwcryptolib.cpp"],
41    proprietary: true,
42    arch: {
43        arm64: {
44            enabled: true,
45        },
46    },
47}
48
49cc_binary {
50    name: "android.hardware.trusty.hwcryptohal-service",
51    enabled: false,
52    relative_install_path: "hw",
53    srcs: [
54        "hwcrypto_delegator.cpp",
55    ],
56    shared_libs: [
57        "libbase",
58        "liblog",
59        "libbinder",
60        "libbinder_ndk",
61        "libbinder_trusty",
62        "libtrusty",
63        "libutils",
64        "hwcryptohallib",
65
66        // AIDL interface deps versions, please refer to below link
67        // https://source.android.com/docs/core/architecture/aidl/stable-aidl#module-naming-rules
68        "android.hardware.security.see.hwcrypto-V1-ndk",
69        "android.hardware.security.see.hwcrypto-V1-cpp",
70    ],
71    cflags: [
72        "-Wall",
73        "-Werror",
74    ],
75    proprietary: true,
76    vintf_fragments: ["android.hardware.security.see.hwcrypto-service.trusty.xml"],
77    init_rc: ["android.hardware.security.see.hwcrypto-service.trusty.rc"],
78    arch: {
79        arm64: {
80            enabled: true,
81        },
82    },
83}
84
85cc_fuzz {
86    name: "android.hardware.trusty.hwcryptohal-service_fuzzer",
87    enabled: false,
88    defaults: ["service_fuzzer_defaults"],
89    static_libs: [
90        "android.hardware.security.see.hwcrypto-V1-ndk",
91        "android.hardware.security.see.hwcrypto-V1-cpp",
92        "liblog",
93        "hwcryptohallib",
94    ],
95    shared_libs: [
96        "libbinder_trusty",
97        "libtrusty",
98    ],
99    srcs: ["fuzzer.cpp"],
100    fuzz_config: {
101        cc: [
102            "oarbildo@google.com",
103        ],
104    },
105    arch: {
106        arm64: {
107            enabled: true,
108        },
109    },
110}
111
112cc_test {
113    name: "HwCryptoHalDelegatorTests",
114    enabled: false,
115    require_root: true,
116    srcs: [
117        "delegatorTest.cpp",
118    ],
119    cflags: [
120        "-Wall",
121        "-Werror",
122        "-Wextra",
123    ],
124
125    shared_libs: [
126        "libbase",
127        "liblog",
128        "libutils",
129        "libbinder",
130        "libbinder_ndk",
131    ],
132    static_libs: [
133        "android.hardware.security.see.hwcrypto-V1-ndk",
134        "android.hardware.security.see.hwcrypto-V1-cpp",
135        "hwcryptohallib",
136    ],
137
138    arch: {
139        arm64: {
140            enabled: true,
141        },
142    },
143}
144