1 /* { dg-do compile { target ia64-*-* } } */
2 /* { dg-options "-O3 -msched-control-spec" } */
3 typedef long unsigned int size_t;
4 typedef unsigned char uint8_t;
5 typedef unsigned int uint32_t;
6 typedef uint8_t byte;
7 typedef enum pgpArmor_e
8 {
9 PGPARMOR_ERR_CRC_CHECK = -7, PGPARMOR_ERR_BODY_DECODE =
10 -3, PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE = -2, PGPARMOR_ERR_NO_BEGIN_PGP =
11 -1, PGPARMOR_NONE = 0, PGPARMOR_MESSAGE = 1, PGPARMOR_PUBKEY =
12 5, PGPARMOR_PRIVKEY = 6, PGPARMOR_SECKEY = 7
13 }
14 pgpArmor;
15 int b64decode (const char *, void **, size_t *);
16 unsigned int pgpCRC (const byte * octets, size_t len)
17 {
18 unsigned int crc = 0xb704ce;
19 int i;
20 while (len--)
21 {
22 for (i = 0; i < 8; i++)
23 {
24 crc <<= 1;
25 if (crc & 0x1000000)
26 crc ^= 0x1864cfb;
27 }
28 }
29 }
30 pgpArmor pgpReadPkts (const char *fn, const byte ** pkt, size_t * pktlen)
31 {
32 const byte *b = ((void *) 0);
33 const char *enc = ((void *) 0);
34 byte *dec;
35 size_t declen;
36 uint32_t crcpkt, crc;
37 int pstate = 0;
38 pgpArmor ec = PGPARMOR_ERR_NO_BEGIN_PGP;
39 {
40 switch (pstate)
41 {
42 case 0:
43 if (b64decode (enc, (void **) &dec, &declen) != 0)
44 {
45 goto exit;
46 }
47 crc = pgpCRC (dec, declen);
48 }
49 }
50 exit:if (ec > PGPARMOR_NONE && pkt)
51 *pkt = b;
52 }