fuzz_des.c:k5memdup:
 2301|     35|{
 2302|     35|    void *ptr = k5alloc(len, code);
 2303|       |
 2304|     35|    if (ptr != NULL && len > 0)
  ------------------
  |  Branch (2304:9): [True: 35, False: 0]
  |  Branch (2304:24): [True: 35, False: 0]
  ------------------
 2305|     35|        memcpy(ptr, in, len);
 2306|     35|    return ptr;
 2307|     35|}
fuzz_des.c:k5alloc:
 2294|     35|{
 2295|     35|    return k5calloc(1, size, code);
 2296|     35|}
fuzz_des.c:k5calloc:
 2282|     35|{
 2283|     35|    void *ptr;
 2284|       |
 2285|       |    /* Allocate at least one byte since zero-byte allocs may return NULL. */
 2286|     35|    ptr = calloc(nmemb ? nmemb : 1, size ? size : 1);
  ------------------
  |  Branch (2286:18): [True: 35, False: 0]
  |  Branch (2286:37): [True: 35, False: 0]
  ------------------
 2287|     35|    *code = (ptr == NULL) ? ENOMEM : 0;
  ------------------
  |  Branch (2287:13): [True: 0, False: 35]
  ------------------
 2288|     35|    return ptr;
 2289|     35|}

fuzz_des.c:load_32_be:
  596|    420|{
  597|    420|    const unsigned char *p = (const unsigned char *) cvp;
  598|       |#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus)
  599|       |    return GET(32,p);
  600|       |#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) && !defined(__cplusplus)
  601|    420|    return GETSWAPPED(32,p);
  ------------------
  |  |  492|    420|# define GETSWAPPED(SIZE,PTR)           SWAP##SIZE(GET(SIZE,PTR))
  |  |  ------------------
  |  |  |  |  505|    420|# define SWAP32                 bswap_32
  |  |  ------------------
  ------------------
  602|       |#else
  603|       |    return (p[3] | (p[2] << 8)
  604|       |            | ((uint32_t) p[1] << 16)
  605|       |            | ((uint32_t) p[0] << 24));
  606|       |#endif
  607|    420|}
fuzz_des.c:store_32_be:
  550|     70|{
  551|     70|    unsigned char *p = (unsigned char *) vp;
  552|       |#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus)
  553|       |    PUT(32,p,val);
  554|       |#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) && !defined(__cplusplus)
  555|     70|    PUTSWAPPED(32,p,val);
  ------------------
  |  |  491|     70|# define PUTSWAPPED(SIZE,PTR,VAL)       PUT(SIZE,PTR,SWAP##SIZE(VAL))
  |  |  ------------------
  |  |  |  |  489|     70|# define PUT(SIZE,PTR,VAL)      (((struct { uint##SIZE##_t i; } __attribute__((packed)) *)(PTR))->i = (VAL))
  |  |  ------------------
  ------------------
  556|       |#else
  557|       |    p[0] = (val >> 24) & 0xff;
  558|       |    p[1] = (val >> 16) & 0xff;
  559|       |    p[2] = (val >>  8) & 0xff;
  560|       |    p[3] = (val      ) & 0xff;
  561|       |#endif
  562|     70|}
f_cksum.c:load_32_be:
  596|    140|{
  597|    140|    const unsigned char *p = (const unsigned char *) cvp;
  598|       |#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus)
  599|       |    return GET(32,p);
  600|       |#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) && !defined(__cplusplus)
  601|    140|    return GETSWAPPED(32,p);
  ------------------
  |  |  492|    140|# define GETSWAPPED(SIZE,PTR)           SWAP##SIZE(GET(SIZE,PTR))
  |  |  ------------------
  |  |  |  |  505|    140|# define SWAP32                 bswap_32
  |  |  ------------------
  ------------------
  602|       |#else
  603|       |    return (p[3] | (p[2] << 8)
  604|       |            | ((uint32_t) p[1] << 16)
  605|       |            | ((uint32_t) p[0] << 24));
  606|       |#endif
  607|    140|}
f_cksum.c:store_32_be:
  550|     70|{
  551|     70|    unsigned char *p = (unsigned char *) vp;
  552|       |#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus)
  553|       |    PUT(32,p,val);
  554|       |#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) && !defined(__cplusplus)
  555|     70|    PUTSWAPPED(32,p,val);
  ------------------
  |  |  491|     70|# define PUTSWAPPED(SIZE,PTR,VAL)       PUT(SIZE,PTR,SWAP##SIZE(VAL))
  |  |  ------------------
  |  |  |  |  489|     70|# define PUT(SIZE,PTR,VAL)      (((struct { uint##SIZE##_t i; } __attribute__((packed)) *)(PTR))->i = (VAL))
  |  |  ------------------
  ------------------
  556|       |#else
  557|       |    p[0] = (val >> 24) & 0xff;
  558|       |    p[1] = (val >> 16) & 0xff;
  559|       |    p[2] = (val >>  8) & 0xff;
  560|       |    p[3] = (val      ) & 0xff;
  561|       |#endif
  562|     70|}
f_sched.c:load_32_be:
  596|    104|{
  597|    104|    const unsigned char *p = (const unsigned char *) cvp;
  598|       |#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus)
  599|       |    return GET(32,p);
  600|       |#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) && !defined(__cplusplus)
  601|    104|    return GETSWAPPED(32,p);
  ------------------
  |  |  492|    104|# define GETSWAPPED(SIZE,PTR)           SWAP##SIZE(GET(SIZE,PTR))
  |  |  ------------------
  |  |  |  |  505|    104|# define SWAP32                 bswap_32
  |  |  ------------------
  ------------------
  602|       |#else
  603|       |    return (p[3] | (p[2] << 8)
  604|       |            | ((uint32_t) p[1] << 16)
  605|       |            | ((uint32_t) p[0] << 24));
  606|       |#endif
  607|    104|}

mit_des_cbc_encrypt:
  247|    105|{
  248|       |    /*
  249|       |     * Deal with encryption and decryption separately.
  250|       |     */
  251|    105|    if (enc)
  ------------------
  |  Branch (251:9): [True: 35, False: 70]
  ------------------
  252|     35|        des_cbc_encrypt(in, out, length, schedule, ivec);
  253|     70|    else
  254|     70|        des_cbc_decrypt(in, out, length, schedule, ivec);
  255|    105|    return 0;
  256|    105|}
