• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// This file is generated by cargo2android.py --config cargo2android.json.
2// Do not modify this file as changes will be overridden on upgrade.
3
4package {
5    default_applicable_licenses: ["external_rust_crates_ring_license"],
6}
7
8// Added automatically by a large-scale-change that took the approach of
9// 'apply every license found to every target'. While this makes sure we respect
10// every license restriction, it may not be entirely correct.
11//
12// e.g. GPL in an MIT project might only apply to the contrib/ directory.
13//
14// Please consider splitting the single license below into multiple licenses,
15// taking care not to lose any license_kind information, and overriding the
16// default license using the 'licenses: [...]' property on targets as needed.
17//
18// For unused files, consider creating a 'fileGroup' with "//visibility:private"
19// to attach the license to, and including a comment whether the files may be
20// used in the current project.
21// See: http://go/android-license-faq
22license {
23    name: "external_rust_crates_ring_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-BSD",
27        "SPDX-license-identifier-ISC",
28        "SPDX-license-identifier-MIT",
29        "SPDX-license-identifier-OpenSSL",
30        "legacy_unencumbered",
31    ],
32    license_text: [
33        "LICENSE",
34    ],
35}
36
37rust_library {
38    name: "libring",
39    host_supported: true,
40    crate_name: "ring",
41    cargo_env_compat: true,
42    cargo_pkg_version: "0.16.20",
43    srcs: ["src/lib.rs"],
44    edition: "2018",
45    features: [
46        "alloc",
47        "default",
48        "dev_urandom_fallback",
49        "once_cell",
50        "std",
51    ],
52    rustlibs: [
53        "liblibc",
54        "libonce_cell",
55        "libspin",
56        "libuntrusted",
57    ],
58    whole_static_libs: [
59        "libring-core",
60        "libring-test",
61    ],
62    apex_available: [
63        "//apex_available:platform",
64        "com.android.compos",
65        "com.android.resolv",
66        "com.android.virt",
67    ],
68    min_sdk_version: "29",
69}
70
71rust_test {
72    name: "ring_test_src_lib",
73    host_supported: true,
74    crate_name: "ring",
75    cargo_env_compat: true,
76    cargo_pkg_version: "0.16.20",
77    srcs: ["src/lib.rs"],
78    test_suites: ["general-tests"],
79    auto_gen_config: true,
80    test_options: {
81        unit_test: true,
82    },
83    edition: "2018",
84    features: [
85        "alloc",
86        "default",
87        "dev_urandom_fallback",
88        "once_cell",
89        "std",
90    ],
91    rustlibs: [
92        "liblibc",
93        "libonce_cell",
94        "libspin",
95        "libuntrusted",
96    ],
97    whole_static_libs: [
98        "libring-core",
99        "libring-test",
100    ],
101}
102
103rust_defaults {
104    name: "ring_test_defaults",
105    crate_name: "ring",
106    cargo_env_compat: true,
107    cargo_pkg_version: "0.16.20",
108    test_suites: ["general-tests"],
109    auto_gen_config: true,
110    edition: "2018",
111    features: [
112        "alloc",
113        "default",
114        "dev_urandom_fallback",
115        "once_cell",
116        "std",
117    ],
118    rustlibs: [
119        "liblibc",
120        "libonce_cell",
121        "libring",
122        "libspin",
123        "libuntrusted",
124    ],
125}
126
127rust_test {
128    name: "ring_test_tests_aead_tests",
129    defaults: ["ring_test_defaults"],
130    host_supported: true,
131    srcs: ["tests/aead_tests.rs"],
132    test_options: {
133        unit_test: true,
134    },
135}
136
137rust_test {
138    name: "ring_test_tests_agreement_tests",
139    defaults: ["ring_test_defaults"],
140    host_supported: true,
141    srcs: ["tests/agreement_tests.rs"],
142    test_options: {
143        unit_test: true,
144    },
145}
146
147rust_test {
148    name: "ring_test_tests_constant_time_tests",
149    defaults: ["ring_test_defaults"],
150    host_supported: true,
151    srcs: ["tests/constant_time_tests.rs"],
152    test_options: {
153        unit_test: true,
154    },
155}
156
157rust_test {
158    name: "ring_test_tests_digest_tests",
159    defaults: ["ring_test_defaults"],
160    host_supported: true,
161    srcs: ["tests/digest_tests.rs"],
162    test_options: {
163        unit_test: true,
164    },
165}
166
167rust_test {
168    name: "ring_test_tests_ecdsa_tests",
169    defaults: ["ring_test_defaults"],
170    host_supported: true,
171    srcs: ["tests/ecdsa_tests.rs"],
172    test_options: {
173        unit_test: true,
174    },
175}
176
177rust_test {
178    name: "ring_test_tests_ed25519_tests",
179    defaults: ["ring_test_defaults"],
180    host_supported: true,
181    srcs: ["tests/ed25519_tests.rs"],
182    test_options: {
183        unit_test: true,
184    },
185}
186
187rust_test {
188    name: "ring_test_tests_hkdf_tests",
189    defaults: ["ring_test_defaults"],
190    host_supported: true,
191    srcs: ["tests/hkdf_tests.rs"],
192    test_options: {
193        unit_test: true,
194    },
195}
196
197rust_test {
198    name: "ring_test_tests_hmac_tests",
199    defaults: ["ring_test_defaults"],
200    host_supported: true,
201    srcs: ["tests/hmac_tests.rs"],
202    test_options: {
203        unit_test: true,
204    },
205}
206
207rust_test {
208    name: "ring_test_tests_pbkdf2_tests",
209    defaults: ["ring_test_defaults"],
210    host_supported: true,
211    srcs: ["tests/pbkdf2_tests.rs"],
212    test_options: {
213        unit_test: true,
214    },
215}
216
217rust_test {
218    name: "ring_test_tests_quic_tests",
219    defaults: ["ring_test_defaults"],
220    host_supported: true,
221    srcs: ["tests/quic_tests.rs"],
222    test_options: {
223        unit_test: true,
224    },
225}
226
227rust_test {
228    name: "ring_test_tests_rand_tests",
229    defaults: ["ring_test_defaults"],
230    host_supported: true,
231    srcs: ["tests/rand_tests.rs"],
232    test_options: {
233        unit_test: true,
234    },
235}
236
237rust_test {
238    name: "ring_test_tests_rsa_tests",
239    defaults: ["ring_test_defaults"],
240    host_supported: true,
241    srcs: ["tests/rsa_tests.rs"],
242    test_options: {
243        unit_test: true,
244    },
245}
246
247rust_test {
248    name: "ring_test_tests_signature_tests",
249    defaults: ["ring_test_defaults"],
250    host_supported: true,
251    srcs: ["tests/signature_tests.rs"],
252    test_options: {
253        unit_test: true,
254    },
255}
256
257cc_library_static {
258    name: "libring-core",
259    host_supported: true,
260    srcs: [
261        "crypto/cpu-intel.c",
262        "crypto/fipsmodule/aes/aes_nohw.c",
263        "crypto/crypto.c",
264        "crypto/poly1305/poly1305.c",
265        "crypto/poly1305/poly1305_vec.c",
266        "crypto/curve25519/curve25519.c",
267        "crypto/fipsmodule/ec/ecp_nistz.c",
268        "crypto/fipsmodule/ec/ecp_nistz256.c",
269        "crypto/fipsmodule/ec/gfp_p256.c",
270        "crypto/fipsmodule/ec/gfp_p384.c",
271        "crypto/limbs/limbs.c",
272        "crypto/mem.c",
273        "crypto/fipsmodule/bn/montgomery.c",
274        "crypto/fipsmodule/bn/montgomery_inv.c",
275    ],
276
277    arch: {
278        arm: {
279            srcs: [
280                "crypto/poly1305/poly1305_arm.c",
281                "crypto/poly1305/poly1305_arm_asm.S",
282                "pregenerated/armv4-mont-linux32.S",
283                "crypto/curve25519/asm/x25519-asm-arm.S",
284                "pregenerated/sha256-armv4-linux32.S",
285                "pregenerated/sha512-armv4-linux32.S",
286                "pregenerated/ecp_nistz256-armv4-linux32.S",
287                "pregenerated/aesv8-armx-linux32.S",
288                "pregenerated/bsaes-armv7-linux32.S",
289                "pregenerated/ghashv8-armx-linux32.S",
290                "pregenerated/vpaes-armv7-linux32.S",
291                "pregenerated/ghash-armv4-linux32.S",
292                "pregenerated/chacha-armv4-linux32.S",
293            ],
294        },
295        arm64: {
296            srcs: [
297                "pregenerated/aesv8-armx-linux64.S",
298                "pregenerated/armv8-mont-linux64.S",
299                "pregenerated/chacha-armv8-linux64.S",
300                "pregenerated/ecp_nistz256-armv8-linux64.S",
301                "pregenerated/ghash-neon-armv8-linux64.S",
302                "pregenerated/ghashv8-armx-linux64.S",
303                "pregenerated/sha256-armv8-linux64.S",
304                "pregenerated/sha512-armv8-linux64.S",
305                "pregenerated/vpaes-armv8-linux64.S",
306            ],
307        },
308        x86: {
309            srcs: [
310                "pregenerated/aesni-x86-elf.S",
311                "pregenerated/chacha-x86-elf.S",
312                "pregenerated/ecp_nistz256-x86-elf.S",
313                "pregenerated/ghash-x86-elf.S",
314                "pregenerated/vpaes-x86-elf.S",
315                "pregenerated/x86-mont-elf.S",
316            ],
317        },
318        x86_64: {
319            srcs: [
320                "pregenerated/aesni-gcm-x86_64-elf.S",
321                "pregenerated/aesni-x86_64-elf.S",
322                "pregenerated/chacha-x86_64-elf.S",
323                "pregenerated/chacha20_poly1305_x86_64-elf.S",
324                "pregenerated/ghash-x86_64-elf.S",
325                "pregenerated/p256-x86_64-asm-elf.S",
326                "pregenerated/sha256-x86_64-elf.S",
327                "pregenerated/sha512-x86_64-elf.S",
328                "pregenerated/vpaes-x86_64-elf.S",
329                "pregenerated/x86_64-mont5-elf.S",
330                "pregenerated/x86_64-mont-elf.S",
331            ],
332        },
333    },
334
335    cflags: [
336        "-O3",
337        "-Wno-error",
338        "-fPIC",
339        "-fdata-sections",
340        "-ffunction-sections",
341        "-fno-omit-frame-pointer",
342        "-fno-strict-aliasing",
343        "-fstack-protector",
344        "-fvisibility=hidden",
345        "-DNDEBUG",
346    ],
347    local_include_dirs: ["include"],
348    apex_available: [
349        "//apex_available:platform",
350        "com.android.compos",
351        "com.android.resolv",
352        "com.android.virt",
353    ],
354    min_sdk_version: "29",
355}
356
357cc_library_static {
358    name: "libring-test",
359    host_supported: true,
360    srcs: [
361        "crypto/constant_time_test.c",
362    ],
363    local_include_dirs: ["include"],
364    apex_available: [
365        "//apex_available:platform",
366        "com.android.compos",
367        "com.android.resolv",
368        "com.android.virt",
369    ],
370    min_sdk_version: "29",
371}
372