blob: 49e26d297e55541a4283b3a166b003b379a62756 [file] [log] [blame]
Luke Huang0d2595c2021-03-30 05:41:05 +08001// This file is generated by cargo2android.py --run --device --dependencies --features alloc,default,dev_urandom_fallback,once_cell,std --tests --patch=patches/Android.bp.diff.
2// Do not modify this file as changes will be overridden on upgrade.
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +01003
Bob Badour678911e2021-02-12 15:51:06 -08004package {
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
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +010037rust_library {
38 name: "libring",
Luke Huang0d2595c2021-03-30 05:41:05 +080039 // has rustc warnings
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +010040 host_supported: true,
41 crate_name: "ring",
42 srcs: ["src/lib.rs"],
43 edition: "2018",
44 features: [
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +010045 "alloc",
46 "default",
47 "dev_urandom_fallback",
48 "once_cell",
Luke Huang0d2595c2021-03-30 05:41:05 +080049 "std",
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +010050 ],
51 rustlibs: [
52 "liblibc",
53 "libonce_cell",
54 "libspin",
55 "libuntrusted",
56 ],
57 static_libs: [
58 "libring-core",
59 ],
Bernie Innocenti8dea2192020-12-12 02:54:01 +090060 apex_available: [
61 "//apex_available:platform",
62 "com.android.resolv",
63 ],
64 min_sdk_version: "29",
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +010065}
66
67rust_defaults {
68 name: "ring_defaults",
69 crate_name: "ring",
Luke Huang0d2595c2021-03-30 05:41:05 +080070 // has rustc warnings
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +010071 srcs: ["src/lib.rs"],
72 test_suites: ["general-tests"],
73 auto_gen_config: true,
74 edition: "2018",
75 features: [
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +010076 "alloc",
77 "default",
78 "dev_urandom_fallback",
79 "once_cell",
Luke Huang0d2595c2021-03-30 05:41:05 +080080 "std",
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +010081 ],
82 rustlibs: [
83 "liblibc",
84 "libonce_cell",
85 "libspin",
86 "libuntrusted",
87 ],
88 static_libs: [
89 "libring-core",
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +010090 "libring-test",
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +010091 ],
92}
93
94cc_library_static {
95 name: "libring-core",
96 host_supported: true,
97 srcs: [
98 "crypto/cpu-intel.c",
99 "crypto/fipsmodule/aes/aes_nohw.c",
100 "crypto/crypto.c",
101 "crypto/poly1305/poly1305.c",
102 "crypto/poly1305/poly1305_vec.c",
103 "crypto/curve25519/curve25519.c",
104 "crypto/fipsmodule/ec/ecp_nistz.c",
105 "crypto/fipsmodule/ec/ecp_nistz256.c",
106 "crypto/fipsmodule/ec/gfp_p256.c",
107 "crypto/fipsmodule/ec/gfp_p384.c",
108 "crypto/limbs/limbs.c",
109 "crypto/mem.c",
110 "crypto/fipsmodule/bn/montgomery.c",
111 "crypto/fipsmodule/bn/montgomery_inv.c",
112 ],
113
114 arch: {
115 arm: {
116 srcs: [
117 "crypto/poly1305/poly1305_arm.c",
118 "crypto/poly1305/poly1305_arm_asm.S",
119 "pregenerated/armv4-mont-linux32.S",
120 "crypto/curve25519/asm/x25519-asm-arm.S",
121 "pregenerated/sha256-armv4-linux32.S",
122 "pregenerated/sha512-armv4-linux32.S",
123 "pregenerated/ecp_nistz256-armv4-linux32.S",
124 "pregenerated/aesv8-armx-linux32.S",
125 "pregenerated/bsaes-armv7-linux32.S",
126 "pregenerated/ghashv8-armx-linux32.S",
127 "pregenerated/vpaes-armv7-linux32.S",
128 "pregenerated/ghash-armv4-linux32.S",
129 "pregenerated/chacha-armv4-linux32.S",
130 ],
131 },
132 arm64: {
133 srcs: [
134 "pregenerated/aesv8-armx-linux64.S",
135 "pregenerated/armv8-mont-linux64.S",
136 "pregenerated/chacha-armv8-linux64.S",
137 "pregenerated/ecp_nistz256-armv8-linux64.S",
138 "pregenerated/ghash-neon-armv8-linux64.S",
139 "pregenerated/ghashv8-armx-linux64.S",
140 "pregenerated/sha256-armv8-linux64.S",
141 "pregenerated/sha512-armv8-linux64.S",
142 "pregenerated/vpaes-armv8-linux64.S",
143 ],
144 },
145 x86: {
146 srcs: [
147 "pregenerated/aesni-x86-elf.S",
148 "pregenerated/chacha-x86-elf.S",
149 "pregenerated/ecp_nistz256-x86-elf.S",
150 "pregenerated/ghash-x86-elf.S",
151 "pregenerated/vpaes-x86-elf.S",
152 "pregenerated/x86-mont-elf.S",
153 ],
154 },
155 x86_64: {
156 srcs: [
157 "pregenerated/aesni-gcm-x86_64-elf.S",
158 "pregenerated/aesni-x86_64-elf.S",
159 "pregenerated/chacha-x86_64-elf.S",
160 "pregenerated/ghash-x86_64-elf.S",
161 "pregenerated/p256-x86_64-asm-elf.S",
162 "pregenerated/sha256-x86_64-elf.S",
163 "pregenerated/sha512-x86_64-elf.S",
164 "pregenerated/vpaes-x86_64-elf.S",
165 "pregenerated/x86_64-mont5-elf.S",
166 "pregenerated/x86_64-mont-elf.S",
167 ],
168 },
169 },
170
171 cflags: [
172 "-O3",
173 "-Wno-error",
174 "-fPIC",
175 "-fdata-sections",
176 "-ffunction-sections",
177 "-fno-omit-frame-pointer",
178 "-fno-strict-aliasing",
179 "-fstack-protector",
180 "-fvisibility=hidden",
181 "-DNDEBUG",
182 ],
183 local_include_dirs: ["include"],
Bernie Innocenti8dea2192020-12-12 02:54:01 +0900184 apex_available: [
185 "//apex_available:platform",
186 "com.android.resolv",
187 ],
188 min_sdk_version: "29",
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +0100189}
190
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100191cc_library_static {
192 name: "libring-test",
193 host_supported: true,
194 srcs: [
195 "crypto/constant_time_test.c",
196 ],
197 local_include_dirs: ["include"],
198}
199
200rust_test_host {
201 name: "ring_host_test_src_lib",
202 defaults: ["ring_defaults"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800203 test_options: {
204 unit_test: true,
205 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100206}
207
208rust_test {
209 name: "ring_device_test_src_lib",
210 defaults: ["ring_defaults"],
211}
212
213rust_defaults {
214 name: "ring_defaults_ring",
215 crate_name: "ring",
216 test_suites: ["general-tests"],
217 auto_gen_config: true,
218 edition: "2018",
219 features: [
220 "alloc",
221 "default",
222 "dev_urandom_fallback",
223 "once_cell",
Luke Huang0d2595c2021-03-30 05:41:05 +0800224 "std",
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100225 ],
226 rustlibs: [
227 "liblibc",
228 "libonce_cell",
229 "libring",
230 "libspin",
231 "libuntrusted",
232 ],
233}
234
235rust_test_host {
236 name: "ring_host_test_tests_aead_tests",
237 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800238 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100239 srcs: ["tests/aead_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800240 test_options: {
241 unit_test: true,
242 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100243}
244
245rust_test {
246 name: "ring_device_test_tests_aead_tests",
247 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800248 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100249 srcs: ["tests/aead_tests.rs"],
250}
251
252rust_test_host {
253 name: "ring_host_test_tests_agreement_tests",
254 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800255 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100256 srcs: ["tests/agreement_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800257 test_options: {
258 unit_test: true,
259 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100260}
261
262rust_test {
263 name: "ring_device_test_tests_agreement_tests",
264 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800265 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100266 srcs: ["tests/agreement_tests.rs"],
267}
268
269rust_test_host {
270 name: "ring_host_test_tests_constant_time_tests",
271 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800272 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100273 srcs: ["tests/constant_time_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800274 test_options: {
275 unit_test: true,
276 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100277}
278
279rust_test {
280 name: "ring_device_test_tests_constant_time_tests",
281 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800282 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100283 srcs: ["tests/constant_time_tests.rs"],
284}
285
286rust_test_host {
287 name: "ring_host_test_tests_digest_tests",
288 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800289 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100290 srcs: ["tests/digest_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800291 test_options: {
292 unit_test: true,
293 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100294}
295
296rust_test {
297 name: "ring_device_test_tests_digest_tests",
298 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800299 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100300 srcs: ["tests/digest_tests.rs"],
301}
302
303rust_test_host {
304 name: "ring_host_test_tests_ecdsa_tests",
305 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800306 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100307 srcs: ["tests/ecdsa_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800308 test_options: {
309 unit_test: true,
310 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100311}
312
313rust_test {
314 name: "ring_device_test_tests_ecdsa_tests",
315 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800316 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100317 srcs: ["tests/ecdsa_tests.rs"],
318}
319
320rust_test_host {
321 name: "ring_host_test_tests_ed25519_tests",
322 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800323 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100324 srcs: ["tests/ed25519_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800325 test_options: {
326 unit_test: true,
327 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100328}
329
330rust_test {
331 name: "ring_device_test_tests_ed25519_tests",
332 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800333 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100334 srcs: ["tests/ed25519_tests.rs"],
335}
336
337rust_test_host {
338 name: "ring_host_test_tests_hkdf_tests",
339 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800340 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100341 srcs: ["tests/hkdf_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800342 test_options: {
343 unit_test: true,
344 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100345}
346
347rust_test {
348 name: "ring_device_test_tests_hkdf_tests",
349 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800350 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100351 srcs: ["tests/hkdf_tests.rs"],
352}
353
354rust_test_host {
355 name: "ring_host_test_tests_hmac_tests",
356 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800357 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100358 srcs: ["tests/hmac_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800359 test_options: {
360 unit_test: true,
361 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100362}
363
364rust_test {
365 name: "ring_device_test_tests_hmac_tests",
366 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800367 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100368 srcs: ["tests/hmac_tests.rs"],
369}
370
371rust_test_host {
372 name: "ring_host_test_tests_pbkdf2_tests",
373 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800374 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100375 srcs: ["tests/pbkdf2_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800376 test_options: {
377 unit_test: true,
378 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100379}
380
381rust_test {
382 name: "ring_device_test_tests_pbkdf2_tests",
383 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800384 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100385 srcs: ["tests/pbkdf2_tests.rs"],
386}
387
388rust_test_host {
389 name: "ring_host_test_tests_quic_tests",
390 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800391 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100392 srcs: ["tests/quic_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800393 test_options: {
394 unit_test: true,
395 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100396}
397
398rust_test {
399 name: "ring_device_test_tests_quic_tests",
400 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800401 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100402 srcs: ["tests/quic_tests.rs"],
403}
404
405rust_test_host {
406 name: "ring_host_test_tests_rand_tests",
407 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800408 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100409 srcs: ["tests/rand_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800410 test_options: {
411 unit_test: true,
412 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100413}
414
415rust_test {
416 name: "ring_device_test_tests_rand_tests",
417 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800418 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100419 srcs: ["tests/rand_tests.rs"],
420}
421
422rust_test_host {
423 name: "ring_host_test_tests_rsa_tests",
424 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800425 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100426 srcs: ["tests/rsa_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800427 test_options: {
428 unit_test: true,
429 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100430}
431
432rust_test {
433 name: "ring_device_test_tests_rsa_tests",
434 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800435 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100436 srcs: ["tests/rsa_tests.rs"],
437}
438
439rust_test_host {
440 name: "ring_host_test_tests_signature_tests",
441 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800442 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100443 srcs: ["tests/signature_tests.rs"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800444 test_options: {
445 unit_test: true,
446 },
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100447}
448
449rust_test {
450 name: "ring_device_test_tests_signature_tests",
451 defaults: ["ring_defaults_ring"],
Luke Huang0d2595c2021-03-30 05:41:05 +0800452 // has rustc warnings
Jeff Vander Stoepd7941d92020-12-09 22:05:47 +0100453 srcs: ["tests/signature_tests.rs"],
454}
455
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +0100456// dependent_library ["feature_list"]
Luke Huang0d2595c2021-03-30 05:41:05 +0800457// cc-1.0.67
458// libc-0.2.93
459// once_cell-1.7.2 "alloc,race,std"
Jeff Vander Stoep2a677c32020-12-08 11:08:04 +0100460// spin-0.5.2
461// untrusted-0.7.1