fuzz_des.c:des_cbc_encrypt:
   67|     35|{
   68|     35|    unsigned DES_INT32 left, right;
   69|     35|    const unsigned DES_INT32 *kp;
   70|     35|    const unsigned char *ip;
   71|     35|    unsigned char *op;
   72|       |
   73|       |    /*
   74|       |     * Get key pointer here.  This won't need to be reinitialized
   75|       |     */
   76|     35|    kp = (const unsigned DES_INT32 *)schedule;
   77|       |
   78|       |    /*
   79|       |     * Initialize left and right with the contents of the initial
   80|       |     * vector.
   81|       |     */
   82|     35|    ip = ivec;
   83|     35|    GET_HALF_BLOCK(left, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
   84|     35|    GET_HALF_BLOCK(right, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
   85|       |
   86|       |    /*
   87|       |     * Suitably initialized, now work the length down 8 bytes
   88|       |     * at a time.
   89|       |     */
   90|     35|    ip = *in;
   91|     35|    op = *out;
   92|     70|    while (length > 0) {
  ------------------
  |  Branch (92:12): [True: 35, False: 35]
  ------------------
   93|       |        /*
   94|       |         * Get more input, xor it in.  If the length is
   95|       |         * greater than or equal to 8 this is straight
   96|       |         * forward.  Otherwise we have to fart around.
   97|       |         */
   98|     35|        if (length >= 8) {
  ------------------
  |  Branch (98:13): [True: 35, False: 0]
  ------------------
   99|     35|            unsigned DES_INT32 temp;
  100|     35|            GET_HALF_BLOCK(temp, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
  101|     35|            left  ^= temp;
  102|     35|            GET_HALF_BLOCK(temp, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
  103|     35|            right ^= temp;
  104|     35|            length -= 8;
  105|     35|        } else {
  106|       |            /*
  107|       |             * Oh, shoot.  We need to pad the
  108|       |             * end with zeroes.  Work backwards
  109|       |             * to do this.
  110|       |             */
  111|      0|            ip += (int) length;
  112|      0|            switch(length) {
  ------------------
  |  Branch (112:20): [True: 0, False: 0]
  ------------------
  113|      0|            case 7:
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|                right ^= (*(--ip) & FF_UINT32) <<  8;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  115|      0|            case 6:
  ------------------
  |  Branch (115:13): [True: 0, False: 0]
  ------------------
  116|      0|                right ^= (*(--ip) & FF_UINT32) << 16;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  117|      0|            case 5:
  ------------------
  |  Branch (117:13): [True: 0, False: 0]
  ------------------
  118|      0|                right ^= (*(--ip) & FF_UINT32) << 24;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  119|      0|            case 4:
  ------------------
  |  Branch (119:13): [True: 0, False: 0]
  ------------------
  120|      0|                left  ^=  *(--ip) & FF_UINT32;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  121|      0|            case 3:
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      0|                left  ^= (*(--ip) & FF_UINT32) <<  8;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  123|      0|            case 2:
  ------------------
  |  Branch (123:13): [True: 0, False: 0]
  ------------------
  124|      0|                left  ^= (*(--ip) & FF_UINT32) << 16;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  125|      0|            case 1:
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|      0|                left  ^= (*(--ip) & FF_UINT32) << 24;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  127|      0|                break;
  128|      0|            }
  129|      0|            length = 0;
  130|      0|        }
  131|       |
  132|       |        /*
  133|       |         * Encrypt what we have
  134|       |         */
  135|     35|        DES_DO_ENCRYPT(left, right, kp);
  ------------------
  |  |  270|     35|#define DES_DO_ENCRYPT DES_DO_ENCRYPT_1
  |  |  ------------------
  |  |  |  |  230|     35|    do {                                                                \
  |  |  |  |  231|     35|        int i;                                                          \
  |  |  |  |  232|     35|        unsigned DES_INT32 temp1;                                       \
  |  |  |  |  233|     35|        DEB (("do_encrypt %8lX %8lX \n", left, right));                 \
  |  |  |  |  234|     35|        DES_INITIAL_PERM((left), (right), (temp1));                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  161|     35|#define DES_INITIAL_PERM(left, right, temp) do {        \
  |  |  |  |  |  |  162|     35|        (temp) = DES_IP_RIGHT_BITS((left), (right));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|     35|    (((left) & 0xaaaaaaaa) |                                    \
  |  |  |  |  |  |  |  |  151|     35|     ( ( (unsigned DES_INT32) ((right) & 0xaaaaaaaa) ) >> 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|     35|        (right) = DES_IP_LEFT_BITS((left), (right));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  148|     35|    ((((left) & 0x55555555) << 1) | ((right) & 0x55555555))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  164|     35|        (left) = IP[((right) >> 24) & 0xff]             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  165|     35|            | (IP[((right) >> 16) & 0xff] << 1)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  166|     35|            | (IP[((right) >>  8) & 0xff] << 2)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  167|     35|            | (IP[(right) & 0xff] << 3);                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  168|     35|        (right) = IP[((temp) >> 24) & 0xff]             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  169|     35|            | (IP[((temp) >> 16) & 0xff] << 1)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|     35|            | (IP[((temp) >>  8) & 0xff] << 2)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  171|     35|            | (IP[(temp) & 0xff] << 3);                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|     35|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:13): [Folded, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  235|     35|        DEB (("  after IP %8lX %8lX\n", left, right));                  \
  |  |  |  |  236|    315|        for (i = 0; i < 8; i++) {                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (236:21): [True: 280, False: 35]
  |  |  |  |  ------------------
  |  |  |  |  237|    280|            DES_SP_ENCRYPT_ROUND((left), (right), (temp1), (kp));       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    280|#define DES_SP_ENCRYPT_ROUND(left, right, temp, kp) do {        \
  |  |  |  |  |  |  105|    280|        (temp) = (((right) >> 11) | ((right) << 21)) ^ *(kp)++; \
  |  |  |  |  |  |  106|    280|        (left) ^= SP[0][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    280|            | SP[1][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    280|            | SP[2][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    280|            | SP[3][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    280|        (temp) = (((right) >> 23) | ((right) << 9)) ^ *(kp)++;  \
  |  |  |  |  |  |  111|    280|        (left) ^= SP[4][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    280|            | SP[5][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    280|            | SP[6][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  114|    280|            | SP[7][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    280|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:13): [Folded, False: 280]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  238|    280|            DEB (("  round %2d %8lX %8lX \n", i*2, left, right));       \
  |  |  |  |  239|    280|            DES_SP_ENCRYPT_ROUND((right), (left), (temp1), (kp));       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    280|#define DES_SP_ENCRYPT_ROUND(left, right, temp, kp) do {        \
  |  |  |  |  |  |  105|    280|        (temp) = (((right) >> 11) | ((right) << 21)) ^ *(kp)++; \
  |  |  |  |  |  |  106|    280|        (left) ^= SP[0][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    280|            | SP[1][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    280|            | SP[2][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    280|            | SP[3][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    280|        (temp) = (((right) >> 23) | ((right) << 9)) ^ *(kp)++;  \
  |  |  |  |  |  |  111|    280|        (left) ^= SP[4][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    280|            | SP[5][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    280|            | SP[6][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  114|    280|            | SP[7][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    280|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:13): [Folded, False: 280]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  240|    280|            DEB (("  round %2d %8lX %8lX \n", 1+i*2, left, right));     \
  |  |  |  |  241|    280|        }                                                               \
  |  |  |  |  242|     35|        DES_FINAL_PERM((left), (right), (temp1));                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|     35|#define DES_FINAL_PERM(left, right, temp) do {          \
  |  |  |  |  |  |  198|     35|        (temp) = DES_FP_RIGHT_BITS((right), (left));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|     35|    (((left) & 0xf0f0f0f0) |                                    \
  |  |  |  |  |  |  |  |  187|     35|     ( ( (unsigned DES_INT32) ((right) & 0xf0f0f0f0) ) >> 4))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  199|     35|        (right) = DES_FP_LEFT_BITS((right), (left));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|     35|    ((((left) & 0x0f0f0f0f) << 4) | ((right) & 0x0f0f0f0f))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  200|     35|        (left) = (FP[((right) >> 24) & 0xff] << 6)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  201|     35|            | (FP[((right) >> 16) & 0xff] << 4)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  202|     35|            | (FP[((right) >>  8) & 0xff] << 2)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  203|     35|            |  FP[(right) & 0xff];                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  204|     35|        (right) = (FP[((temp) >> 24) & 0xff] << 6)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  205|     35|            | (FP[((temp) >> 16) & 0xff] << 4)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  206|     35|            | (FP[((temp) >>  8) & 0xff] << 2)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  207|     35|            |  FP[temp & 0xff];                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  208|     35|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:13): [Folded, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  243|     35|        (kp) -= (2 * 16);                                               \
  |  |  |  |  244|     35|        DEB (("  after FP %8lX %8lX \n", left, right));                 \
  |  |  |  |  245|     35|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (245:14): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|       |
  137|       |        /*
  138|       |         * Copy the results out
  139|       |         */
  140|     35|        PUT_HALF_BLOCK(left, op);
  ------------------
  |  |  279|     35|#define PUT_HALF_BLOCK(lr, op)  (store_32_be(lr, op), (op) += 4)
  ------------------
  141|     35|        PUT_HALF_BLOCK(right, op);
  ------------------
  |  |  279|     35|#define PUT_HALF_BLOCK(lr, op)  (store_32_be(lr, op), (op) += 4)
  ------------------
  142|     35|    }
  143|     35|}
fuzz_des.c:des_cbc_decrypt:
  149|     70|{
  150|     70|    unsigned DES_INT32 left, right;
  151|     70|    const unsigned DES_INT32 *kp;
  152|     70|    const unsigned char *ip;
  153|     70|    unsigned char *op;
  154|     70|    unsigned DES_INT32 ocipherl, ocipherr;
  155|     70|    unsigned DES_INT32 cipherl, cipherr;
  156|       |
  157|       |    /*
  158|       |     * Get key pointer here.  This won't need to be reinitialized
  159|       |     */
  160|     70|    kp = (const unsigned DES_INT32 *)schedule;
  161|       |
  162|       |    /*
  163|       |     * Decrypting is harder than encrypting because of
  164|       |     * the necessity of remembering a lot more things.
  165|       |     * Should think about this a little more...
  166|       |     */
  167|       |
  168|     70|    if (length <= 0)
  ------------------
  |  Branch (168:9): [True: 0, False: 70]
  ------------------
  169|      0|        return;
  170|       |
  171|       |    /*
  172|       |     * Prime the old cipher with ivec.
  173|       |     */
  174|     70|    ip = ivec;
  175|     70|    GET_HALF_BLOCK(ocipherl, ip);
  ------------------
  |  |  278|     70|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
  176|     70|    GET_HALF_BLOCK(ocipherr, ip);
  ------------------
  |  |  278|     70|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
  177|       |
  178|       |    /*
  179|       |     * Now do this in earnest until we run out of length.
  180|       |     */
  181|     70|    ip = *in;
  182|     70|    op = *out;
  183|     70|    for (;;) {              /* check done inside loop */
  184|       |        /*
  185|       |         * Read a block from the input into left and
  186|       |         * right.  Save this cipher block for later.
  187|       |         */
  188|     70|        GET_HALF_BLOCK(left, ip);
  ------------------
  |  |  278|     70|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
  189|     70|        GET_HALF_BLOCK(right, ip);
  ------------------
  |  |  278|     70|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
  190|     70|        cipherl = left;
  191|     70|        cipherr = right;
  192|       |
  193|       |        /*
  194|       |         * Decrypt this.
  195|       |         */
  196|     70|        DES_DO_DECRYPT(left, right, kp);
  ------------------
  |  |  271|     70|#define DES_DO_DECRYPT DES_DO_DECRYPT_1
  |  |  ------------------
  |  |  |  |  248|     70|    do {                                                                \
  |  |  |  |  249|     70|        int i;                                                          \
  |  |  |  |  250|     70|        unsigned DES_INT32 temp2;                                       \
  |  |  |  |  251|     70|        DES_INITIAL_PERM((left), (right), (temp2));                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  161|     70|#define DES_INITIAL_PERM(left, right, temp) do {        \
  |  |  |  |  |  |  162|     70|        (temp) = DES_IP_RIGHT_BITS((left), (right));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|     70|    (((left) & 0xaaaaaaaa) |                                    \
  |  |  |  |  |  |  |  |  151|     70|     ( ( (unsigned DES_INT32) ((right) & 0xaaaaaaaa) ) >> 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|     70|        (right) = DES_IP_LEFT_BITS((left), (right));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  148|     70|    ((((left) & 0x55555555) << 1) | ((right) & 0x55555555))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  164|     70|        (left) = IP[((right) >> 24) & 0xff]             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  165|     70|            | (IP[((right) >> 16) & 0xff] << 1)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  166|     70|            | (IP[((right) >>  8) & 0xff] << 2)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  167|     70|            | (IP[(right) & 0xff] << 3);                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  168|     70|        (right) = IP[((temp) >> 24) & 0xff]             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  169|     70|            | (IP[((temp) >> 16) & 0xff] << 1)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|     70|            | (IP[((temp) >>  8) & 0xff] << 2)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  171|     70|            | (IP[(temp) & 0xff] << 3);                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     70|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|     70|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:13): [Folded, False: 70]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  252|     70|        (kp) += (2 * 16);                                               \
  |  |  |  |  253|    630|        for (i = 0; i < 8; i++) {                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (253:21): [True: 560, False: 70]
  |  |  |  |  ------------------
  |  |  |  |  254|    560|            DES_SP_DECRYPT_ROUND((left), (right), (temp2), (kp));       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    560|#define DES_SP_DECRYPT_ROUND(left, right, temp, kp) do {                \
  |  |  |  |  |  |  118|    560|        (temp) = (((right) >> 23) | ((right) << 9)) ^ *(--(kp));        \
  |  |  |  |  |  |  119|    560|        (left) ^= SP[7][((temp)      ) & 0x3f]                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  120|    560|            | SP[6][((temp) >>  8) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  121|    560|            | SP[5][((temp) >> 16) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    560|            | SP[4][((temp) >> 24) & 0x3f];                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    560|        (temp) = (((right) >> 11) | ((right) << 21)) ^ *(--(kp));       \
  |  |  |  |  |  |  124|    560|        (left) ^= SP[3][((temp)      ) & 0x3f]                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  125|    560|            | SP[2][((temp) >>  8) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  126|    560|            | SP[1][((temp) >> 16) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  127|    560|            | SP[0][((temp) >> 24) & 0x3f];                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  128|    560|    } while (0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (128:14): [Folded, False: 560]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  255|    560|            DES_SP_DECRYPT_ROUND((right), (left), (temp2), (kp));       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    560|#define DES_SP_DECRYPT_ROUND(left, right, temp, kp) do {                \
  |  |  |  |  |  |  118|    560|        (temp) = (((right) >> 23) | ((right) << 9)) ^ *(--(kp));        \
  |  |  |  |  |  |  119|    560|        (left) ^= SP[7][((temp)      ) & 0x3f]                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  120|    560|            | SP[6][((temp) >>  8) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  121|    560|            | SP[5][((temp) >> 16) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  122|    560|            | SP[4][((temp) >> 24) & 0x3f];                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    560|        (temp) = (((right) >> 11) | ((right) << 21)) ^ *(--(kp));       \
  |  |  |  |  |  |  124|    560|        (left) ^= SP[3][((temp)      ) & 0x3f]                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  125|    560|            | SP[2][((temp) >>  8) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  126|    560|            | SP[1][((temp) >> 16) & 0x3f]                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  127|    560|            | SP[0][((temp) >> 24) & 0x3f];                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    560|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  128|    560|    } while (0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (128:14): [Folded, False: 560]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  256|    560|        }                                                               \
  |  |  |  |  257|     70|        DES_FINAL_PERM((left), (right), (temp2));                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|     70|#define DES_FINAL_PERM(left, right, temp) do {          \
  |  |  |  |  |  |  198|     70|        (temp) = DES_FP_RIGHT_BITS((right), (left));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|     70|    (((left) & 0xf0f0f0f0) |                                    \
  |  |  |  |  |  |  |  |  187|     70|     ( ( (unsigned DES_INT32) ((right) & 0xf0f0f0f0) ) >> 4))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  199|     70|        (right) = DES_FP_LEFT_BITS((right), (left));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|     70|    ((((left) & 0x0f0f0f0f) << 4) | ((right) & 0x0f0f0f0f))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  200|     70|        (left) = (FP[((right) >> 24) & 0xff] << 6)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  201|     70|            | (FP[((right) >> 16) & 0xff] << 4)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  202|     70|            | (FP[((right) >>  8) & 0xff] << 2)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  203|     70|            |  FP[(right) & 0xff];                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  204|     70|        (right) = (FP[((temp) >> 24) & 0xff] << 6)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  205|     70|            | (FP[((temp) >> 16) & 0xff] << 4)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  206|     70|            | (FP[((temp) >>  8) & 0xff] << 2)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  207|     70|            |  FP[temp & 0xff];                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     70|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  208|     70|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:13): [Folded, False: 70]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  258|     70|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (258:14): [Folded, False: 70]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |
  198|       |        /*
  199|       |         * Xor with the old cipher to get plain
  200|       |         * text.  Output 8 or less bytes of this.
  201|       |         */
  202|     70|        left ^= ocipherl;
  203|     70|        right ^= ocipherr;
  204|     70|        if (length > 8) {
  ------------------
  |  Branch (204:13): [True: 0, False: 70]
  ------------------
  205|      0|            length -= 8;
  206|      0|            PUT_HALF_BLOCK(left, op);
  ------------------
  |  |  279|      0|#define PUT_HALF_BLOCK(lr, op)  (store_32_be(lr, op), (op) += 4)
  ------------------
  207|      0|            PUT_HALF_BLOCK(right, op);
  ------------------
  |  |  279|      0|#define PUT_HALF_BLOCK(lr, op)  (store_32_be(lr, op), (op) += 4)
  ------------------
  208|       |            /*
  209|       |             * Save current cipher block here
  210|       |             */
  211|      0|            ocipherl = cipherl;
  212|      0|            ocipherr = cipherr;
  213|     70|        } else {
  214|       |            /*
  215|       |             * Trouble here.  Start at end of output,
  216|       |             * work backwards.
  217|       |             */
  218|     70|            op += (int) length;
  219|     70|            switch(length) {
  ------------------
  |  Branch (219:20): [True: 70, False: 0]
  ------------------
  220|     70|            case 8:
  ------------------
  |  Branch (220:13): [True: 70, False: 0]
  ------------------
  221|     70|                *(--op) = (unsigned char) (right & 0xff);
  222|     70|            case 7:
  ------------------
  |  Branch (222:13): [True: 0, False: 70]
  ------------------
  223|     70|                *(--op) = (unsigned char) ((right >> 8) & 0xff);
  224|     70|            case 6:
  ------------------
  |  Branch (224:13): [True: 0, False: 70]
  ------------------
  225|     70|                *(--op) = (unsigned char) ((right >> 16) & 0xff);
  226|     70|            case 5:
  ------------------
  |  Branch (226:13): [True: 0, False: 70]
  ------------------
  227|     70|                *(--op) = (unsigned char) ((right >> 24) & 0xff);
  228|     70|            case 4:
  ------------------
  |  Branch (228:13): [True: 0, False: 70]
  ------------------
  229|     70|                *(--op) = (unsigned char) (left & 0xff);
  230|     70|            case 3:
  ------------------
  |  Branch (230:13): [True: 0, False: 70]
  ------------------
  231|     70|                *(--op) = (unsigned char) ((left >> 8) & 0xff);
  232|     70|            case 2:
  ------------------
  |  Branch (232:13): [True: 0, False: 70]
  ------------------
  233|     70|                *(--op) = (unsigned char) ((left >> 16) & 0xff);
  234|     70|            case 1:
  ------------------
  |  Branch (234:13): [True: 0, False: 70]
  ------------------
  235|     70|                *(--op) = (unsigned char) ((left >> 24) & 0xff);
  236|     70|                break;
  237|     70|            }
  238|     70|            break;          /* we're done */
  239|     70|        }
  240|     70|    }
  241|     70|}

mit_des_cbc_cksum:
   57|     35|{
   58|     35|    unsigned DES_INT32 left, right;
   59|     35|    const unsigned DES_INT32 *kp;
   60|     35|    const unsigned char *ip;
   61|     35|    unsigned char *op;
   62|     35|    DES_INT32 len;
  ------------------
  |  |   85|     35|#define DES_INT32 int
  ------------------
   63|       |
   64|       |    /*
   65|       |     * Initialize left and right with the contents of the initial
   66|       |     * vector.
   67|       |     */
   68|     35|    ip = ivec;
   69|     35|    GET_HALF_BLOCK(left, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
   70|     35|    GET_HALF_BLOCK(right, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
   71|       |
   72|       |    /*
   73|       |     * Suitably initialized, now work the length down 8 bytes
   74|       |     * at a time.
   75|       |     */
   76|     35|    ip = in;
   77|     35|    len = length;
   78|     70|    while (len > 0) {
  ------------------
  |  Branch (78:12): [True: 35, False: 35]
  ------------------
   79|       |        /*
   80|       |         * Get more input, xor it in.  If the length is
   81|       |         * greater than or equal to 8 this is straight
   82|       |         * forward.  Otherwise we have to fart around.
   83|       |         */
   84|     35|        if (len >= 8) {
  ------------------
  |  Branch (84:13): [True: 35, False: 0]
  ------------------
   85|     35|            unsigned DES_INT32 temp;
   86|     35|            GET_HALF_BLOCK(temp, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
   87|     35|            left  ^= temp;
   88|     35|            GET_HALF_BLOCK(temp, ip);
  ------------------
  |  |  278|     35|#define GET_HALF_BLOCK(lr, ip)  ((lr) = load_32_be(ip), (ip) += 4)
  ------------------
   89|     35|            right ^= temp;
   90|     35|            len -= 8;
   91|     35|        } else {
   92|       |            /*
   93|       |             * Oh, shoot.  We need to pad the
   94|       |             * end with zeroes.  Work backwards
   95|       |             * to do this.
   96|       |             */
   97|      0|            ip += (int) len;
   98|      0|            switch(len) {
  ------------------
  |  Branch (98:20): [True: 0, False: 0]
  ------------------
   99|      0|            case 7:
  ------------------
  |  Branch (99:13): [True: 0, False: 0]
  ------------------
  100|      0|                right ^= (*(--ip) & FF_UINT32) <<  8;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  101|      0|            case 6:
  ------------------
  |  Branch (101:13): [True: 0, False: 0]
  ------------------
  102|      0|                right ^= (*(--ip) & FF_UINT32) << 16;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  103|      0|            case 5:
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|                right ^= (*(--ip) & FF_UINT32) << 24;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  105|      0|            case 4:
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|                left  ^=  *(--ip) & FF_UINT32;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  107|      0|            case 3:
  ------------------
  |  Branch (107:13): [True: 0, False: 0]
  ------------------
  108|      0|                left  ^= (*(--ip) & FF_UINT32) <<  8;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  109|      0|            case 2:
  ------------------
  |  Branch (109:13): [True: 0, False: 0]
  ------------------
  110|      0|                left  ^= (*(--ip) & FF_UINT32) << 16;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  111|      0|            case 1:
  ------------------
  |  Branch (111:13): [True: 0, False: 0]
  ------------------
  112|      0|                left  ^= (*(--ip) & FF_UINT32) << 24;
  ------------------
  |  |  283|      0|#define FF_UINT32       ((unsigned DES_INT32) 0xFF)
  ------------------
  113|      0|                break;
  114|      0|            }
  115|      0|            len = 0;
  116|      0|        }
  117|       |
  118|       |        /*
  119|       |         * Encrypt what we have
  120|       |         */
  121|     35|        kp = (const unsigned DES_INT32 *)schedule;
  122|     35|        DES_DO_ENCRYPT(left, right, kp);
  ------------------
  |  |  270|     35|#define DES_DO_ENCRYPT DES_DO_ENCRYPT_1
  |  |  ------------------
  |  |  |  |  230|     35|    do {                                                                \
  |  |  |  |  231|     35|        int i;                                                          \
  |  |  |  |  232|     35|        unsigned DES_INT32 temp1;                                       \
  |  |  |  |  233|     35|        DEB (("do_encrypt %8lX %8lX \n", left, right));                 \
  |  |  |  |  234|     35|        DES_INITIAL_PERM((left), (right), (temp1));                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  161|     35|#define DES_INITIAL_PERM(left, right, temp) do {        \
  |  |  |  |  |  |  162|     35|        (temp) = DES_IP_RIGHT_BITS((left), (right));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|     35|    (((left) & 0xaaaaaaaa) |                                    \
  |  |  |  |  |  |  |  |  151|     35|     ( ( (unsigned DES_INT32) ((right) & 0xaaaaaaaa) ) >> 1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  163|     35|        (right) = DES_IP_LEFT_BITS((left), (right));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  148|     35|    ((((left) & 0x55555555) << 1) | ((right) & 0x55555555))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  164|     35|        (left) = IP[((right) >> 24) & 0xff]             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  165|     35|            | (IP[((right) >> 16) & 0xff] << 1)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  166|     35|            | (IP[((right) >>  8) & 0xff] << 2)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  167|     35|            | (IP[(right) & 0xff] << 3);                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  168|     35|        (right) = IP[((temp) >> 24) & 0xff]             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  169|     35|            | (IP[((temp) >> 16) & 0xff] << 1)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|     35|            | (IP[((temp) >>  8) & 0xff] << 2)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  171|     35|            | (IP[(temp) & 0xff] << 3);                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   50|     35|#define IP      des_IP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|     35|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:13): [Folded, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  235|     35|        DEB (("  after IP %8lX %8lX\n", left, right));                  \
  |  |  |  |  236|    315|        for (i = 0; i < 8; i++) {                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (236:21): [True: 280, False: 35]
  |  |  |  |  ------------------
  |  |  |  |  237|    280|            DES_SP_ENCRYPT_ROUND((left), (right), (temp1), (kp));       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    280|#define DES_SP_ENCRYPT_ROUND(left, right, temp, kp) do {        \
  |  |  |  |  |  |  105|    280|        (temp) = (((right) >> 11) | ((right) << 21)) ^ *(kp)++; \
  |  |  |  |  |  |  106|    280|        (left) ^= SP[0][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    280|            | SP[1][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    280|            | SP[2][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    280|            | SP[3][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    280|        (temp) = (((right) >> 23) | ((right) << 9)) ^ *(kp)++;  \
  |  |  |  |  |  |  111|    280|        (left) ^= SP[4][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    280|            | SP[5][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    280|            | SP[6][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  114|    280|            | SP[7][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    280|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:13): [Folded, False: 280]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  238|    280|            DEB (("  round %2d %8lX %8lX \n", i*2, left, right));       \
  |  |  |  |  239|    280|            DES_SP_ENCRYPT_ROUND((right), (left), (temp1), (kp));       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    280|#define DES_SP_ENCRYPT_ROUND(left, right, temp, kp) do {        \
  |  |  |  |  |  |  105|    280|        (temp) = (((right) >> 11) | ((right) << 21)) ^ *(kp)++; \
  |  |  |  |  |  |  106|    280|        (left) ^= SP[0][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    280|            | SP[1][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    280|            | SP[2][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    280|            | SP[3][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|    280|        (temp) = (((right) >> 23) | ((right) << 9)) ^ *(kp)++;  \
  |  |  |  |  |  |  111|    280|        (left) ^= SP[4][((temp) >> 24) & 0x3f]                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    280|            | SP[5][((temp) >> 16) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    280|            | SP[6][((temp) >>  8) & 0x3f]                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  114|    280|            | SP[7][((temp)      ) & 0x3f];                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|    280|#define SP      des_SP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    280|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:13): [Folded, False: 280]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  240|    280|            DEB (("  round %2d %8lX %8lX \n", 1+i*2, left, right));     \
  |  |  |  |  241|    280|        }                                                               \
  |  |  |  |  242|     35|        DES_FINAL_PERM((left), (right), (temp1));                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|     35|#define DES_FINAL_PERM(left, right, temp) do {          \
  |  |  |  |  |  |  198|     35|        (temp) = DES_FP_RIGHT_BITS((right), (left));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|     35|    (((left) & 0xf0f0f0f0) |                                    \
  |  |  |  |  |  |  |  |  187|     35|     ( ( (unsigned DES_INT32) ((right) & 0xf0f0f0f0) ) >> 4))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  199|     35|        (right) = DES_FP_LEFT_BITS((right), (left));    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|     35|    ((((left) & 0x0f0f0f0f) << 4) | ((right) & 0x0f0f0f0f))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  200|     35|        (left) = (FP[((right) >> 24) & 0xff] << 6)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  201|     35|            | (FP[((right) >> 16) & 0xff] << 4)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  202|     35|            | (FP[((right) >>  8) & 0xff] << 2)         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  203|     35|            |  FP[(right) & 0xff];                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  204|     35|        (right) = (FP[((temp) >> 24) & 0xff] << 6)      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  205|     35|            | (FP[((temp) >> 16) & 0xff] << 4)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  206|     35|            | (FP[((temp) >>  8) & 0xff] << 2)          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  207|     35|            |  FP[temp & 0xff];                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   51|     35|#define FP      des_FP_table
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  208|     35|    } while(0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:13): [Folded, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  243|     35|        (kp) -= (2 * 16);                                               \
  |  |  |  |  244|     35|        DEB (("  after FP %8lX %8lX \n", left, right));                 \
  |  |  |  |  245|     35|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (245:14): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|     35|    }
  124|       |
  125|       |    /*
  126|       |     * Done.  Left and right have the checksum.  Put it into
  127|       |     * the output.
  128|       |     */
  129|     35|    op = out;
  130|     35|    PUT_HALF_BLOCK(left, op);
  ------------------
  |  |  279|     35|#define PUT_HALF_BLOCK(lr, op)  (store_32_be(lr, op), (op) += 4)
  ------------------
  131|     35|    PUT_HALF_BLOCK(right, op);
  ------------------
  |  |  279|     35|#define PUT_HALF_BLOCK(lr, op)  (store_32_be(lr, op), (op) += 4)
  ------------------
  132|       |
  133|       |    /*
  134|       |     * Return right.  I'll bet the MIT code returns this
  135|       |     * inconsistantly (with the low order byte of the checksum
  136|       |     * not always in the low order byte of the DES_INT32).  We won't.
  137|       |     */
  138|     35|    return right & 0xFFFFFFFFUL;
  139|     35|}

mit_des_check_key_parity:
   50|     52|{
   51|     52|    unsigned int i;
   52|       |
   53|    417|    for (i=0; i<sizeof(mit_des_cblock); i++)
  ------------------
  |  Branch (53:15): [True: 375, False: 42]
  ------------------
   54|    375|    {
   55|    375|        if((key[i] & 1) == parity_char(0xfe&key[i]))
  ------------------
  |  |   24|    375|#define parity_char(x) pstep(pstep(pstep((x),4),2),1)
  |  |  ------------------
  |  |  |  |   23|    375|#define pstep(x,step) (((x)&smask(step))^(((x)>>step)&smask(step)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    375|#define smask(step) ((1<<step)-1)
  |  |  |  |  ------------------
  |  |  |  |               #define pstep(x,step) (((x)&smask(step))^(((x)>>step)&smask(step)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    375|#define smask(step) ((1<<step)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (55:12): [True: 10, False: 365]
  ------------------
   56|     10|        {
   57|     10|            return 0;
   58|     10|        }
   59|    375|    }
   60|       |
   61|     42|    return(1);
   62|     52|}

mit_des_make_key_sched:
  245|     52|{
  246|     52|    unsigned DES_INT32 c, d;
  247|       |
  248|     52|    {
  249|       |        /*
  250|       |         * Need a pointer for the keys and a temporary DES_INT32
  251|       |         */
  252|     52|        const unsigned char *k;
  253|     52|        unsigned DES_INT32 tmp;
  254|       |
  255|       |        /*
  256|       |         * Fetch the key into something we can work with
  257|       |         */
  258|     52|        k = key;
  259|       |
  260|       |        /*
  261|       |         * The first permutted choice gives us the 28 bits for C0 and
  262|       |         * 28 for D0.  C0 gets 12 bits from the left key and 16 from
  263|       |         * the right, while D0 gets 16 from the left and 12 from the
  264|       |         * right.  The code knows which bits go where.
  265|       |         */
  266|     52|        tmp = load_32_be(k), k += 4;
  267|       |
  268|     52|        c =  PC1_CL[(tmp >> 29) & 0x7]
  269|     52|            | (PC1_CL[(tmp >> 21) & 0x7] << 1)
  270|     52|            | (PC1_CL[(tmp >> 13) & 0x7] << 2)
  271|     52|            | (PC1_CL[(tmp >>  5) & 0x7] << 3);
  272|     52|        d =  PC1_DL[(tmp >> 25) & 0xf]
  273|     52|            | (PC1_DL[(tmp >> 17) & 0xf] << 1)
  274|     52|            | (PC1_DL[(tmp >>  9) & 0xf] << 2)
  275|     52|            | (PC1_DL[(tmp >>  1) & 0xf] << 3);
  276|       |
  277|     52|        tmp = load_32_be(k), k += 4;
  278|       |
  279|     52|        c |= PC1_CR[(tmp >> 28) & 0xf]
  280|     52|            | (PC1_CR[(tmp >> 20) & 0xf] << 1)
  281|     52|            | (PC1_CR[(tmp >> 12) & 0xf] << 2)
  282|     52|            | (PC1_CR[(tmp >>  4) & 0xf] << 3);
  283|     52|        d |= PC1_DR[(tmp >> 25) & 0x7]
  284|     52|            | (PC1_DR[(tmp >> 17) & 0x7] << 1)
  285|     52|            | (PC1_DR[(tmp >>  9) & 0x7] << 2)
  286|     52|            | (PC1_DR[(tmp >>  1) & 0x7] << 3);
  287|     52|    }
  288|       |
  289|     52|    {
  290|       |        /*
  291|       |         * Need several temporaries in here
  292|       |         */
  293|     52|        unsigned DES_INT32 ltmp, rtmp;
  294|     52|        unsigned DES_INT32 *k;
  295|     52|        int two_bit_shifts;
  296|     52|        int i;
  297|       |        /*
  298|       |         * Now iterate to compute the key schedule.  Note that we
  299|       |         * record the entire set of subkeys in 6 bit chunks since
  300|       |         * they are used that way.  At 6 bits/char, we need
  301|       |         * 48/6 char's/subkey * 16 subkeys/encryption == 128 bytes.
  302|       |         * The schedule must be this big.
  303|       |         */
  304|     52|        k = (unsigned DES_INT32 *)schedule;
  305|     52|        two_bit_shifts = TWO_BIT_SHIFTS;
  ------------------
  |  |   74|     52|#define TWO_BIT_SHIFTS  0x7efc
  ------------------
  306|    884|        for (i = 16; i > 0; i--) {
  ------------------
  |  Branch (306:22): [True: 832, False: 52]
  ------------------
  307|       |            /*
  308|       |             * Do the rotation.  One bit and two bit rotations
  309|       |             * are done separately.  Note C and D are 28 bits.
  310|       |             */
  311|    832|            if (two_bit_shifts & 0x1) {
  ------------------
  |  Branch (311:17): [True: 624, False: 208]
  ------------------
  312|    624|                c = ((c << 2) & 0xffffffc) | (c >> 26);
  313|    624|                d = ((d << 2) & 0xffffffc) | (d >> 26);
  314|    624|            } else {
  315|    208|                c = ((c << 1) & 0xffffffe) | (c >> 27);
  316|    208|                d = ((d << 1) & 0xffffffe) | (d >> 27);
  317|    208|            }
  318|    832|            two_bit_shifts >>= 1;
  319|       |
  320|       |            /*
  321|       |             * Apply permutted choice 2 to C to get the first
  322|       |             * 24 bits worth of keys.  Note that bits 9, 18, 22
  323|       |             * and 25 (using DES numbering) in C are unused.  The
  324|       |             * shift-mask stuff is done to delete these bits from
  325|       |             * the indices, since this cuts the table size in half.
  326|       |             *
  327|       |             * The table is torqued, by the way.  If the standard
  328|       |             * byte order for this (high to low order) is 1234,
  329|       |             * the table actually gives us 4132.
  330|       |             */
  331|    832|            ltmp = PC2_C[0][((c >> 22) & 0x3f)]
  332|    832|                | PC2_C[1][((c >> 15) & 0xf) | ((c >> 16) & 0x30)]
  333|    832|                | PC2_C[2][((c >>  4) & 0x3) | ((c >>  9) & 0x3c)]
  334|    832|                | PC2_C[3][((c      ) & 0x7) | ((c >>  4) & 0x38)];
  335|       |            /*
  336|       |             * Apply permutted choice 2 to D to get the other half.
  337|       |             * Here, bits 7, 10, 15 and 26 go unused.  The sqeezing
  338|       |             * actually turns out to be cheaper here.
  339|       |             *
  340|       |             * This table is similarly torqued.  If the standard
  341|       |             * byte order is 5678, the table has the bytes permuted
  342|       |             * to give us 7685.
  343|       |             */
  344|    832|            rtmp = PC2_D[0][((d >> 22) & 0x3f)]
  345|    832|                | PC2_D[1][((d >> 14) & 0xf) | ((d >> 15) & 0x30)]
  346|    832|                | PC2_D[2][((d >>  7) & 0x3f)]
  347|    832|                | PC2_D[3][((d      ) & 0x3) | ((d >>  1) & 0x3c)];
  348|       |
  349|       |            /*
  350|       |             * Make up two words of the key schedule, with a
  351|       |             * byte order which is convenient for the DES
  352|       |             * inner loop.  The high order (first) word will
  353|       |             * hold bytes 7135 (high to low order) while the
  354|       |             * second holds bytes 4682.
  355|       |             */
  356|    832|            *k++ = (ltmp & 0x00ffff00) | (rtmp & 0xff0000ff);
  357|    832|            *k++ = (ltmp & 0xff0000ff) | (rtmp & 0x00ffff00);
  358|    832|        }
  359|     52|    }
  360|     52|    return (0);
  361|     52|}

mit_des_key_sched:
   53|     52|{
   54|     52|    mit_des_make_key_sched(k,schedule);
   55|       |
   56|     52|    if (!mit_des_check_key_parity(k))   /* bad parity --> return -1 */
  ------------------
  |  Branch (56:9): [True: 10, False: 42]
  ------------------
   57|     10|        return(-1);
   58|       |
   59|     42|    if (mit_des_is_weak_key(k))
  ------------------
  |  Branch (59:9): [True: 7, False: 35]
  ------------------
   60|      7|        return(-2);
   61|       |
   62|       |    /* if key was good, return 0 */
   63|     35|    return 0;
   64|     42|}

mit_des_is_weak_key:
   78|     42|{
   79|     42|    unsigned int i;
   80|     42|    const mit_des_cblock *weak_p = weak;
   81|       |
   82|    640|    for (i = 0; i < (sizeof(weak)/sizeof(mit_des_cblock)); i++) {
  ------------------
  |  Branch (82:17): [True: 605, False: 35]
  ------------------
   83|    605|        if (!memcmp(weak_p++,key,sizeof(mit_des_cblock)))
  ------------------
  |  Branch (83:13): [True: 7, False: 598]
  ------------------
   84|      7|            return 1;
   85|    605|    }
   86|       |
   87|     35|    return 0;
   88|     42|}

LLVMFuzzerTestOneInput:
   82|     90|{
   83|     90|    krb5_error_code ret;
   84|     90|    mit_des_key_schedule sched;
   85|     90|    uint8_t *data_in, input[8];
   86|       |
   87|     90|    if (size < kMinInputLength || size > kMaxInputLength)
  ------------------
  |  |   38|    180|#define kMinInputLength 32
  ------------------
                  if (size < kMinInputLength || size > kMaxInputLength)
  ------------------
  |  |   39|     82|#define kMaxInputLength 128
  ------------------
  |  Branch (87:9): [True: 8, False: 82]
  |  Branch (87:35): [True: 30, False: 52]
  ------------------
   88|     38|        return 0;
   89|       |
   90|     52|    memcpy(input, data, 8);
   91|     52|    ret = mit_des_key_sched(input, sched);
   92|     52|    if (ret)
  ------------------
  |  Branch (92:9): [True: 17, False: 35]
  ------------------
   93|     17|        return 0;
   94|       |
   95|     35|    memcpy(input, data + 8, 8);
   96|     35|    fuzz_des(input, sched);
   97|       |
   98|     35|    memcpy(input, data + 16, 8);
   99|     35|    fuzz_decrypt(input, sched);
  100|       |
  101|     35|    data_in = k5memdup(data + 24, size - 24, &ret);
  102|     35|    if (ret)
  ------------------
  |  Branch (102:9): [True: 0, False: 35]
  ------------------
  103|      0|        return 0;
  104|       |
  105|     35|    fuzz_cksum(data_in, sched);
  106|     35|    free(data_in);
  107|       |
  108|     35|    return 0;
  109|     35|}
fuzz_des.c:fuzz_des:
   47|     35|{
   48|     35|    uint8_t encrypt[8], decrypt[8];
   49|       |
   50|     35|    mit_des_cbc_encrypt((const mit_des_cblock *)input,
   51|     35|                        (mit_des_cblock *)encrypt, 8,
   52|     35|                        sched, default_ivec, MIT_DES_ENCRYPT);
  ------------------
  |  |  123|     35|#define MIT_DES_ENCRYPT 1
  ------------------
   53|       |
   54|     35|    mit_des_cbc_encrypt((const mit_des_cblock *)encrypt,
   55|     35|                        (mit_des_cblock *)decrypt, 8,
   56|     35|                        sched, default_ivec, MIT_DES_DECRYPT);
  ------------------
  |  |  124|     35|#define MIT_DES_DECRYPT 0
  ------------------
   57|       |
   58|     35|    if (memcmp(input, decrypt, 8) != 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 35]
  ------------------
   59|      0|        abort();
   60|     35|}
fuzz_des.c:fuzz_decrypt:
   64|     35|{
   65|     35|    uint8_t output[8];
   66|       |
   67|     35|    mit_des_cbc_encrypt((const mit_des_cblock *)input,
   68|     35|                        (mit_des_cblock *)output, 8,
   69|     35|                        sched, default_ivec, MIT_DES_DECRYPT);
  ------------------
  |  |  124|     35|#define MIT_DES_DECRYPT 0
  ------------------
   70|     35|}
fuzz_des.c:fuzz_cksum:
   74|     35|{
   75|     35|    uint8_t output[8];
   76|       |
   77|     35|    mit_des_cbc_cksum(input, output, 8, sched, default_ivec);
   78|     35|}

