• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1--- Android.bp.old	2020-12-14 18:12:19.236831007 +0900
2+++ Android.bp	2020-12-14 18:12:26.756763208 +0900
3@@ -20,8 +20,12 @@ rust_library {
4     ],
5     static_libs: [
6         "libring-core",
7-        "libring-test",
8     ],
9+    apex_available: [
10+        "//apex_available:platform",
11+        "com.android.resolv",
12+    ],
13+    min_sdk_version: "29",
14 }
15
16 rust_defaults {
17@@ -49,6 +53,112 @@ rust_defaults {
18     ],
19 }
20
21+cc_library_static {
22+    name: "libring-core",
23+    host_supported: true,
24+    srcs: [
25+        "crypto/cpu-intel.c",
26+        "crypto/fipsmodule/aes/aes_nohw.c",
27+        "crypto/crypto.c",
28+        "crypto/poly1305/poly1305.c",
29+        "crypto/poly1305/poly1305_vec.c",
30+        "crypto/curve25519/curve25519.c",
31+        "crypto/fipsmodule/ec/ecp_nistz.c",
32+        "crypto/fipsmodule/ec/ecp_nistz256.c",
33+        "crypto/fipsmodule/ec/gfp_p256.c",
34+        "crypto/fipsmodule/ec/gfp_p384.c",
35+        "crypto/limbs/limbs.c",
36+        "crypto/mem.c",
37+        "crypto/fipsmodule/bn/montgomery.c",
38+        "crypto/fipsmodule/bn/montgomery_inv.c",
39+    ],
40+
41+    arch: {
42+        arm: {
43+            srcs: [
44+                "crypto/poly1305/poly1305_arm.c",
45+                "crypto/poly1305/poly1305_arm_asm.S",
46+                "pregenerated/armv4-mont-linux32.S",
47+                "crypto/curve25519/asm/x25519-asm-arm.S",
48+                "pregenerated/sha256-armv4-linux32.S",
49+                "pregenerated/sha512-armv4-linux32.S",
50+                "pregenerated/ecp_nistz256-armv4-linux32.S",
51+                "pregenerated/aesv8-armx-linux32.S",
52+                "pregenerated/bsaes-armv7-linux32.S",
53+                "pregenerated/ghashv8-armx-linux32.S",
54+                "pregenerated/vpaes-armv7-linux32.S",
55+                "pregenerated/ghash-armv4-linux32.S",
56+                "pregenerated/chacha-armv4-linux32.S",
57+            ],
58+        },
59+        arm64: {
60+            srcs: [
61+                "pregenerated/aesv8-armx-linux64.S",
62+                "pregenerated/armv8-mont-linux64.S",
63+                "pregenerated/chacha-armv8-linux64.S",
64+                "pregenerated/ecp_nistz256-armv8-linux64.S",
65+                "pregenerated/ghash-neon-armv8-linux64.S",
66+                "pregenerated/ghashv8-armx-linux64.S",
67+                "pregenerated/sha256-armv8-linux64.S",
68+                "pregenerated/sha512-armv8-linux64.S",
69+                "pregenerated/vpaes-armv8-linux64.S",
70+            ],
71+        },
72+        x86: {
73+            srcs: [
74+                "pregenerated/aesni-x86-elf.S",
75+                "pregenerated/chacha-x86-elf.S",
76+                "pregenerated/ecp_nistz256-x86-elf.S",
77+                "pregenerated/ghash-x86-elf.S",
78+                "pregenerated/vpaes-x86-elf.S",
79+                "pregenerated/x86-mont-elf.S",
80+            ],
81+        },
82+        x86_64: {
83+            srcs: [
84+                "pregenerated/aesni-gcm-x86_64-elf.S",
85+                "pregenerated/aesni-x86_64-elf.S",
86+                "pregenerated/chacha-x86_64-elf.S",
87+                "pregenerated/ghash-x86_64-elf.S",
88+                "pregenerated/p256-x86_64-asm-elf.S",
89+                "pregenerated/sha256-x86_64-elf.S",
90+                "pregenerated/sha512-x86_64-elf.S",
91+                "pregenerated/vpaes-x86_64-elf.S",
92+                "pregenerated/x86_64-mont5-elf.S",
93+                "pregenerated/x86_64-mont-elf.S",
94+            ],
95+        },
96+    },
97+
98+    cflags: [
99+        "-O3",
100+        "-Wno-error",
101+        "-fPIC",
102+        "-fdata-sections",
103+        "-ffunction-sections",
104+        "-fno-omit-frame-pointer",
105+        "-fno-strict-aliasing",
106+        "-fstack-protector",
107+        "-fvisibility=hidden",
108+        "-DNDEBUG",
109+    ],
110+    local_include_dirs: ["include"],
111+    apex_available: [
112+        "//apex_available:platform",
113+        "com.android.resolv",
114+    ],
115+    min_sdk_version: "29",
116+}
117+
118+cc_library_static {
119+    name: "libring-test",
120+    host_supported: true,
121+    srcs: [
122+        "crypto/constant_time_test.c",
123+    ],
124+    local_include_dirs: ["include"],
125+}
126+
127 rust_test_host {
128     name: "ring_host_test_src_lib",
129     defaults: ["ring_defaults"],
130