@@ -185,17 +185,15 @@ pub unsafe fn vsha256su1q_u32(
185185#[ cfg( test) ]
186186mod tests {
187187 use coresimd:: aarch64:: * ;
188- use simd:: * ;
188+ use coresimd :: simd:: * ;
189189 use std:: mem;
190190 use stdsimd_test:: simd_test;
191191
192192 #[ simd_test( enable = "crypto" ) ]
193193 unsafe fn test_vaeseq_u8 ( ) {
194- let data = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 )
195- . into_bits ( ) ;
196- let key = u8x16:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 )
197- . into_bits ( ) ;
198- let r: u8x16 = vaeseq_u8 ( data, key) . into_bits ( ) ;
194+ let data = :: mem:: transmute ( u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ) ;
195+ let key = :: mem:: transmute ( u8x16:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ) ) ;
196+ let r: u8x16 = :: mem:: transmute ( vaeseq_u8 ( data, key) ) ;
199197 assert_eq ! (
200198 r,
201199 u8x16:: new(
@@ -207,11 +205,9 @@ mod tests {
207205
208206 #[ simd_test( enable = "crypto" ) ]
209207 unsafe fn test_vaesdq_u8 ( ) {
210- let data = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 )
211- . into_bits ( ) ;
212- let key = u8x16:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 )
213- . into_bits ( ) ;
214- let r: u8x16 = vaesdq_u8 ( data, key) . into_bits ( ) ;
208+ let data = :: mem:: transmute ( u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ) ;
209+ let key = :: mem:: transmute ( u8x16:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ) ) ;
210+ let r: u8x16 = :: mem:: transmute ( vaesdq_u8 ( data, key) ) ;
215211 assert_eq ! (
216212 r,
217213 u8x16:: new(
@@ -222,9 +218,8 @@ mod tests {
222218
223219 #[ simd_test( enable = "crypto" ) ]
224220 unsafe fn test_vaesmcq_u8 ( ) {
225- let data = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 )
226- . into_bits ( ) ;
227- let r: u8x16 = vaesmcq_u8 ( data) . into_bits ( ) ;
221+ let data = :: mem:: transmute ( u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ) ;
222+ let r: u8x16 = :: mem:: transmute ( vaesmcq_u8 ( data) ) ;
228223 assert_eq ! (
229224 r,
230225 u8x16:: new( 3 , 4 , 9 , 10 , 15 , 8 , 21 , 30 , 3 , 4 , 9 , 10 , 15 , 8 , 21 , 30 )
@@ -233,9 +228,8 @@ mod tests {
233228
234229 #[ simd_test( enable = "crypto" ) ]
235230 unsafe fn test_vaesimcq_u8 ( ) {
236- let data = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 )
237- . into_bits ( ) ;
238- let r: u8x16 = vaesimcq_u8 ( data) . into_bits ( ) ;
231+ let data = :: mem:: transmute ( u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ) ;
232+ let r: u8x16 = :: mem:: transmute ( vaesimcq_u8 ( data) ) ;
239233 assert_eq ! (
240234 r,
241235 u8x16:: new(
@@ -253,23 +247,20 @@ mod tests {
253247
254248 #[ simd_test( enable = "crypto" ) ]
255249 unsafe fn test_vsha1su0q_u32 ( ) {
256- let r: u32x4 = vsha1su0q_u32 (
257- u32x4:: new ( 0x1234_u32 , 0x5678_u32 , 0x9abc_u32 , 0xdef0_u32 )
258- . into_bits ( ) ,
259- u32x4:: new ( 0x1234_u32 , 0x5678_u32 , 0x9abc_u32 , 0xdef0_u32 )
260- . into_bits ( ) ,
261- u32x4:: new ( 0x1234_u32 , 0x5678_u32 , 0x9abc_u32 , 0xdef0_u32 )
262- . into_bits ( ) ,
263- ) . into_bits ( ) ;
250+ let r: u32x4 = :: mem:: transmute ( vsha1su0q_u32 (
251+ :: mem:: transmute ( u32x4:: new ( 0x1234_u32 , 0x5678_u32 , 0x9abc_u32 , 0xdef0_u32 ) ) ,
252+ :: mem:: transmute ( u32x4:: new ( 0x1234_u32 , 0x5678_u32 , 0x9abc_u32 , 0xdef0_u32 ) ) ,
253+ :: mem:: transmute ( u32x4:: new ( 0x1234_u32 , 0x5678_u32 , 0x9abc_u32 , 0xdef0_u32 ) ) ,
254+ ) ) ;
264255 assert_eq ! ( r, u32x4:: new( 0x9abc , 0xdef0 , 0x1234 , 0x5678 ) ) ;
265256 }
266257
267258 #[ simd_test( enable = "crypto" ) ]
268259 unsafe fn test_vsha1su1q_u32 ( ) {
269- let r: u32x4 = vsha1su1q_u32 (
270- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
271- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
272- ) . into_bits ( ) ;
260+ let r: u32x4 = :: mem :: transmute ( vsha1su1q_u32 (
261+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
262+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
263+ ) ) ;
273264 assert_eq ! (
274265 r,
275266 u32x4:: new( 0x00008898 , 0x00019988 , 0x00008898 , 0x0000acd0 )
@@ -278,11 +269,11 @@ mod tests {
278269
279270 #[ simd_test( enable = "crypto" ) ]
280271 unsafe fn test_vsha1cq_u32 ( ) {
281- let r: u32x4 = vsha1cq_u32 (
282- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
272+ let r: u32x4 = :: mem :: transmute ( vsha1cq_u32 (
273+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
283274 0x1234 ,
284- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
285- ) . into_bits ( ) ;
275+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
276+ ) ) ;
286277 assert_eq ! (
287278 r,
288279 u32x4:: new( 0x8a32cbd8 , 0x0c518a96 , 0x0018a081 , 0x0000c168 )
@@ -291,11 +282,11 @@ mod tests {
291282
292283 #[ simd_test( enable = "crypto" ) ]
293284 unsafe fn test_vsha1pq_u32 ( ) {
294- let r: u32x4 = vsha1pq_u32 (
295- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
285+ let r: u32x4 = :: mem :: transmute ( vsha1pq_u32 (
286+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
296287 0x1234 ,
297- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
298- ) . into_bits ( ) ;
288+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
289+ ) ) ;
299290 assert_eq ! (
300291 r,
301292 u32x4:: new( 0x469f0ba3 , 0x0a326147 , 0x80145d7f , 0x00009f47 )
@@ -304,11 +295,11 @@ mod tests {
304295
305296 #[ simd_test( enable = "crypto" ) ]
306297 unsafe fn test_vsha1mq_u32 ( ) {
307- let r: u32x4 = vsha1mq_u32 (
308- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
298+ let r: u32x4 = :: mem :: transmute ( vsha1mq_u32 (
299+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
309300 0x1234 ,
310- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
311- ) . into_bits ( ) ;
301+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
302+ ) ) ;
312303 assert_eq ! (
313304 r,
314305 u32x4:: new( 0xaa39693b , 0x0d51bf84 , 0x001aa109 , 0x0000d278 )
@@ -317,11 +308,11 @@ mod tests {
317308
318309 #[ simd_test( enable = "crypto" ) ]
319310 unsafe fn test_vsha256hq_u32 ( ) {
320- let r: u32x4 = vsha256hq_u32 (
321- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
322- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
323- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
324- ) . into_bits ( ) ;
311+ let r: u32x4 = :: mem :: transmute ( vsha256hq_u32 (
312+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
313+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
314+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
315+ ) ) ;
325316 assert_eq ! (
326317 r,
327318 u32x4:: new( 0x05e9aaa8 , 0xec5f4c02 , 0x20a1ea61 , 0x28738cef )
@@ -330,11 +321,11 @@ mod tests {
330321
331322 #[ simd_test( enable = "crypto" ) ]
332323 unsafe fn test_vsha256h2q_u32 ( ) {
333- let r: u32x4 = vsha256h2q_u32 (
334- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
335- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
336- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
337- ) . into_bits ( ) ;
324+ let r: u32x4 = :: mem :: transmute ( vsha256h2q_u32 (
325+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
326+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
327+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
328+ ) ) ;
338329 assert_eq ! (
339330 r,
340331 u32x4:: new( 0x3745362e , 0x2fb51d00 , 0xbd4c529b , 0x968b8516 )
@@ -343,10 +334,10 @@ mod tests {
343334
344335 #[ simd_test( enable = "crypto" ) ]
345336 unsafe fn test_vsha256su0q_u32 ( ) {
346- let r: u32x4 = vsha256su0q_u32 (
347- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
348- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
349- ) . into_bits ( ) ;
337+ let r: u32x4 = :: mem :: transmute ( vsha256su0q_u32 (
338+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
339+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
340+ ) ) ;
350341 assert_eq ! (
351342 r,
352343 u32x4:: new( 0xe59e1c97 , 0x5eaf68da , 0xd7bcb51f , 0x6c8de152 )
@@ -355,11 +346,11 @@ mod tests {
355346
356347 #[ simd_test( enable = "crypto" ) ]
357348 unsafe fn test_vsha256su1q_u32 ( ) {
358- let r: u32x4 = vsha256su1q_u32 (
359- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
360- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
361- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
362- ) . into_bits ( ) ;
349+ let r: u32x4 = :: mem :: transmute ( vsha256su1q_u32 (
350+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
351+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
352+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
353+ ) ) ;
363354 assert_eq ! (
364355 r,
365356 u32x4:: new( 0x5e09e8d2 , 0x74a6f16b , 0xc966606b , 0xa686ee9f )
0 commit comments