aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-02-03 15:17:42 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2022-02-03 15:17:42 +0100
commita1429fbb8ca373efc01939d599f6f65969b1a366 (patch)
treebfe49ac9065561ffa5501f0740a3b0ac8b8dfdcc
parentde6cb4bed82356db72af81890c7c26d7e85fb50d (diff)
downloadbusybox-w32-a1429fbb8ca373efc01939d599f6f65969b1a366.tar.gz
busybox-w32-a1429fbb8ca373efc01939d599f6f65969b1a366.tar.bz2
busybox-w32-a1429fbb8ca373efc01939d599f6f65969b1a366.zip
libbb/sha256: code shrink in 64-bit x86
function old new delta sha256_process_block64_shaNI 730 706 -24 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/hash_md5_sha256_x86-64_shaNI.S34
1 files changed, 17 insertions, 17 deletions
diff --git a/libbb/hash_md5_sha256_x86-64_shaNI.S b/libbb/hash_md5_sha256_x86-64_shaNI.S
index 1c2b75af3..f3df541e4 100644
--- a/libbb/hash_md5_sha256_x86-64_shaNI.S
+++ b/libbb/hash_md5_sha256_x86-64_shaNI.S
@@ -50,7 +50,7 @@ sha256_process_block64_shaNI:
50 pblendw $0xF0, MSGTMP4, STATE1 /* CDGH */ 50 pblendw $0xF0, MSGTMP4, STATE1 /* CDGH */
51 51
52 mova128 PSHUFFLE_BSWAP32_FLIP_MASK(%rip), SHUF_MASK 52 mova128 PSHUFFLE_BSWAP32_FLIP_MASK(%rip), SHUF_MASK
53 lea K256(%rip), SHA256CONSTANTS 53 leaq K256+8*16(%rip), SHA256CONSTANTS
54 54
55 /* Save hash values for addition after rounds */ 55 /* Save hash values for addition after rounds */
56 mova128 STATE0, ABEF_SAVE 56 mova128 STATE0, ABEF_SAVE
@@ -60,7 +60,7 @@ sha256_process_block64_shaNI:
60 movu128 0*16(DATA_PTR), MSG 60 movu128 0*16(DATA_PTR), MSG
61 pshufb SHUF_MASK, MSG 61 pshufb SHUF_MASK, MSG
62 mova128 MSG, MSGTMP0 62 mova128 MSG, MSGTMP0
63 paddd 0*16(SHA256CONSTANTS), MSG 63 paddd 0*16-8*16(SHA256CONSTANTS), MSG
64 sha256rnds2 STATE0, STATE1 64 sha256rnds2 STATE0, STATE1
65 shuf128_32 $0x0E, MSG, MSG 65 shuf128_32 $0x0E, MSG, MSG
66 sha256rnds2 STATE1, STATE0 66 sha256rnds2 STATE1, STATE0
@@ -69,7 +69,7 @@ sha256_process_block64_shaNI:
69 movu128 1*16(DATA_PTR), MSG 69 movu128 1*16(DATA_PTR), MSG
70 pshufb SHUF_MASK, MSG 70 pshufb SHUF_MASK, MSG
71 mova128 MSG, MSGTMP1 71 mova128 MSG, MSGTMP1
72 paddd 1*16(SHA256CONSTANTS), MSG 72 paddd 1*16-8*16(SHA256CONSTANTS), MSG
73 sha256rnds2 STATE0, STATE1 73 sha256rnds2 STATE0, STATE1
74 shuf128_32 $0x0E, MSG, MSG 74 shuf128_32 $0x0E, MSG, MSG
75 sha256rnds2 STATE1, STATE0 75 sha256rnds2 STATE1, STATE0
@@ -79,7 +79,7 @@ sha256_process_block64_shaNI:
79 movu128 2*16(DATA_PTR), MSG 79 movu128 2*16(DATA_PTR), MSG
80 pshufb SHUF_MASK, MSG 80 pshufb SHUF_MASK, MSG
81 mova128 MSG, MSGTMP2 81 mova128 MSG, MSGTMP2
82 paddd 2*16(SHA256CONSTANTS), MSG 82 paddd 2*16-8*16(SHA256CONSTANTS), MSG
83 sha256rnds2 STATE0, STATE1 83 sha256rnds2 STATE0, STATE1
84 shuf128_32 $0x0E, MSG, MSG 84 shuf128_32 $0x0E, MSG, MSG
85 sha256rnds2 STATE1, STATE0 85 sha256rnds2 STATE1, STATE0
@@ -89,7 +89,7 @@ sha256_process_block64_shaNI:
89 movu128 3*16(DATA_PTR), MSG 89 movu128 3*16(DATA_PTR), MSG
90 pshufb SHUF_MASK, MSG 90 pshufb SHUF_MASK, MSG
91 mova128 MSG, MSGTMP3 91 mova128 MSG, MSGTMP3
92 paddd 3*16(SHA256CONSTANTS), MSG 92 paddd 3*16-8*16(SHA256CONSTANTS), MSG
93 sha256rnds2 STATE0, STATE1 93 sha256rnds2 STATE0, STATE1
94 mova128 MSGTMP3, MSGTMP4 94 mova128 MSGTMP3, MSGTMP4
95 palignr $4, MSGTMP2, MSGTMP4 95 palignr $4, MSGTMP2, MSGTMP4
@@ -101,7 +101,7 @@ sha256_process_block64_shaNI:
101 101
102 /* Rounds 16-19 */ 102 /* Rounds 16-19 */
103 mova128 MSGTMP0, MSG 103 mova128 MSGTMP0, MSG
104 paddd 4*16(SHA256CONSTANTS), MSG 104 paddd 4*16-8*16(SHA256CONSTANTS), MSG
105 sha256rnds2 STATE0, STATE1 105 sha256rnds2 STATE0, STATE1
106 mova128 MSGTMP0, MSGTMP4 106 mova128 MSGTMP0, MSGTMP4
107 palignr $4, MSGTMP3, MSGTMP4 107 palignr $4, MSGTMP3, MSGTMP4
@@ -113,7 +113,7 @@ sha256_process_block64_shaNI:
113 113
114 /* Rounds 20-23 */ 114 /* Rounds 20-23 */
115 mova128 MSGTMP1, MSG 115 mova128 MSGTMP1, MSG
116 paddd 5*16(SHA256CONSTANTS), MSG 116 paddd 5*16-8*16(SHA256CONSTANTS), MSG
117 sha256rnds2 STATE0, STATE1 117 sha256rnds2 STATE0, STATE1
118 mova128 MSGTMP1, MSGTMP4 118 mova128 MSGTMP1, MSGTMP4
119 palignr $4, MSGTMP0, MSGTMP4 119 palignr $4, MSGTMP0, MSGTMP4
@@ -125,7 +125,7 @@ sha256_process_block64_shaNI:
125 125
126 /* Rounds 24-27 */ 126 /* Rounds 24-27 */
127 mova128 MSGTMP2, MSG 127 mova128 MSGTMP2, MSG
128 paddd 6*16(SHA256CONSTANTS), MSG 128 paddd 6*16-8*16(SHA256CONSTANTS), MSG
129 sha256rnds2 STATE0, STATE1 129 sha256rnds2 STATE0, STATE1
130 mova128 MSGTMP2, MSGTMP4 130 mova128 MSGTMP2, MSGTMP4
131 palignr $4, MSGTMP1, MSGTMP4 131 palignr $4, MSGTMP1, MSGTMP4
@@ -137,7 +137,7 @@ sha256_process_block64_shaNI:
137 137
138 /* Rounds 28-31 */ 138 /* Rounds 28-31 */
139 mova128 MSGTMP3, MSG 139 mova128 MSGTMP3, MSG
140 paddd 7*16(SHA256CONSTANTS), MSG 140 paddd 7*16-8*16(SHA256CONSTANTS), MSG
141 sha256rnds2 STATE0, STATE1 141 sha256rnds2 STATE0, STATE1
142 mova128 MSGTMP3, MSGTMP4 142 mova128 MSGTMP3, MSGTMP4
143 palignr $4, MSGTMP2, MSGTMP4 143 palignr $4, MSGTMP2, MSGTMP4
@@ -149,7 +149,7 @@ sha256_process_block64_shaNI:
149 149
150 /* Rounds 32-35 */ 150 /* Rounds 32-35 */
151 mova128 MSGTMP0, MSG 151 mova128 MSGTMP0, MSG
152 paddd 8*16(SHA256CONSTANTS), MSG 152 paddd 8*16-8*16(SHA256CONSTANTS), MSG
153 sha256rnds2 STATE0, STATE1 153 sha256rnds2 STATE0, STATE1
154 mova128 MSGTMP0, MSGTMP4 154 mova128 MSGTMP0, MSGTMP4
155 palignr $4, MSGTMP3, MSGTMP4 155 palignr $4, MSGTMP3, MSGTMP4
@@ -161,7 +161,7 @@ sha256_process_block64_shaNI:
161 161
162 /* Rounds 36-39 */ 162 /* Rounds 36-39 */
163 mova128 MSGTMP1, MSG 163 mova128 MSGTMP1, MSG
164 paddd 9*16(SHA256CONSTANTS), MSG 164 paddd 9*16-8*16(SHA256CONSTANTS), MSG
165 sha256rnds2 STATE0, STATE1 165 sha256rnds2 STATE0, STATE1
166 mova128 MSGTMP1, MSGTMP4 166 mova128 MSGTMP1, MSGTMP4
167 palignr $4, MSGTMP0, MSGTMP4 167 palignr $4, MSGTMP0, MSGTMP4
@@ -173,7 +173,7 @@ sha256_process_block64_shaNI:
173 173
174 /* Rounds 40-43 */ 174 /* Rounds 40-43 */
175 mova128 MSGTMP2, MSG 175 mova128 MSGTMP2, MSG
176 paddd 10*16(SHA256CONSTANTS), MSG 176 paddd 10*16-8*16(SHA256CONSTANTS), MSG
177 sha256rnds2 STATE0, STATE1 177 sha256rnds2 STATE0, STATE1
178 mova128 MSGTMP2, MSGTMP4 178 mova128 MSGTMP2, MSGTMP4
179 palignr $4, MSGTMP1, MSGTMP4 179 palignr $4, MSGTMP1, MSGTMP4
@@ -185,7 +185,7 @@ sha256_process_block64_shaNI:
185 185
186 /* Rounds 44-47 */ 186 /* Rounds 44-47 */
187 mova128 MSGTMP3, MSG 187 mova128 MSGTMP3, MSG
188 paddd 11*16(SHA256CONSTANTS), MSG 188 paddd 11*16-8*16(SHA256CONSTANTS), MSG
189 sha256rnds2 STATE0, STATE1 189 sha256rnds2 STATE0, STATE1
190 mova128 MSGTMP3, MSGTMP4 190 mova128 MSGTMP3, MSGTMP4
191 palignr $4, MSGTMP2, MSGTMP4 191 palignr $4, MSGTMP2, MSGTMP4
@@ -197,7 +197,7 @@ sha256_process_block64_shaNI:
197 197
198 /* Rounds 48-51 */ 198 /* Rounds 48-51 */
199 mova128 MSGTMP0, MSG 199 mova128 MSGTMP0, MSG
200 paddd 12*16(SHA256CONSTANTS), MSG 200 paddd 12*16-8*16(SHA256CONSTANTS), MSG
201 sha256rnds2 STATE0, STATE1 201 sha256rnds2 STATE0, STATE1
202 mova128 MSGTMP0, MSGTMP4 202 mova128 MSGTMP0, MSGTMP4
203 palignr $4, MSGTMP3, MSGTMP4 203 palignr $4, MSGTMP3, MSGTMP4
@@ -209,7 +209,7 @@ sha256_process_block64_shaNI:
209 209
210 /* Rounds 52-55 */ 210 /* Rounds 52-55 */
211 mova128 MSGTMP1, MSG 211 mova128 MSGTMP1, MSG
212 paddd 13*16(SHA256CONSTANTS), MSG 212 paddd 13*16-8*16(SHA256CONSTANTS), MSG
213 sha256rnds2 STATE0, STATE1 213 sha256rnds2 STATE0, STATE1
214 mova128 MSGTMP1, MSGTMP4 214 mova128 MSGTMP1, MSGTMP4
215 palignr $4, MSGTMP0, MSGTMP4 215 palignr $4, MSGTMP0, MSGTMP4
@@ -220,7 +220,7 @@ sha256_process_block64_shaNI:
220 220
221 /* Rounds 56-59 */ 221 /* Rounds 56-59 */
222 mova128 MSGTMP2, MSG 222 mova128 MSGTMP2, MSG
223 paddd 14*16(SHA256CONSTANTS), MSG 223 paddd 14*16-8*16(SHA256CONSTANTS), MSG
224 sha256rnds2 STATE0, STATE1 224 sha256rnds2 STATE0, STATE1
225 mova128 MSGTMP2, MSGTMP4 225 mova128 MSGTMP2, MSGTMP4
226 palignr $4, MSGTMP1, MSGTMP4 226 palignr $4, MSGTMP1, MSGTMP4
@@ -231,7 +231,7 @@ sha256_process_block64_shaNI:
231 231
232 /* Rounds 60-63 */ 232 /* Rounds 60-63 */
233 mova128 MSGTMP3, MSG 233 mova128 MSGTMP3, MSG
234 paddd 15*16(SHA256CONSTANTS), MSG 234 paddd 15*16-8*16(SHA256CONSTANTS), MSG
235 sha256rnds2 STATE0, STATE1 235 sha256rnds2 STATE0, STATE1
236 shuf128_32 $0x0E, MSG, MSG 236 shuf128_32 $0x0E, MSG, MSG
237 sha256rnds2 STATE1, STATE0 237 sha256rnds2 STATE1, STATE0