OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [ia64/] [pr29682.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { 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
pgpCRC (const byte * octets, size_t len)
16
{
17
  unsigned int crc = 0xb704ce;
18
  int i;
19
  while (len--)
20
    {
21
      for (i = 0; i < 8; i++)
22
        {
23
          crc <<= 1;
24
          if (crc & 0x1000000)
25
            crc ^= 0x1864cfb;
26
        }
27
    }
28
}
29
pgpReadPkts (const char *fn, const byte ** pkt, size_t * pktlen)
30
{
31
  const byte *b = ((void *) 0);
32
  const char *enc = ((void *) 0);
33
  byte *dec;
34
  size_t declen;
35
  uint32_t crcpkt, crc;
36
  int pstate = 0;
37
  pgpArmor ec = PGPARMOR_ERR_NO_BEGIN_PGP;
38
    {
39
      switch (pstate)
40
        {
41
        case 0:
42
          if (b64decode (enc, (void **) &dec, &declen) != 0)
43
            {
44
              goto exit;
45
            }
46
          crc = pgpCRC (dec, declen);
47
        }
48
    }
49
exit:if (ec > PGPARMOR_NONE && pkt)
50
    *pkt = b;
51
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.