1// 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.
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    // has rustc warnings
40    host_supported: true,
41    crate_name: "ring",
42    srcs: ["src/lib.rs"],
43    edition: "2018",
44    features: [
45        "alloc",
46        "default",
47        "dev_urandom_fallback",
48        "once_cell",
49        "std",
50    ],
51    rustlibs: [
52        "liblibc",
53        "libonce_cell",
54        "libspin",
55        "libuntrusted",
56    ],
57    static_libs: [
58        "libring-core",
59    ],
60    apex_available: [
61        "//apex_available:platform",
62        "com.android.resolv",
63    ],
64    min_sdk_version: "29",
65}
66
67rust_defaults {
68    name: "ring_defaults",
69    crate_name: "ring",
70    // has rustc warnings
71    srcs: ["src/lib.rs"],
72    test_suites: ["general-tests"],
73    auto_gen_config: true,
74    edition: "2018",
75    features: [
76        "alloc",
77        "default",
78        "dev_urandom_fallback",
79        "once_cell",
80        "std",
81    ],
82    rustlibs: [
83        "liblibc",
84        "libonce_cell",
85        "libspin",
86        "libuntrusted",
87    ],
88    static_libs: [
89        "libring-core",
90        "libring-test",
91    ],
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"],
184    apex_available: [
185        "//apex_available:platform",
186        "com.android.resolv",
187    ],
188    min_sdk_version: "29",
189}
190
191cc_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"],
203    test_options: {
204        unit_test: true,
205    },
206}
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",
224        "std",
225    ],
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"],
238    // has rustc warnings
239    srcs: ["tests/aead_tests.rs"],
240    test_options: {
241        unit_test: true,
242    },
243}
244
245rust_test {
246    name: "ring_device_test_tests_aead_tests",
247    defaults: ["ring_defaults_ring"],
248    // has rustc warnings
249    srcs: ["tests/aead_tests.rs"],
250}
251
252rust_test_host {
253    name: "ring_host_test_tests_agreement_tests",
254    defaults: ["ring_defaults_ring"],
255    // has rustc warnings
256    srcs: ["tests/agreement_tests.rs"],
257    test_options: {
258        unit_test: true,
259    },
260}
261
262rust_test {
263    name: "ring_device_test_tests_agreement_tests",
264    defaults: ["ring_defaults_ring"],
265    // has rustc warnings
266    srcs: ["tests/agreement_tests.rs"],
267}
268
269rust_test_host {
270    name: "ring_host_test_tests_constant_time_tests",
271    defaults: ["ring_defaults_ring"],
272    // has rustc warnings
273    srcs: ["tests/constant_time_tests.rs"],
274    test_options: {
275        unit_test: true,
276    },
277}
278
279rust_test {
280    name: "ring_device_test_tests_constant_time_tests",
281    defaults: ["ring_defaults_ring"],
282    // has rustc warnings
283    srcs: ["tests/constant_time_tests.rs"],
284}
285
286rust_test_host {
287    name: "ring_host_test_tests_digest_tests",
288    defaults: ["ring_defaults_ring"],
289    // has rustc warnings
290    srcs: ["tests/digest_tests.rs"],
291    test_options: {
292        unit_test: true,
293    },
294}
295
296rust_test {
297    name: "ring_device_test_tests_digest_tests",
298    defaults: ["ring_defaults_ring"],
299    // has rustc warnings
300    srcs: ["tests/digest_tests.rs"],
301}
302
303rust_test_host {
304    name: "ring_host_test_tests_ecdsa_tests",
305    defaults: ["ring_defaults_ring"],
306    // has rustc warnings
307    srcs: ["tests/ecdsa_tests.rs"],
308    test_options: {
309        unit_test: true,
310    },
311}
312
313rust_test {
314    name: "ring_device_test_tests_ecdsa_tests",
315    defaults: ["ring_defaults_ring"],
316    // has rustc warnings
317    srcs: ["tests/ecdsa_tests.rs"],
318}
319
320rust_test_host {
321    name: "ring_host_test_tests_ed25519_tests",
322    defaults: ["ring_defaults_ring"],
323    // has rustc warnings
324    srcs: ["tests/ed25519_tests.rs"],
325    test_options: {
326        unit_test: true,
327    },
328}
329
330rust_test {
331    name: "ring_device_test_tests_ed25519_tests",
332    defaults: ["ring_defaults_ring"],
333    // has rustc warnings
334    srcs: ["tests/ed25519_tests.rs"],
335}
336
337rust_test_host {
338    name: "ring_host_test_tests_hkdf_tests",
339    defaults: ["ring_defaults_ring"],
340    // has rustc warnings
341    srcs: ["tests/hkdf_tests.rs"],
342    test_options: {
343        unit_test: true,
344    },
345}
346
347rust_test {
348    name: "ring_device_test_tests_hkdf_tests",
349    defaults: ["ring_defaults_ring"],
350    // has rustc warnings
351    srcs: ["tests/hkdf_tests.rs"],
352}
353
354rust_test_host {
355    name: "ring_host_test_tests_hmac_tests",
356    defaults: ["ring_defaults_ring"],
357    // has rustc warnings
358    srcs: ["tests/hmac_tests.rs"],
359    test_options: {
360        unit_test: true,
361    },
362}
363
364rust_test {
365    name: "ring_device_test_tests_hmac_tests",
366    defaults: ["ring_defaults_ring"],
367    // has rustc warnings
368    srcs: ["tests/hmac_tests.rs"],
369}
370
371rust_test_host {
372    name: "ring_host_test_tests_pbkdf2_tests",
373    defaults: ["ring_defaults_ring"],
374    // has rustc warnings
375    srcs: ["tests/pbkdf2_tests.rs"],
376    test_options: {
377        unit_test: true,
378    },
379}
380
381rust_test {
382    name: "ring_device_test_tests_pbkdf2_tests",
383    defaults: ["ring_defaults_ring"],
384    // has rustc warnings
385    srcs: ["tests/pbkdf2_tests.rs"],
386}
387
388rust_test_host {
389    name: "ring_host_test_tests_quic_tests",
390    defaults: ["ring_defaults_ring"],
391    // has rustc warnings
392    srcs: ["tests/quic_tests.rs"],
393    test_options: {
394        unit_test: true,
395    },
396}
397
398rust_test {
399    name: "ring_device_test_tests_quic_tests",
400    defaults: ["ring_defaults_ring"],
401    // has rustc warnings
402    srcs: ["tests/quic_tests.rs"],
403}
404
405rust_test_host {
406    name: "ring_host_test_tests_rand_tests",
407    defaults: ["ring_defaults_ring"],
408    // has rustc warnings
409    srcs: ["tests/rand_tests.rs"],
410    test_options: {
411        unit_test: true,
412    },
413}
414
415rust_test {
416    name: "ring_device_test_tests_rand_tests",
417    defaults: ["ring_defaults_ring"],
418    // has rustc warnings
419    srcs: ["tests/rand_tests.rs"],
420}
421
422rust_test_host {
423    name: "ring_host_test_tests_rsa_tests",
424    defaults: ["ring_defaults_ring"],
425    // has rustc warnings
426    srcs: ["tests/rsa_tests.rs"],
427    test_options: {
428        unit_test: true,
429    },
430}
431
432rust_test {
433    name: "ring_device_test_tests_rsa_tests",
434    defaults: ["ring_defaults_ring"],
435    // has rustc warnings
436    srcs: ["tests/rsa_tests.rs"],
437}
438
439rust_test_host {
440    name: "ring_host_test_tests_signature_tests",
441    defaults: ["ring_defaults_ring"],
442    // has rustc warnings
443    srcs: ["tests/signature_tests.rs"],
444    test_options: {
445        unit_test: true,
446    },
447}
448
449rust_test {
450    name: "ring_device_test_tests_signature_tests",
451    defaults: ["ring_defaults_ring"],
452    // has rustc warnings
453    srcs: ["tests/signature_tests.rs"],
454}
455
456// dependent_library ["feature_list"]
457//   cc-1.0.67
458//   libc-0.2.93
459//   once_cell-1.7.2 "alloc,race,std"
460//   spin-0.5.2
461//   untrusted-0.7.1
462