@@ -185,17 +185,15 @@ pub unsafe fn vsha256su1q_u32(
185
185
#[ cfg( test) ]
186
186
mod tests {
187
187
use coresimd:: aarch64:: * ;
188
- use simd:: * ;
188
+ use coresimd :: simd:: * ;
189
189
use std:: mem;
190
190
use stdsimd_test:: simd_test;
191
191
192
192
#[ simd_test( enable = "crypto" ) ]
193
193
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) ) ;
199
197
assert_eq ! (
200
198
r,
201
199
u8x16:: new(
@@ -207,11 +205,9 @@ mod tests {
207
205
208
206
#[ simd_test( enable = "crypto" ) ]
209
207
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) ) ;
215
211
assert_eq ! (
216
212
r,
217
213
u8x16:: new(
@@ -222,9 +218,8 @@ mod tests {
222
218
223
219
#[ simd_test( enable = "crypto" ) ]
224
220
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) ) ;
228
223
assert_eq ! (
229
224
r,
230
225
u8x16:: new( 3 , 4 , 9 , 10 , 15 , 8 , 21 , 30 , 3 , 4 , 9 , 10 , 15 , 8 , 21 , 30 )
@@ -233,9 +228,8 @@ mod tests {
233
228
234
229
#[ simd_test( enable = "crypto" ) ]
235
230
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) ) ;
239
233
assert_eq ! (
240
234
r,
241
235
u8x16:: new(
@@ -253,23 +247,20 @@ mod tests {
253
247
254
248
#[ simd_test( enable = "crypto" ) ]
255
249
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
+ ) ) ;
264
255
assert_eq ! ( r, u32x4:: new( 0x9abc , 0xdef0 , 0x1234 , 0x5678 ) ) ;
265
256
}
266
257
267
258
#[ simd_test( enable = "crypto" ) ]
268
259
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
+ ) ) ;
273
264
assert_eq ! (
274
265
r,
275
266
u32x4:: new( 0x00008898 , 0x00019988 , 0x00008898 , 0x0000acd0 )
@@ -278,11 +269,11 @@ mod tests {
278
269
279
270
#[ simd_test( enable = "crypto" ) ]
280
271
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 ) ) ,
283
274
0x1234 ,
284
- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
285
- ) . into_bits ( ) ;
275
+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
276
+ ) ) ;
286
277
assert_eq ! (
287
278
r,
288
279
u32x4:: new( 0x8a32cbd8 , 0x0c518a96 , 0x0018a081 , 0x0000c168 )
@@ -291,11 +282,11 @@ mod tests {
291
282
292
283
#[ simd_test( enable = "crypto" ) ]
293
284
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 ) ) ,
296
287
0x1234 ,
297
- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
298
- ) . into_bits ( ) ;
288
+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
289
+ ) ) ;
299
290
assert_eq ! (
300
291
r,
301
292
u32x4:: new( 0x469f0ba3 , 0x0a326147 , 0x80145d7f , 0x00009f47 )
@@ -304,11 +295,11 @@ mod tests {
304
295
305
296
#[ simd_test( enable = "crypto" ) ]
306
297
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 ) ) ,
309
300
0x1234 ,
310
- u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) . into_bits ( ) ,
311
- ) . into_bits ( ) ;
301
+ :: mem :: transmute ( u32x4:: new ( 0x1234 , 0x5678 , 0x9abc , 0xdef0 ) ) ,
302
+ ) ) ;
312
303
assert_eq ! (
313
304
r,
314
305
u32x4:: new( 0xaa39693b , 0x0d51bf84 , 0x001aa109 , 0x0000d278 )
@@ -317,11 +308,11 @@ mod tests {
317
308
318
309
#[ simd_test( enable = "crypto" ) ]
319
310
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
+ ) ) ;
325
316
assert_eq ! (
326
317
r,
327
318
u32x4:: new( 0x05e9aaa8 , 0xec5f4c02 , 0x20a1ea61 , 0x28738cef )
@@ -330,11 +321,11 @@ mod tests {
330
321
331
322
#[ simd_test( enable = "crypto" ) ]
332
323
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
+ ) ) ;
338
329
assert_eq ! (
339
330
r,
340
331
u32x4:: new( 0x3745362e , 0x2fb51d00 , 0xbd4c529b , 0x968b8516 )
@@ -343,10 +334,10 @@ mod tests {
343
334
344
335
#[ simd_test( enable = "crypto" ) ]
345
336
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
+ ) ) ;
350
341
assert_eq ! (
351
342
r,
352
343
u32x4:: new( 0xe59e1c97 , 0x5eaf68da , 0xd7bcb51f , 0x6c8de152 )
@@ -355,11 +346,11 @@ mod tests {
355
346
356
347
#[ simd_test( enable = "crypto" ) ]
357
348
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
+ ) ) ;
363
354
assert_eq ! (
364
355
r,
365
356
u32x4:: new( 0x5e09e8d2 , 0x74a6f16b , 0xc966606b , 0xa686ee9f )
0 commit comments