1 /* PR middle-end/55150 */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target fpic } */
4 /* { dg-options "-Os -g -fPIC" } */
6 typedef unsigned char DES_cblock
[8];
7 typedef struct DES_ks
{
10 void DES_encrypt1 (long *, DES_key_schedule
*, int);
11 void DES_ede3_cbcm_encrypt (const unsigned char *in
, unsigned char *out
, long length
, DES_key_schedule
* ks1
, DES_key_schedule
* ks2
, DES_key_schedule
* ks3
, DES_cblock
* ivec1
, DES_cblock
* ivec2
, int enc
) {
12 register unsigned long tout0
, tout1
, xor0
, xor1
, m0
, m1
;
13 register long l
= length
;
15 unsigned char *iv1
, *iv2
;
19 (m0
= ((unsigned long) (*((iv1
)++))), m0
|= ((unsigned long) (*((iv1
)++))) << 8L, m0
|= ((unsigned long) (*((iv1
)++))) << 16L, m0
|= ((unsigned long) (*((iv1
)++))) << 24L);
20 (m1
= ((unsigned long) (*((iv1
)++))), m1
|= ((unsigned long) (*((iv1
)++))) << 8L, m1
|= ((unsigned long) (*((iv1
)++))) << 16L, m1
|= ((unsigned long) (*((iv1
)++))) << 24L);
21 (tout0
= ((unsigned long) (*((iv2
)++))), tout0
|= ((unsigned long) (*((iv2
)++))) << 8L, tout0
|= ((unsigned long) (*((iv2
)++))) << 16L, tout0
|= ((unsigned long) (*((iv2
)++))) << 24L);
25 DES_encrypt1 (tin
, ks3
, 1);
26 DES_encrypt1 (tin
, ks1
, 1);
28 (*((iv1
)++) = (unsigned char) (((m0
)) & 0xff), *((iv1
)++) = (unsigned char) (((m0
) >> 8L) & 0xff), *((iv1
)++) = (unsigned char) (((m0
) >> 16L) & 0xff), *((iv1
)++) = (unsigned char) (((m0
) >> 24L) & 0xff));
29 (*((iv1
)++) = (unsigned char) (((m1
)) & 0xff), *((iv1
)++) = (unsigned char) (((m1
) >> 8L) & 0xff), *((iv1
)++) = (unsigned char) (((m1
) >> 16L) & 0xff), *((iv1
)++) = (unsigned char) (((m1
) >> 24L) & 0xff));
30 (*((iv2
)++) = (unsigned char) (((tout0
)) & 0xff), *((iv2
)++) = (unsigned char) (((tout0
) >> 8L) & 0xff), *((iv2
)++) = (unsigned char) (((tout0
) >> 16L) & 0xff), *((iv2
)++) = (unsigned char) (((tout0
) >> 24L) & 0xff));
33 (m0
= ((unsigned long) (*((iv1
)++))), m0
|= ((unsigned long) (*((iv1
)++))) << 8L, m0
|= ((unsigned long) (*((iv1
)++))) << 16L, m0
|= ((unsigned long) (*((iv1
)++))) << 24L);
34 (xor1
= ((unsigned long) (*((iv2
)++))), xor1
|= ((unsigned long) (*((iv2
)++))) << 8L, xor1
|= ((unsigned long) (*((iv2
)++))) << 16L, xor1
|= ((unsigned long) (*((iv2
)++))) << 24L);
38 DES_encrypt1 (tin
, ks3
, 1);
42 case 7: *(--(out
)) = (unsigned char) (((tout1
) >> 16L) & 0xff);
43 case 6: *(--(out
)) = (unsigned char) (((tout1
) >> 8L) & 0xff);
44 case 5: *(--(out
)) = (unsigned char) (((tout1
)) & 0xff);
45 case 4: *(--(out
)) = (unsigned char) (((tout0
) >> 24L) & 0xff);
46 case 1: *(--(out
)) = (unsigned char) (((tout0
)) & 0xff);
51 (*((iv1
)++) = (unsigned char) (((m0
)) & 0xff), *((iv1
)++) = (unsigned char) (((m0
) >> 8L) & 0xff), *((iv1
)++) = (unsigned char) (((m0
) >> 16L) & 0xff), *((iv1
)++) = (unsigned char) (((m0
) >> 24L) & 0xff));
52 (*((iv2
)++) = (unsigned char) (((xor0
)) & 0xff), *((iv2
)++) = (unsigned char) (((xor0
) >> 8L) & 0xff), *((iv2
)++) = (unsigned char) (((xor0
) >> 16L) & 0xff), *((iv2
)++) = (unsigned char) (((xor0
) >> 24L) & 0xff));
53 (*((iv2
)++) = (unsigned char) (((xor1
)) & 0xff), *((iv2
)++) = (unsigned char) (((xor1
) >> 8L) & 0xff), *((iv2
)++) = (unsigned char) (((xor1
) >> 16L) & 0xff), *((iv2
)++) = (unsigned char) (((xor1
) >> 24L) & 0xff));